Opened 10 years ago

Closed 10 years ago

#1363 closed defect (wontfix)

renderd from mod_tile crashes on select

Reported by: kavol Owned by: jburgess777@…
Priority: major Milestone:
Component: utils Version:
Keywords: Cc:

Description

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

Neúspěšně ukončen (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 ...)

Attachments (1)

renderd.strace (38.2 KB) - added by kavol 10 years ago.
strace output

Download all attachments as: .zip

Change History (7)

Changed 10 years ago by kavol

Attachment: renderd.strace added

strace output

comment:1 Changed 10 years ago by Tom Hughes

Owner: changed from Tom Hughes to jburgess777@…

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.

comment:2 Changed 10 years ago by jburgess777@…

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).

comment:3 in reply to:  2 Changed 10 years ago by kavol

Replying to jburgess777@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
Neúspěšně ukončen (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?

comment:4 Changed 10 years ago by kavol

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? ;-)

comment:5 Changed 10 years ago by Tom Hughes

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.

comment:6 Changed 10 years ago by jburgess777@…

Resolution: wontfix
Status: newclosed

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

Note: See TracTickets for help on using tickets.