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

I have been trying to get renderd to run but I can't get past this error:

Dec 11 10:05:27  renderd[22885] <Debug>: DEBUG: Loading font: /opt/local/lib/mapnik/fonts/DejaVuSerifCondensed.ttf
Dec 11 10:05:27  renderd[22885] <Debug>: DEBUG: Loading font: /opt/local/lib/mapnik/fonts/unifont-8.0.01.ttf
Running in foreground mode...
debug: init_storage_backend: initialising file storage backend at: /var/lib/mod_tile
Dec 11 10:05:27  renderd[22885] <Debug>: Starting stats thread
Dec 11 10:05:27  renderd[22885] <Info>: Loading parameterization function for 
debug: init_storage_backend: initialising file storage backend at: /var/lib/mod_tile
debug: init_storage_backend: initialising file storage backend at: /var/lib/mod_tile
Dec 11 10:05:27  renderd[22885] <Info>: Loading parameterization function for 
Dec 11 10:05:27  renderd[22885] <Info>: Loading parameterization function for 
debug: init_storage_backend: initialising file storage backend at: /var/lib/mod_tile
Dec 11 10:05:27  renderd[22885] <Info>: Loading parameterization function for 
Dec 11 10:05:27  renderd[22885] <Error>: An error occurred while loading the map layer 'default': boost::filesystem::current_path: Permission denied
Dec 11 10:05:27  renderd[22885] <Error>: An error occurred while loading the map layer 'default': boost::filesystem::current_path: Permission denied
Dec 11 10:05:27  renderd[22885] <Error>: An error occurred while loading the map layer 'default': boost::filesystem::current_path: Permission denied
Dec 11 10:05:27  renderd[22885] <Error>: An error occurred while loading the map layer 'default': boost::filesystem::current_path: Permission denied

I have even tried to create the folder /var/lib/mod_tile/default, but no luck.

Any ideas?

asked 11 Dec '16, 12:25

Luke16's gravatar image

Luke16
11113
accept rate: 0%

edited 12 Dec '16, 16:03

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866

What file permissions does /var/lib/mod_tile have currently and what user are you running the above as?

(11 Dec '16, 12:44) SomeoneElse ♦
1

The folder and its underlying files and folders are owned by user postgres:

drwxr-xr-x 4 postgres wheel 136 Dec 11 10:04 mod_tile

drwxr-xr-x 2 postgres wheel 68 Dec 11 10:04 default

and the command is run as:

sudo -u postgres renderd -f -c /usr/local/etc/renderd.conf

(11 Dec '16, 16:55) Luke16

Apparently some file or directory that renderd wants to access is not readable for the user you're running it under (the user "postgres", I gather from your comment above).

You can debug this further by installing (if not already present) the "strace" utility and then running

sudo -u postgres
strace -o /tmp/strace.out -f renderd -f -c /usr/local/etc/renderd.conf

this will log all system calls the program makes; before it aborts with the error message, you will likely see something that looks a bit like

[12345] open("/some/file", O_WRONLY|O_CREAT|O_NOCTTY|O_NONBLOCK, 0666) = -1 EACCES (Permission denied)

which then tells you which file or directory renderd tried to open and couldn't. Then fix permissions or ownership accordingly.

Note that not all errors in a strace output are necessarily a problem; in many situations a program might try to open one file and when that doesn't work, try something else.

A general comment on your running renderd under the "postgres" user: it would be better to create a new Unix user (eg "osm" or "renderd") to run renderd under and ensure that that user has access to the PostgreSQL database (eg sudo -u postgres createuser -s renderd).

permanent link

answered 11 Dec '16, 23:53

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

1

It seems to be a problem with the database actually. This is a snippet of the dtruss (since strace is not available on macOS):

Dec 12 12:21:54 renderd[55477] <error>: An error occurred while loading the map layer 'default': Postgis Plugin: timeout expired Connection string: ' dbname=gis connect_timeout=4' encountered during parsing of layer 'landuse_gen0' in Layer of '/usr/local/share/maps/style/OSMBright/OSMBright.xml'

But I have no idea how to make sure if the script is able to access the database and/or check its DB connection configuration.

PS: I am aware that I should have created a user the task, but, for now, I want it to work first.

(12 Dec '16, 14:33) Luke16
1

After a system restart it seems to have worked but now I can't get Apache2 to run the mod_tile module. It crashes.

When I built it from source I saw that it was pointing to the wrong installation of Apache2. It was using the /usr/libexec/apache2 and /usr/include/apache2. I thought that it would not interfere since I could just copy the mod_tile.so library to the correct running location of apache2.

How does it solve the path for the apache2 installation? How can I change it?

I have tried changing the order in the configure.ac file:

AC_CHECK_PROGS(APXS, /opt/local/apache2/bin/apxs , reject)

but then the ./configure won't complete.

checking for /opt/local/apache2/bin/apxs... no

even though it exists, is readable and executable by everyone.

(13 Dec '16, 10:02) Luke16
2

Finally!

The problem was really at the configure.ac file where the function AC_CHECK_PROGS just could not actually find the existing /opt/local/apache2/bin/apxs. Since /opt/local/bin is the first one on the $PATH, I had to pass ../apache2/bin/apxs as a parameter. Because, later on ../apache2/bin/apxs does not mean anything I also changed to the AC_CHECK_PROG function, which only accepts one parameter, but allows to return a different one as a result:

AC_CHECK_PROG(APXS, [../apache2/bin/apxs], [/opt/local/apache2/bin/apxs], reject)

(13 Dec '16, 14:51) Luke16

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:

×105
×28

question asked: 11 Dec '16, 12:25

question was seen: 5,080 times

last updated: 13 Dec '16, 14:51

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