0

I searched other topics but didn't found a post that used this version of Ubuntu (18.04), so I think it would be a good idea to don't merge this with other topics, despite similar problem.

I followed the tutorial available at https://switch2osm.org/manually-building-a-tile-server-18-04-lts/ to setup my own tile server. I'm building the server in my computer and everything went fine. The http://localhost/hot/0/0/0.png showed the world map correctly, but http://localhost/hot/1/0/0.png gives Not Found error.

In the last step, where I should view the tiles, they aren't shown, but for some reason, when I put the zoom lv 0 it shows the map.

I'm opening the "sample_leaflet.html" file inside folder /src/mod_tile/extra/ using Firefox Browser.

Thanks in advance. Please ask me to post any other useful info that would help to debug this problem.

UPDATE #1:

The Browser Console shows the following errors.

This is my leaflet file

systemctl status renderd give the following:

This is the result from tail -f /var/log/syslog | grep " TILE "

UPDATE #3: I checked folder "/var/lib/mod_tile/ajt/", where its supposed to store the tiles and it is occupying a total of 60.9 Kb, so clearly the tiles aren't being stored there.

asked 17 Nov '19, 01:45

carlosguedes's gravatar image

carlosguedes
863615
accept rate: 0%

edited 19 Nov '19, 16:09


2 Answers:
2

You have a "failed to write metafile to file" error, so you need to check:

  • What account you are running the command that is trying to write to that directory
  • What access rights are needed to write to that directory.

Here's what it looks like on a server of mine:

renderaccount@myserver:~$ cd /var/lib/mod_tile/ajt
renderaccount@myserver:/var/lib/mod_tile/ajt$ ls -ald .
drwxrwxr-x 27 renderaccount renderaccount 4096 Oct 23  2018 .
renderaccount@myserver:/var/lib/mod_tile/ajt$

The process that renders tiles runs as a user called "renderaccount" and that account has write access to that directory.

permanent link

answered 19 Nov '19, 15:08

SomeoneElse's gravatar image

SomeoneElse ♦
33.0k65343778
accept rate: 16%

edited 19 Nov '19, 15:08

I'm logging in OS using my root account, but in Terminal I do su renderaccount to run commands as the user renderaccount, is that correct?

I did the following commands:

sudo chown renderaccount /var/lib/mod_tile/

sudo chmod u+w /var/lib/mod_tile/

Isn't that enough to give write permisions for renderaccount?

(19 Nov '19, 16:08) carlosguedes

Now it worked! But I don't know exactly what solved it, because I did 2 things.

1) I did the chown command with : after the username, like this sudo chown renderaccount: /var/lib/mod_tile/ but I don't know if the : is needed (the switch2osm tutorial dont use it)

2) I did chown and chmod commands both in /var/lib/mod_tile/ and /var/lib/mod_tile/ajt/ but I'm not sure if an user having permision to write in a folder is enough to write in its subfolder.

(19 Nov '19, 16:43) carlosguedes
2

Looking at the "drwxrwxr-x" in my comment above, the first "rwx" means that the owner of the directory has the right to read files, write files and cd into that directory. The owner of the directory is "renderaccount". The second "rwx" means that anyone in the group "renderaccount" can read, write, and enter into that directory. The "r-x" at the end means that everyone else can read that directory and cd into it but not write files there.

The level of detail in the "switch2osm" guide is a compromise - it tries to assume no prior knowledge so that if you follow the instructions you'll get something working at the other end, but it doesn't go into so much detail about the various Unix concepts that you encounter on the way through. If it did it'd be an awful lot longer, and all of that stuff is available elsewhere.

(19 Nov '19, 16:57) SomeoneElse ♦
0

First of all:

have you prerendered any tiles? Those metatiles on e.g. on zoom 6 can take up to 2 CPU-Hours to render for the first time, but you should at least see renderd showing up in the syslog, so there is sth. else not working between leaflet and your apache/renderd toolchain.

Do you see any errors in the js console of the firefox developer tab?

And please use grep renderd on your syslog to watch renderds work, not grep " TILE ".

permanent link

answered 17 Nov '19, 09:26

Spiekerooger's gravatar image

Spiekerooger
696816
accept rate: 16%

edited 17 Nov '19, 14:03

It's my first time rendering tiles. I left my laptop on for all night long to check if its rendering but nothing appeared. Its specs are 16 GB RAM, i7-8550U, MX150 2 GB and all running in SSD, should it take that long? Geofabrik don't have OSM data of smaller parts of Brazil, like states or cities, that's why I used the whole country. I updated my question with the screenshot of the Browser Console, is that the right console? I did grep renderd also but didn't got any message.

(17 Nov '19, 16:33) carlosguedes

After reinstalling everything with the right account now it shows the tile messages in console, despite now showing the tiles itself. I updated my question.

(19 Nov '19, 02:48) carlosguedes

So it does look as if you don't have permission to write the metatiles into the file structure. Check the owner and rights or your ajt directory in a terminal and check renderd.conf settings for the internal tile path.

(19 Nov '19, 05:42) Spiekerooger

Correcting my last comment: After reinstalling everything with the right account now it shows the tile messages in console, despite not showing the tiles itself. I updated my question.

(19 Nov '19, 15:00) carlosguedes

But you syslog tells us that renderd is not able to write the metatiles to a file. Sou check (e.g. via top) the linux user that is running renderd and than check file permissions at the ajt directory.

(19 Nov '19, 15:09) Spiekerooger

the command top -U renderaccount shows that renderaccount is indeed running renderd.

(19 Nov '19, 16:24) carlosguedes
showing 5 of 6 show 1 more 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:

×585
×396
×175
×74

question asked: 17 Nov '19, 01:45

question was seen: 737 times

last updated: 19 Nov '19, 16:57

powered by OSQA