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

How this error could be explained? It was about a week for me to try to install mapnik. I finally found the manual bellow.

It brought me as far as installing apache on one of the two boxes were I am trying to set it up.

Second box could not even get mod-tiles built.

But here I am stuck when trying to call renderd from a command line (does not work from httpd either). This box is relatively weak. Has 512MB ram and I use it as it is easy to respawn it clean. Second box I have is very powerful (16GB of RAM) but there I stuck with (mapnik/box2d.hpp: No such file or directory error when building mod-tiles).

https://switch2osm.org/manually-building-a-tile-server-16-04-2-lts/

renderd -f -c /usr/local/etc/renderd.conf

renderd[7931]: Rendering daemon started
renderd[7931]: Initiating request_queue
renderd[7931]: Parsing section renderd
renderd[7931]: Parsing render section 0
renderd[7931]: Parsing section mapnik
renderd[7931]: Parsing section ajt
renderd[7931]: config renderd: unix socketname=/var/run/renderd/renderd.sock
renderd[7931]: config renderd: num_threads=4
renderd[7931]: config renderd: num_slaves=0
renderd[7931]: config renderd: tile_dir=/mapnik/mod_tile
renderd[7931]: config renderd: stats_file=/var/run/renderd/renderd.stats
renderd[7931]: config mapnik:  plugins_dir=/usr/lib/mapnik/3.0/input
renderd[7931]: config mapnik:  font_dir=/usr/share/fonts/truetype
renderd[7931]: config mapnik:  font_dir_recurse=1
renderd[7931]: config renderd(0): Active
renderd[7931]: config renderd(0): unix socketname=/var/run/renderd/renderd.sock
renderd[7931]: config renderd(0): num_threads=4
renderd[7931]: config renderd(0): tile_dir=/mapnik/mod_tile
renderd[7931]: config renderd(0): stats_file=/var/run/renderd/renderd.stats
renderd[7931]: config map 0:   name(ajt) file(/mapnik/mapnik.xml) uri(/hot/) htcp() host(localhost)
renderd[7931]: Initialising unix server socket on /var/run/renderd/renderd.sock
renderd[7931]: Created server socket 5
renderd[7931]: Renderd is using mapnik version 3.1.0
[1]    7931 segmentation fault (core dumped)  renderd -f -c /usr/local/etc/renderd.con

asked 27 Nov '17, 23:08

Oblomingo's gravatar image

Oblomingo
11112
accept rate: 0%

"segmentation fault (core dumped)" just means "something went wrong". Without more information about how you got to that position it's difficult to say anything more helpful.

What OS and what version are you running on each box?

What did you install on each and in what order?

In particular, what comments did you type in what order to get the "mapnik/box2d.hpp: No such file or directory error" error?

