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

Osm2pgsql failed due to ERROR: Failed to execute lua function

0

hello i am following this https://wiki.openstreetmap.org/wiki/User:SomeoneElse/Ubuntu_1804_tileserver_load#An_example_site

but getting bellow error , how can i fix this ?

yuma@bdmap:~/data$ osm2pgsql -d gis --create --slim -C 2500 --number-processes 4 -S ~/src/openstreetmap-carto-AJT/openstreetmap-carto.style --multi-geometry --tag-transform-script ~/src/SomeoneElse-style/style.lua ~/data/bangladesh-latest.osm.pbf
osm2pgsql version 0.96.0 (64 bit id space)

Using lua based tag processing pipeline with script /home/yuma/src/SomeoneElse-style/style.lua
Using projection SRS 3857 (Spherical Mercator)
Setting up table: planet_osm_point
Setting up table: planet_osm_line
Setting up table: planet_osm_polygon
Setting up table: planet_osm_roads
Allocating memory for dense node cache
Allocating dense node cache in one big chunk
Allocating memory for sparse node cache
Sharing dense sparse
Node-cache: cache=2500MB, maxblocks=40000*65536, allocation method=11
Mid: pgsql, cache=2500
Setting up table: planet_osm_nodes
Setting up table: planet_osm_ways
Setting up table: planet_osm_rels

Reading in file: /home/yuma/data/bangladesh-latest.osm.pbf
Using PBF parser.
Processing: Node(30674k 45.2k/s) Way(38k 4.75k/s) Relation(0 0.00/s)node cache:                                                                                         stored: 30674137(100.00%), storage efficiency: 50.51% (dense blocks: 400, sparse                                                                                         nodes: 28723161), hit rate: 100.00%
Osm2pgsql failed due to ERROR: Failed to execute lua function for basic tag proc                                                                                        essing: /home/yuma/src/SomeoneElse-style/style.lua:16: attempt to perform arithm                                                                                        etic on field 'layer' (a string value)

asked 19 Jun '18, 16:50

fosiul's gravatar image

fosiul
96131419
accept rate: 50%


One Answer:

2

This was caused by a bug in the lua style which was exposed when osm2pgsql was changed to not ignore the problem.

What I don't understand was why the problem was visible when Bangladesh was loaded but not other areas with invalid layer data, but it's now fixed for everywhere (thanks to mmd for pointing that out).

answered 21 Jun '18, 11:18

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866
accept rate: 16%

Source code available on GitHub .