Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

renderd from mod_tile crashes on select #1363

Closed
openstreetmap-trac opened this issue Jul 23, 2021 · 6 comments
Closed

renderd from mod_tile crashes on select #1363

openstreetmap-trac opened this issue Jul 23, 2021 · 6 comments

Comments

@openstreetmap-trac
Copy link

Reporter: kavol
[Submitted to the original trac issue database at 7.42pm, Sunday, 23rd November 2008]

Hi.

When trying to setup tileserver using mod_tile, I am stuck at the "Run the rendering daemon 'renderd'" step as renderd crashes on my system:

kavol@jarmilka ~/Documents/projekty/OSM/mod_tile $ ./renderd
Rendering daemon
got exception ...
terminate called after throwing an instance of 'std::ios_base::failure'
what(): failed opening file: Bad file descriptor
Nespn ukonen (SIGABRT)

The error message (nor the strace output) does not give me any clue what has failed.
(I tried to follow the readme file but I cannot swear that I haven't made any mistake - I'd just be very glad if the program tells me what is wrong in that case ...)

@openstreetmap-trac
Copy link
Author

Author: tom[at]compton.nu
[Added to the original trac issue at 4.21pm, Tuesday, 25th November 2008]

Well I'm sure if you attach a debugger and see what file it is trying to open that will probably give you a clue - there's no way for me to guess what the problem might be remotely. The strace should have shown you what it was trying to do though I would have thought.

Jon might have more idea what is happening, so I'll pass this to him - we don't generally deal with mod_tile through trac anyway.

@openstreetmap-trac
Copy link
Author

Author: jburgess777[at]googlemail.com
[Added to the original trac issue at 6.43pm, Tuesday, 25th November 2008]

I suspect the reason is that Mapnik is failing to open the coastline shapefiles.

Unfortunately your strace output is missing the relevant details. You need to add a '-f' flag in order to get the output from the threads that are created.

I looked into the Mapnik code a while back and what happens is something like: the call to open the file fails and throws the first exception. This exception is caught and the shapefile destructor is called. This then tries to close the bad file descriptor and causes a second exception to occur (which isn't caught).

@openstreetmap-trac
Copy link
Author

Author: kavol
[Added to the original trac issue at 8.41am, Thursday, 27th November 2008]

Replying to [comment:2 jburgess777[at]googlemail.com]:

I suspect the reason is that Mapnik is failing to open the coastline shapefiles.

Unfortunately your strace output is missing the relevant details. You need to add a '-f' flag in order to get the output from the threads that are created.

thanks for the hint - I am not a programmer, so that I do not know the right debugging tricks

now I see that it tries to open the file /home/kavol/Documents/projekty/OSM/world_boundaries/world_boundaries_m.shp

I wonder where this path comes from ...

so that I have moved files into that location, and now I am a step further:

kavol@jarmilka ~/Documents/projekty/OSM/mod_tile $ ./renderd
Rendering daemon
terminate called after throwing an instance of 'mapnik::config_error'
terminate called recursively
Nespn ukonen (SIGABRT)

... I am going to investigate

I looked into the Mapnik code a while back and what happens is something like: the call to open the file fails and throws the first exception. This exception is caught and the shapefile destructor is called. This then tries to close the bad file descriptor and causes a second exception to occur (which isn't caught).

so that this is a bug of Mapnik and it should be reported against it?

could you enhance renderd to report error messages which would make sense to an ordinary user not knowing the "strace -f" trick, please?

@openstreetmap-trac
Copy link
Author

Author: kavol
[Added to the original trac issue at 8.47am, Thursday, 27th November 2008]

so the next problem is ...

[pid 13744] stat("/home/kavol/.pgpass", 0x4270ba60) = -1 ENOENT (No such file or directory)
[pid 13744] socket(PF_FILE, SOCK_STREAM, 0) = 4
[pid 13744] fcntl(4, F_SETFL, O_RDONLY|O_NONBLOCK) = 0
[pid 13744] fcntl(4, F_SETFD, FD_CLOEXEC) = 0
[pid 13744] connect(4, {sa_family=AF_FILE, path="/var/run/postgresql/.s.PGSQL.5432"...}, 110) = -1 EACCES (Permission denied)
[pid 13744] close(4)                    = 0
[pid 13744] futex(0x315560d130, FUTEX_WAKE, 2147483647) = 0
[pid 13744] write(2, "terminate called after throwing a"..., 48terminate called after throwing an instance of ') = 48
[pid 13744] write(2, "mapnik::config_error"..., 20mapnik::config_error) = 20
[pid 13744] write(2, "'\n"..., 2'
)       = 2
[pid 13744] write(2, "  what():  "..., 11  what():  ) = 11
[pid 13744] write(2, "PSQL error:\ncould not connect to "..., 194PSQL error:
could not connect to server: Permission denied
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? in layer 'leisure') = 194

again, couldn't the program just report that it failed to connect to database? ;-)

@openstreetmap-trac
Copy link
Author

Author: tom[at]compton.nu
[Added to the original trac issue at 8.55am, Thursday, 27th November 2008]

Isn't that exactly what it has done? You mixed up the strace output and actual program output there but it looks like the program reported that it could not connect to the database server.

Even if it hadn't, that would be a mapnik issue and not something for us.

@openstreetmap-trac
Copy link
Author

Author: jburgess777[at]googlemail.com
[Added to the original trac issue at 1.49pm, Sunday, 10th May 2009]

I don't see anything we need to fix here. The error handling is done in the Mapnik code, not mod_tile.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant