NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Following this tutorial: https://switch2osm.org/serving-tiles/manually-building-a-tile-server-ubuntu-22-04-lts/

when trying to load the tiles using renderd, I get

**ERROR **: Received request for map layer 'default' which failed to load**

looking further into into it, I ran:

renderd -f -c /etc/renderd.conf

and obtained:

**ERROR **: 14:57:30.531: An error occurred while loading the map layer 'default': Postgis Plugin: missing <table> parameter  encountered during parsing of layer 'landcover-low-zoom' in Layer at line 803 of '/home/mapserver/src/openstreetmap-carto/style.xml'**

So I open the style.xml starting at line 803 and don't quite understand what the issue would be, here's what I get at line 803 of the style.xml file:

line 803 -->    <Layer cache-features="true" maximum-scale-denominator="25000000" minimum-scale-denominator="750000" name="landcover-low-zoom" srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over">
        <StyleName><![CDATA[landcover-low-zoom-low-zoom]]></StyleName>
        <Datasource>
          <Parameter name="type"><![CDATA[postgis]]></Parameter>
          <Parameter name="dbname"><![CDATA[gis]]></Parameter>
          <Parameter name="key_field"><![CDATA[]]></Parameter>
          <Parameter name="geometry_field"><![CDATA[way]]></Parameter>
          <Parameter name="extent"><![CDATA[-20037508,-20037508,20037508,20037508]]></Parameter>
          <Parameter name="table"><![CDATA[(SELECT
        way, way_pixels,
        COALESCE(wetland, landuse, "natural") AS feature
      FROM (SELECT
          way,
          ('landuse_' || (CASE WHEN landuse IN ('forest', 'farmland', 'residential', 'commercial', 'retail', 'industrial',
                                                'meadow', 'grass', 'village_green', 'vineyard', 'orchard') THEN landuse END)) AS landuse,
          ('natural_' || (CASE WHEN "natural" IN ('wood', 'sand', 'scree', 'shingle', 'bare_rock', 'heath', 'grassland', 'scrub') THEN "natural" END)) AS "natural",
      ('wetland_' || (CASE WHEN "natural" IN ('wetland', 'mud') THEN (CASE WHEN "natural" IN ('mud') THEN "natural" ELSE tags->'wetland' END) END)) AS wetland,
      way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels,
      way_area
    FROM planet_osm_polygon
    WHERE (landuse IN ('forest', 'farmland', 'residential', 'commercial', 'retail', 'industrial', 'meadow', 'grass', 'village_green', 'vineyard', 'orchard')
      OR "natural" IN ('wood', 'wetland', 'mud', 'sand', 'scree', 'shingle', 'bare_rock', 'heath', 'grassland', 'scrub'))
      AND way_area > 0.01*!pixel_width!::real*!pixel_height!::real
      AND building IS NULL
  ) AS features
  ORDER BY way_area DESC, feature
) AS landcover_low_zoom]]></Parameter>
    </Datasource>

I'v debugged and I've looked everywhere online and can't find an answer that could guide me in the right direction.

Could anyone help?

alt text

asked 06 Aug '23, 20:29

compic's gravatar image

compic
11124
accept rate: 0%

edited 06 Aug '23, 20:48

1

That just means "it didn't work". If you can provide more details, such as messages from syslog people may be able to provide more help.