(28 Nov '17, 00:04) SomeoneElse ♦

May I ask to ignore "mapnik/box2d.hpp". This is related to a different server. Here I am getting only one error 7931 segmentation fault

It happens when I run the following command

renderd -f -c /usr/local/etc/renderd.conf

Content of the file

[renderd] num_threads=1 tile_dir=/mapnik/mod_tile stats_file=/mapnik/renderd.stats

[mapnik] plugins_dir=/usr/lib/mapnik/3.0/input font_dir=/usr/share/fonts/truetype font_dir_recurse=1

[ajt] URI=/hot/ TILEDIR=/mapnik/mod_tile XML=/home/stan/src/openstreetmap-carto/mapnik.xml HOST=localhost TILESIZE=256 MAXZOOM=20

Running it on Ubuntu 16.04.3 LTS

Does this renderd has any kind of traditional log where it reports details of what it is doing. I can see something is printed to console but as you noticed it is not enough to get to the root of the problem.

Thank you btw for looking into it.

(28 Nov '17, 01:02) Oblomingo

Does this renderd has any kind of traditional log where it reports details of what it is doing.

Yes, when run that way it should output to stdout, but it's falling over before it got a chance.

It seems odd that (for example) you've got things pointing at "/mapnik/" rather than "/var/lib"? Also it's odd that you're telling it "num_threads=1" yet it starts 4, and uses a different stats file.

It's a long time since I've tried to render tiles on something with as little memory as 512Mb, but I have done it in the past (albeit with older versions of everything).

Where did the mapnik you're using come from? https://switch2osm.org/manually-building-a-tile-server-16-04-2-lts/ fetches it via apt-get, and when I restart renderd here I see "Renderd is using mapnik version 3.0.9" rather than 3.1.0. Are you perhaps trying to use a self-built mapnik version?

I've never had a lot of success with that: https://github.com/mapnik/mapnik/issues/3462 :)

(28 Nov '17, 01:21) SomeoneElse ♦

pointing at "/mapnik/" rather than "/var/lib I tried to change path because I thought issue might be related to permissions. So I moved all stuff to one folder and give all permissions.

Where did the mapnik you're using come from? Yes, I tried to follow these steps.

Are you perhaps trying to use a self-built mapnik version First I tried to build mapnik myself semi/successfully as I never was able to get a test cases passed. There might be a bug in mapnik that when it inits posgres test databases it does not add extension postgis_topology because it expects it would be added with postgis when it should be another way around for the latest versions of postgres. Long story short my self build version of mapnik could not be tested because test database did not have raster types (could only be added by postgis_topology extension that is not in mapnik test init script). So I stopped building source and switched to binaries. However you might be right and there is somewhere a collision between self build and binary packages. Not sure how could it be checked.

(28 Nov '17, 01:39) Oblomingo

You can try to use "locate libmapnik" - your self built version would be probably somewhere in the /usr/local.

(28 Nov '17, 02:20) kocio

I traced libmapnik down and uninstalled it. So now version 3.0.9 is reported in the log file. However result is the same - segmentation fails.

BOX 512MB renderd[26381]: Renderd is using mapnik version 3.0.9 [1] 26380 segmentation fault (core dumped) sudo -u renderaccount renderd -f -c /usr/local/etc/renderd.conf

I tried doing the same on the more powerful box where mapnik was built from source and error is the same. Problem seems to be not related to hardware available as box with 512MB memory is failing the same way as box with 16GB

BOX 16GB renderd[22083]: Initialising unix server socket on /var/run/renderd/renderd.sock renderd[22083]: Created server socket 5 renderd[22083]: Renderd is using mapnik version 3.1.0 [1] 22083 segmentation fault (core dumped) renderd -f -c /usr/local/etc/renderd.conf

(28 Nov '17, 15:41) Oblomingo

It seems to fail because of this line

plugins_dir=/usr/lib/mapnik/3.0/input

without this line it starts but later complain that plugin dir is not set. However there is no segmentation error. Content of the folder seems to be correct

-rwxrwxrwx 1 renderaccount renderaccount 619K Dec 3 2015 topojson.input -rwxrwxrwx 1 renderaccount renderaccount 148K Dec 3 2015 sqlite.input -rwxrwxrwx 1 renderaccount renderaccount 171K Dec 3 2015 shape.input -rwxrwxrwx 1 renderaccount renderaccount 159K Dec 3 2015 raster.input -rwxrwxrwx 1 renderaccount renderaccount 248K Dec 3 2015 postgis.input -rwxrwxrwx 1 renderaccount renderaccount 191K Dec 3 2015 pgraster.input -rwxrwxrwx 1 renderaccount renderaccount 135K Dec 3 2015 ogr.input -rwxrwxrwx 1 renderaccount renderaccount 755K Dec 3 2015 geojson.input -rwxrwxrwx 1 renderaccount renderaccount 71K Dec 3 2015 gdal.input -rwxrwxrwx 1 renderaccount renderaccount 664K Dec 3 2015 csv.input

(28 Nov '17, 15:57) Oblomingo

If you can reproduce the problem (perhaps in a virtual machine installed under VirtualBox running on the larger machine) using an "off the shelf" copy of 16.04 LTS then people will have a chance of being able to investigate it. Until then all we can say that there's something different about your systems that's causing the problems, and only you have access there.

I last ran through the "switch2osm" page on 22/10/2017 and at that time "it just worked". Obviously new versions of software come out all the time and something might have broken, but I'm guessing that it's actually related to your previous self-build of mapnik and python-mapnik.

(28 Nov '17, 16:00) SomeoneElse ♦
1

I run command mapnik-config --input-plugins It gave me a different directory /usr/local/lib/mapnik/input I changed renderd.conf plugins_dir=/usr/local/lib/mapnik/input and it started working

At least fixed one box. Second box (the one with 512MB memory does not work no matter how renderd.conf looks like - but ok. at least something works)

(28 Nov '17, 16:29) Oblomingo

Finally I got a second box running.

Solution was

  1. Increased memory to 1GB

  2. Built mapnik 3.1 (and python bindings) from source (map available in ubuntu repo (version 3.0.9) did not work on neither boxes I tried)

  3. Was very hard to build mod_tiles with mapnik version 3.1. It was trying to use some artifacts left after mapnik build and build was failing with bizarre messages as it was not what it expexted. So I had to delete some of the mapnik build artifacts in order to make mod_tiles succeed.

At the end got everything working. May be if I tried from a clean slate then "switch2osm" way would also work but I give it a serious doubt. Both boxes I have only worked on mapnik build from source

(29 Nov '17, 00:50) Oblomingo
1

Good that you got it working, but in both cases you'd half-built-from source first, so you likely had a mixture of stuff lying around.

It might be useful if you could explain what you actually did rather than just say e.g. "So I had to delete some of the mapnik build artifacts" - that doesn't help anyone who's trying to do it in the future.

(29 Nov '17, 01:14) SomeoneElse ♦

May be. But in one case I have deleted (uninstall) source build mapnik alltogether and made sure I had only ubuntu supplied version left (3.0.9) and it did not work (segmentation error)

when I was trying to build mod_tiles it was complaining that it could not find jpeg turbo lib referring some unusual path /home/travis/.. (travis is not a user on this server)

mod_tile libtool: error: cannot find the library '/home/travis/build/mapbox/mason/mason_packages/linux-x86_64/jpeg_turbo/1.5.1/lib/libjpeg.la'

It also was giving warning that some libs were moved. I could not reproduce it anymore.

I decided to delete mason_packages folder and as strange it was - it helped

rm -rf /home/myuser/src/mapnik/mason_packages/

After I deleted it mod_tiles was successfully built and rendering starts working

(29 Nov '17, 03:29) Oblomingo
showing 5 of 12 show 7 more comments

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:

×341
×105

question asked: 27 Nov '17, 23:08

question was seen: 2,568 times

last updated: 29 Nov '17, 03:29

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