This is a static archive of our old OSM Help Site. Please post any new questions and answers at community.openstreetmap.org.

Osm2pgsql errors with flex backend and Lua. Failed to execute Lua function […] Error in ‘add_row’

0

I am currently running a postgres DB in a docker container. I want to upload a small pbf file usinf osm2pgsql using the new flex-backend. However i'm runing into problems with Lua.

My osm command:

osm2pgsql -d osm -U osm2pgsql -H XXX.XX.XX.XXX -P 5432 -c pbf_files/district-of-columbia-latest.osm.pbf -W -O flex -S flex-config/unitable.lua --flat-nodes flat-nodes --keep-coastlines --cache 30000 --hstore --hstore-add-index --tablespace-index pg_default --number-processes 8 --cache-strategy dense --extra-attributes --slim

The error message: 2021-07-30 17:30:52 node cache: stored: 3(100.00%), storage efficiency: 0.02% (dense blocks: 2, sparse nodes: 0), hit rate: 0.00% 2021-07-30 17:30:52 ERROR: Failed to execute Lua function 'osm2pgsql.process_node': flex-config/unitable.lua:42: Error in 'add_row': Invalid type 'table' for text column.

stack traceback: [C]: in method 'add_row' flex-config/unitable.lua:42: in function 'process' flex-config/unitable.lua:53: in function <flex-config unitable.lua:52="">.

I can run the upload with the default backend and I've tried all default templates provided by osm2pgsql but know of them work, they all return the same error.

Would greatly appreciate some help. Chris

asked 30 Jul '21, 18:49

chrisvreug's gravatar image

chrisvreug
11112
accept rate: 0%


One Answer:

0

You are using an older version of osm2pgsql (before 1.5.0) with a config file (unitable.lua) that is made for osm2pgsql 1.5.0 or greater. Update your osm2pgsql to 1.5.1 or use an older version of the unitable.lua file.

Also: Check your command line. Many of the options you are using don't do anything when the flex output is used, so you should probably get rid of them.

answered 31 Jul '21, 07:40

Jochen%20Topf's gravatar image

Jochen Topf
5.2k55074
accept rate: 31%