(06 Aug '23, 20:34) SomeoneElse ♦

I've updated my question.

All I get from syslog is:

ERROR : Received request for map layer 'default' which failed to load**

(06 Aug '23, 20:50) compic

Maybe the "postgis" part of the setup didn't work for some reason? I'd try doing that again and reloading.

permanent link

answered 06 Aug '23, 20:56

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866
accept rate: 16%

are you suggesting to delete the gis db and and set it all up and import the region?

(06 Aug '23, 21:00) compic
1

I'm suggesting to add the postgis extension to it. You will need to import data again (just a small region first to check it works).

(06 Aug '23, 21:04) SomeoneElse ♦

Hi, I followed the instructions again, and imported a smaller area, and still get the same error.

What I did, I deleted the gis db. And started following the instructions in https://switch2osm.org/serving-tiles/manually-building-a-tile-server-ubuntu-22-04-lts/

from here: createdb -E UTF8 -O _renderd gis

I created also a new mapnik.xml and modified the renderd.conf file to point to that... and I'm still getting

(process:112517): ERROR : 16:51:50.159: An error occurred while loading the map layer 'sav': Postgis Plugin: missing

parameter encountered during parsing of layer 'landcover-low-zoom' in Layer at line 803 of '/home/mapserver/src/openstreetmap-carto/mapnik.xml'

the only different is I had built mapnik instead of installing it from package. However, when I import it in python it all works.

Sorry to keep bugging you, but would you have any idea?

(06 Aug '23, 21:57) compic
1

When you ran "CREATE EXTENSION postgis;" what did it say?

"map layer 'sav':" suggests you're using a different map layer (which should workproviding that you change all the references) or aomething has gone very wrong.

(06 Aug '23, 22:11) SomeoneElse ♦

when I created the extension, it just returned (I can't quite remember) something along EXTENSION added/created.

This is my renderd.conf

; BASIC AND SIMPLE CONFIGURATION:

[renderd]
stats_file=/var/run/renderd/renderd.stats
socketname=/var/run/renderd/renderd.sock
num_threads=10
tile_dir=/var/cache/renderd/tiles

[mapnik]
plugins_dir=/usr/local/lib/mapnik/input/
font_dir=/usr/share/fonts/truetype
font_dir_recurse=true

; ADD YOUR LAYERS:
[default]
URI=/utm_nav/
TILEDIR=/var/lib/mod_tile
XML=/home/mapserver/src/openstreetmap-carto/style.xml
HOST=localhost
TILESIZE=256
MINZOOM=0
MAXZOOM=20

[sav]
URI=/nav/
XML=/home/mapserver/src/openstreetmap-carto/mapnik.xml
HOST=localhost
TILESIZE=256
MINZOOM=0
MAXZOOM=20
(06 Aug '23, 22:42) compic

ok, finally! I fixed it. But I still don't know exactly what the problem is.

This line in the renderd.conf file: plugins_dir=/usr/local/lib/mapnik/input/

I changed it to plugins_dir=/usr/lib/mapnik/3.1/input

and it works.

But!, when I list what's in both folders, I pretty much have the same files:

mapserver @ mapserver in /usr/local/lib/mapnik/input [18:00:43]

$ ls -la
total 92252
drwxr-xr-x 2 root root     4096 Nov  9  2022 .
drwxr-xr-x 4 root root     4096 Nov  9  2022 ..
-rwxrwxr-x 1 root root 24042072 Nov  9  2022 csv.input
-rwxrwxr-x 1 root root  1771688 Nov  9  2022 gdal.input
-rwxrwxr-x 1 root root  3425888 Nov  9  2022 geobuf.input
-rwxrwxr-x 1 root root 28465976 Nov  9  2022 geojson.input
-rwxrwxr-x 1 root root  2595000 Nov  9  2022 ogr.input
-rwxrwxr-x 1 root root  4517992 Nov  9  2022 pgraster.input
-rwxrwxr-x 1 root root  4037912 Nov  9  2022 postgis.input
-rwxrwxr-x 1 root root  2242328 Nov  9  2022 raster.input
-rwxrwxr-x 1 root root  3325256 Nov  9  2022 shape.input
-rwxrwxr-x 1 root root  3654488 Nov  9  2022 sqlite.input
-rwxrwxr-x 1 root root 16359328 Nov  9  2022 topojson.input

mapserver @ mapserver in /usr/lib/mapnik/3.1/input [18:01:45]

$ ls -la
total 2152
drwxr-xr-x 2 root root   4096 Dec  5  2022 .
drwxr-xr-x 3 root root   4096 Aug  9  2022 ..
-rwxr-xr-x 1 root root 460856 Aug  3  2022 csv.input
-rwxr-xr-x 1 root root  79904 Aug  3  2022 gdal.input
-rwxr-xr-x 1 root root 428072 Aug  3  2022 geojson.input
-rwxr-xr-x 1 root root 112672 Aug  3  2022 ogr.input
-rwxr-xr-x 1 root root 178216 Aug  3  2022 pgraster.input
-rwxr-xr-x 1 root root 215080 Aug  3  2022 postgis.input
-rwxr-xr-x 1 root root 133168 Aug  3  2022 raster.input
-rwxr-xr-x 1 root root 124976 Aug  3  2022 shape.input
-rwxr-xr-x 1 root root 145456 Aug  3  2022 sqlite.input
-rwxr-xr-x 1 root root 297000 Aug  3  2022 topojson.input

so maybe the postgis plugin install in the /usr/local/... could be corrupted or not properly built (this is why I'm not sure what the problem is).

The big difference between the plugins are the size, so maybe I built mapnik with the wrong dependencies? I don't know.

However, I do appreciate your support in this.

permanent link

answered 06 Aug '23, 23:05

compic's gravatar image

compic
11124
accept rate: 0%

edited 06 Aug '23, 23:09

1

Actually, https://switch2osm.org/serving-tiles/manually-building-a-tile-server-ubuntu-22-04-lts/ doesn't suggest building mapnik at all - it just suggests installing the one that comes out of the box with Ubuntu 22.04 LTS!

(07 Aug '23, 01:01) SomeoneElse ♦

That's correct, thing is, I had mapnik installed from last year and I didn't want to uninstall it. So that was the issue.

Thanks again, I really do appreciate it.

(07 Aug '23, 01:11) compic

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×710
×341
×204
×36
×3

question asked: 06 Aug '23, 20:29

question was seen: 3,262 times

last updated: 07 Aug '23, 01:11

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum