gravitystorm / openstreetmap-carto

A general-purpose OpenStreetMap mapnik style, in CartoCSS
Other
1.53k stars 818 forks source link

Docker-compose not able to see the map #3474

Closed silgon closed 5 years ago

silgon commented 5 years ago

I'm following the steps in DOCKER.md . However, the map is not displaying.

My pbf file is the one for Ile de France, therefore, I try to access with the following link (http://192.168.0.11:6789/openstreetmap-carto/#12/48.8590/2.3470) which are the coordinates for Paris. The file itself seems to be imported correctly with docker-compose up import. However, later when running docker-compose up kosmtik the logs give me the following problems (I separated the logs by chunks in order to show you what I consider to be important):

kosmtik_1  | Missing 'data/world_boundaries/world_bnd_m.shp'
kosmtik_1  | [Local Config] Unable to load local config from /openstreetmap-carto/localconfig.js
kosmtik_1  | [Error: File not found: /openstreetmap-carto/localconfig.js]
kosmtik_1  | Trace
kosmtik_1  |     at ProjectServer.raise (/usr/lib/node_modules/kosmtik/src/back/ProjectServer.js:261:13)
kosmtik_1  |     at /usr/lib/node_modules/kosmtik/src/back/ProjectServer.js:75:30
kosmtik_1  |     at /usr/lib/node_modules/kosmtik/node_modules/generic-pool/lib/generic-pool.js:283:11
kosmtik_1  |     at loaded (/usr/lib/node_modules/kosmtik/node_modules/mapnik-pool/index.js:23:37)
kosmtik_1  | Shape Plugin: shapefile '/openstreetmap-carto/data/simplified-land-polygons-complete-3857/simplified_land_polygons.shp' does not exist  encountered during parsing o
f layer 'world' in Layer
kosmtik_1  | [httpserver] /openstreetmap-carto/tile/4/4/8.png?t=1540238649872 500
kosmtik_1  | Shape Plugin: shapefile '/openstreetmap-carto/data/simplified-land-polygons-complete-3857/simplified_land_polygons.shp' does not exist  encountered during parsing o
f layer 'world' in Layer
kosmtik_1  | Trace
kosmtik_1  |     at ProjectServer.raise (/usr/lib/node_modules/kosmtik/src/back/ProjectServer.js:261:13)
kosmtik_1  |     at /usr/lib/node_modules/kosmtik/src/back/ProjectServer.js:75:30
kosmtik_1  |     at /usr/lib/node_modules/kosmtik/node_modules/generic-pool/lib/generic-pool.js:283:11
kosmtik_1  |     at loaded (/usr/lib/node_modules/kosmtik/node_modules/mapnik-pool/index.js:23:37)
kosmtik_1  | [httpserver] /openstreetmap-carto/tile/4/11/8.png?t=1540238649872 500
kosmtik_1  | Mapnik LOG> 2018-10-22 20:04:32: warning: unable to find face-name 'unifont Medium' in FontSet 'fontset-0'                                                  [9/1967]
kosmtik_1  | Mapnik LOG> 2018-10-22 20:04:32: warning: unable to find face-name 'Noto Emoji Regular' in FontSet 'fontset-1'
kosmtik_1  | Mapnik LOG> 2018-10-22 20:04:32: warning: unable to find face-name 'unifont Medium' in FontSet 'fontset-1'
kosmtik_1  | Mapnik LOG> 2018-10-22 20:04:32: warning: unable to find face-name 'Noto Emoji Regular' in FontSet 'fontset-2'
kosmtik_1  | Mapnik LOG> 2018-10-22 20:04:32: warning: unable to find face-name 'unifont Medium' in FontSet 'fontset-2'
kosmtik_1  | Mapnik LOG> 2018-10-22 20:04:32: warning: unable to find face-name 'Noto Emoji Regular' in FontSet 'fontset-0'
kosmtik_1  | Mapnik LOG> 2018-10-22 20:04:32: warning: unable to find face-name 'unifont Medium' in FontSet 'fontset-0'
kosmtik_1  | Mapnik LOG> 2018-10-22 20:04:32: warning: unable to find face-name 'Noto Emoji Regular' in FontSet 'fontset-1'
kosmtik_1  | Mapnik LOG> 2018-10-22 20:04:32: warning: unable to find face-name 'unifont Medium' in FontSet 'fontset-1'
kosmtik_1  | Mapnik LOG> 2018-10-22 20:04:32: warning: unable to find face-name 'Noto Emoji Regular' in FontSet 'fontset-2'
kosmtik_1  | Mapnik LOG> 2018-10-22 20:04:32: warning: unable to find face-name 'unifont Medium' in FontSet 'fontset-2'
kosmtik_1  | Mapnik LOG> 2018-10-22 20:04:32: warning: unable to find face-name 'Noto Emoji Regular' in FontSet 'fontset-0'
kosmtik_1  | Mapnik LOG> 2018-10-22 20:04:32: warning: unable to find face-name 'unifont Medium' in FontSet 'fontset-0'
kosmtik_1  | Mapnik LOG> 2018-10-22 20:04:32: warning: unable to find face-name 'Noto Emoji Regular' in FontSet 'fontset-1'
kosmtik_1  | Mapnik LOG> 2018-10-22 20:04:32: warning: unable to find face-name 'unifont Medium' in FontSet 'fontset-1'
kosmtik_1  | Mapnik LOG> 2018-10-22 20:04:32: warning: unable to find face-name 'Noto Emoji Regular' in FontSet 'fontset-2'
kosmtik_1  | Mapnik LOG> 2018-10-22 20:04:32: warning: unable to find face-name 'unifont Medium' in FontSet 'fontset-2'
kosmtik_1  | Mapnik LOG> 2018-10-22 20:04:32: warning: unable to find face-name 'Noto Emoji Regular' in FontSet 'fontset-0'
kocio-pl commented 5 years ago

It looks like container was not able to use external shapes. Did you run https://github.com/gravitystorm/openstreetmap-carto/blob/master/scripts/get-shapefiles.py first?

matthijsmelissen commented 5 years ago

Did you run https://github.com/gravitystorm/openstreetmap-carto/blob/master/scripts/get-shapefiles.py first?

This should be invoked automatically by docker-compose up kosmtik, right?

matthijsmelissen commented 5 years ago

The missing font files and the missing localconfig.js are normal and not part of the issue.

kocio-pl commented 5 years ago

It should I guess:

https://github.com/gravitystorm/openstreetmap-carto/blob/a30f31675d7db2187454f709925b1457f06bfbda/scripts/docker-startup.sh#L55-L57

silgon commented 5 years ago

Sorry for the delay guys, and thanks for the fast responses. get-shapefiles.py seems to be run by `kosmtik':

kosmtik_1  | Starting get-shapefiles.py...
kocio-pl commented 5 years ago

OK, so please check if there are any data in /data subfolder (there should be 8 zip files and 8 directories made by unzipping them)? Maybe you have some problems with connection to servers? If it does not help, try to run the script I mentioned and see what happens.

silgon commented 5 years ago

I see the problem. The first time I ran docker-compose up kosmtik, it threw an error. That's what I figure because you told me there should be 8 zip files and there is not in my case. I deleted the contents of the data folder and I reran docker-compose up kosmtik and I get the following error:

kosmtik_1  | Starting get-shapefiles.py...
kosmtik_1  | 1-1. Downloading 'world_boundaries'...
kosmtik_1  |   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
kosmtik_1  |                                  Dload  Upload   Total   Spent    Left  Speed
100 50.4M  100 50.4M    0     0   905k      0  0:00:56  0:00:56 --:--:--  989k
kosmtik_1  | curl: (16) Error in the HTTP2 framing layer
kosmtik_1  | 
kosmtik_1  | 
kosmtik_1  |    'curl' error: download failed.

And when I do ls in the directory I only see the file world_boundaries-spherical.tgz.

kocio-pl commented 5 years ago

You can try to do a manual download then:

https://github.com/gravitystorm/openstreetmap-carto/blob/master/INSTALL.md#manual-download

It seems like it's not a problem with our code, so I will close it now. However you can still write here if there will be some more problems with downloading data.

silgon commented 5 years ago

Ok, I'm getting the map rendered. For reference, I did:

# enter container
docker exec -it openstreetmap-carto_kosmtik_1 bash
# inside container
python scripts/get-shapefiles.py -n

However, every time the server renders, it throws me a warning:

kosmtik_1  | Mapnik LOG> 2018-10-23 11:26:52: warning: unable to find face-name 'Noto Emoji Regular' in FontSet 'fontset-0'                                                                                  [7/1838]
kosmtik_1  | Mapnik LOG> 2018-10-23 11:26:52: warning: unable to find face-name 'unifont Medium' in FontSet 'fontset-0'
kosmtik_1  | Mapnik LOG> 2018-10-23 11:26:52: warning: unable to find face-name 'Noto Emoji Regular' in FontSet 'fontset-1'
kosmtik_1  | Mapnik LOG> 2018-10-23 11:26:52: warning: unable to find face-name 'unifont Medium' in FontSet 'fontset-1'
kosmtik_1  | Mapnik LOG> 2018-10-23 11:26:52: warning: unable to find face-name 'Noto Emoji Regular' in FontSet 'fontset-2'
kosmtik_1  | Mapnik LOG> 2018-10-23 11:26:52: warning: unable to find face-name 'unifont Medium' in FontSet 'fontset-2'
kosmtik_1  | Mapnik LOG> 2018-10-23 11:26:52: warning: unable to find face-name 'Noto Emoji Regular' in FontSet 'fontset-0'
kosmtik_1  | Mapnik LOG> 2018-10-23 11:26:52: warning: unable to find face-name 'unifont Medium' in FontSet 'fontset-0'
kosmtik_1  | Mapnik LOG> 2018-10-23 11:26:52: warning: unable to find face-name 'Noto Emoji Regular' in FontSet 'fontset-1'
kosmtik_1  | Mapnik LOG> 2018-10-23 11:26:52: warning: unable to find face-name 'unifont Medium' in FontSet 'fontset-1'
kosmtik_1  | Mapnik LOG> 2018-10-23 11:26:52: warning: unable to find face-name 'Noto Emoji Regular' in FontSet 'fontset-2'
kosmtik_1  | Mapnik LOG> 2018-10-23 11:26:52: warning: unable to find face-name 'unifont Medium' in FontSet 'fontset-2'
kosmtik_1  | Mapnik LOG> 2018-10-23 11:26:55: warning: unable to find face-name 'Noto Emoji Regular' in FontSet 'fontset-0'
kosmtik_1  | Mapnik LOG> 2018-10-23 11:26:55: warning: unable to find face-name 'unifont Medium' in FontSet 'fontset-0'
kosmtik_1  | Mapnik LOG> 2018-10-23 11:26:55: warning: unable to find face-name 'Noto Emoji Regular' in FontSet 'fontset-1'
kosmtik_1  | Mapnik LOG> 2018-10-23 11:26:55: warning: unable to find face-name 'unifont Medium' in FontSet 'fontset-1'
kosmtik_1  | Mapnik LOG> 2018-10-23 11:26:55: warning: unable to find face-name 'Noto Emoji Regular' in FontSet 'fontset-2'
kosmtik_1  | Mapnik LOG> 2018-10-23 11:26:55: warning: unable to find face-name 'unifont Medium' in FontSet 'fontset-2'
kosmtik_1  | Mapnik LOG> 2018-10-23 11:26:55: warning: unable to find face-name 'Noto Emoji Regular' in FontSet 'fontset-0'
kosmtik_1  | Mapnik LOG> 2018-10-23 11:26:55: warning: unable to find face-name 'unifont Medium' in FontSet 'fontset-0'
kosmtik_1  | Mapnik LOG> 2018-10-23 11:26:55: warning: unable to find face-name 'Noto Emoji Regular' in FontSet 'fontset-1'
kosmtik_1  | Mapnik LOG> 2018-10-23 11:26:55: warning: unable to find face-name 'unifont Medium' in FontSet 'fontset-1'
kosmtik_1  | Mapnik LOG> 2018-10-23 11:26:55: warning: unable to find face-name 'Noto Emoji Regular' in FontSet 'fontset-2'
kosmtik_1  | Mapnik LOG> 2018-10-23 11:26:55: warning: unable to find face-name 'unifont Medium' in FontSet 'fontset-2'

Should I do something about it? I though you already had everything in the containers.

Thanks in advance.

kocio-pl commented 5 years ago

These warnings are harmless, you should get the proper rendering. :smile:

silgon commented 5 years ago

Ok, thanks for the help. I would really had never guessed it myself. =)

matthijsmelissen commented 5 years ago

For reference, I did:

It should not be necessary to do this manually. For now let's consider it a one-time glitch, if anybody else runs into the same issue please let us know.

phdesign commented 5 years ago

I get the same issue running on Windows 10. Also resolved by jumping into container, deleting the data folder and rerunning get-shapefiles.py.

phdesign commented 5 years ago

Error was

3-2. Expanding 'water-polygons-split-3857'... Failed (try with -u option).

I guess the downloaded archive was invalid?

raphael-sch commented 4 years ago

have the same problem, during kosmtik startup i get:

kosmtik_1  |   File "scripts/get-shapefiles.py", line 155
kosmtik_1  |     print("     No newer file to download.", end="")
kosmtik_1  |                                                 ^
kosmtik_1  | SyntaxError: invalid syntax

apparently print('', end='') is python 3 syntax and invalid for python 2

This can be solved by python->python3 and add python3-distutils to be installed in the Dockerfile

jeisenbe commented 4 years ago

apparently print('', end='') is python 3 syntax and invalid for python 2

This can be solved by python->python3 and add python3-distutils to be installed in the Dockerfile

Thank you. I think this could be a new issue, since it is not the same problem as the original poster found above.

Would you be able to submit a PR to fix this syntax for us, @raphael-sch?

tylershuster commented 4 years ago

This can be solved by python->python3 and add python3-distutils to be installed in the Dockerfile

How to do this? Sorry if this is a stupid question

raphael-sch commented 4 years ago

just replace "python" in line 5 with "python3 python3-distutils" in the docker file. Do not know if there are side effects. I didn't experience any.

richlv commented 4 years ago

Struggled with this one. Thank you all for the tips here. I believe that this (collected from comments by @silgon and @raphael-sch) helped in the end.

docker exec -it -u root openstreetmap-carto_kosmtik_1 bash
apt-get install python3 python3-distutils
exit
docker exec -it openstreetmap-carto_kosmtik_1 bash
python3 scripts/get-shapefiles.py -n
exit