merlinnot / nominatim-docker

Fully-featured container for geocoding, reverse geocoding and address lookup based on Nominatim and Open Street Map data.
MIT License
55 stars 35 forks source link

Unable to build nominatim planet #7

Open yonaichin opened 6 years ago

yonaichin commented 6 years ago

Hi, Unable to build nominatim planet when docker build process of Step 35/68 : RUN curl -L ${PBF_URL} --create-dirs -o /srv/nominatim/src/data.osm.pbf then ran into this issue. ERROR: Error processing tar file(exit status 1): unexpected EOF

The machine info: CPU: 8 core MEM: 32GB STORAGE: 10TB

Docker version: Client: Version: 18.06.0-ce API version: 1.38 Go version: go1.10.3 Git commit: 0ffa825 Built: Wed Jul 18 19:11:02 2018 OS/Arch: linux/amd64 Experimental: false

Server: Engine: Version: 18.06.0-ce API version: 1.38 (minimum version 1.12) Go version: go1.10.3 Git commit: 0ffa825 Built: Wed Jul 18 19:09:05 2018 OS/Arch: linux/amd64 Experimental: false

Let me know if you need more info.

Thanks in advance.

merlinnot commented 6 years ago

What's the PBF_URL you've specified? Is it the default one?

yonaichin commented 6 years ago

Yes, Tried to build nominatim planet with the scrtips.

docker build github.com/merlinnot/nominatim-docker \
  -t nominatim \
  --build-arg BUILD_THREADS=16 \
  --build-arg BUILD_MEMORY=32GB \
  --build-arg OSM2PGSQL_CACHE=28000 \
  --build-arg RUNTIME_THREADS=2 \
  --build-arg RUNTIME_MEMORY=8GB
merlinnot commented 6 years ago

You should probably lower your memory limit a bit, as stated in the docs, BUILD_MEMORY is a memory dedicated to a build process, if you have 32GB total, you still need some for system etc. The same goes for BUILD_THREADS.

OSM2PGSQL_CACHE should be lower too, as you can see in the docs it should be set to about 75% of memory available during build process.

Anyways, is your system behind some kind of a proxy, which might affect the download process? Map extracts are being downloaded form the Internet, by default from https://planet.osm.org/pbf/planet-latest.osm.pbf. Can you try to download it using wget or curl, just to confirm that it's not a network issue?

merlinnot commented 6 years ago

Btw., my company provides Nominatim API as a service if you'd be interested.

yonaichin commented 6 years ago

The network wasn't the issue. PBF file was downloaded successfully via curl.

Tried the different approach that copy the PBF file during the build process and still failed.

Error processing tar file(exit status 1): unexpected EOF

The Dockerfile was modified as below

# ARG PBF_URL=https://planet.osm.org/pbf/planet-latest.osm.pbf
# RUN curl -L ${PBF_URL} --create-dirs -o /srv/nominatim/src/data.osm.pbf
RUN mkdir /srv/nominatim/src
COPY data.osm.pbf /srv/nominatim/src/data.osm.pbf

I've adjusted the machine settings to 10 Cores CPU and 48GB MEM. Building nominatim for cities works just fine.

Is it possible that the problem was the file exceeds the docker build limits?

Thanks

merlinnot commented 6 years ago

It should handle the file having much less memory, I've successfully built planet on 8GB machine in the past.

Did you adjust (lower) your OSM2PGSQL_CACHE settings? Can you post a link to a full log (please don't paste it here, you can use make a gist)? Can you verify that a downloaded file matches this checksum?

yonaichin commented 6 years ago

I did adjust the OSM2PGSQL_CACHE settings.

docker build github.com/merlinnot/nominatim-docker   -t nominatim-planet   \
--build-arg BUILD_THREADS=2   \
--build-arg BUILD_MEMORY=8GB   \
--build-arg OSM2PGSQL_CACHE=2000   \
--build-arg RUNTIME_THREADS=2   \
--build-arg RUNTIME_MEMORY=8GB

Here's the log

The checksum matched the version of 2018-07-19 PBF file.

85291e7cc8cfdc20f2e62a8650b2d069  planet-latest.osm.pbf
konrad-g commented 6 years ago

I got the same issue. Did you solve it by any chance @yonaichin? I'm running this on quite a strong machine, 50GB of RAM and 10 cores.

yonaichin commented 6 years ago

@konrad-g

No, I did not. Though I've passed this step successfully on my mac, there wasn't enough disk space to go through the whole docker process. I ran into this problem on the machine with Linux 16.04. Still, I'm not able to pinpoint what the root cause really is.

Instead of using docker to build planet, I'm building it on vm following nominatim guideline which has more configurations to be tuned with.

twentytwokhz commented 6 years ago

offtopic How can I check if the build for nominatim completed or not? I started an ssh session into the VM machine for building nominatim. Then I executed the build, which is still running after 2 days. Can I stop the ssh session and then check back later and see some logs or files to validate that the build has completed? Another question is: does the build allow to resume after it has been stopped?

merlinnot commented 6 years ago

Hey, could you try building Monaco to test if it's a general problem or just with the planet?

konrad-g commented 6 years ago

Works great with Monaco, it seems to be an issue related with the planet. I got information that it might be related with following issue: https://github.com/moby/moby/issues/37581

merlinnot commented 6 years ago

Oh, great finding. It might be the one, the file is bigger than 8GB.

chmelej commented 6 years ago

FYI see https://github.com/moby/moby/issues/37581 some docker versions have a bug. you need upgrade or downgrade docker to avoid