mediagis / nominatim-docker

100% working container for Nominatim
Creative Commons Zero v1.0 Universal
1.07k stars 437 forks source link

postgres won't start (nominatim-docker 4.2) #438

Closed ashley-mort closed 4 months ago

ashley-mort commented 1 year ago

I am having a problem where postgres won't start. Any ideas on how to investigate what might be going on? Thanks!

Desktop / Server:

_docker run -it -e PBFPATH=/nominatim/data/monaco-latest.osm.pbf -p 8080:8080 -v /local/amort/nominatim2:/nominatim/data --name nominatim myArtifactory:8443/docker/nominatim:4.2

ashley-mort commented 1 year ago

I get the same problem on nominatim-docker 4.1.
4.0 doesn't have this issue and works fine.

ashley-mort commented 1 year ago

I'm struggling with this. I can't figure out what's going on. I did a diff on nominatim-docker 4.2 vs 4.0 and 4.1 vs 4.0 and don't see any major difference except the switch from ubuntu:focal to ubuntu:jammy.

docker run --name nominatimTest42 -it mediagis/nominatim:4.2 bash service --status-all no services are shown

docker run --name nominatimTest40 -it mediagis/nominatim:4.0 bash service --status-all apache-htcacheclean apache2 binfmt-support hwclock.sh postgresql procps

wang0916 commented 1 year ago

How is this problem, has it been resolved?

okimiko commented 1 year ago

I had the same problem (centos7sp9 with docker 20.10.1) and added privileged parameter (https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities) and it worked. Because I wanted to use this in our swarm cluster I failed again (no privileged support and capabilities did not work).

Finally a docker update (I tried 20.10.9) got it running again :)

ashley-mort commented 1 year ago

I think the solution from @okimiko is a good solution but we can't run privileged docker in our production environment.

Currently I've moved on to trying to run this (nominatim-docker:4.2) in kubernetes with helm.

CoWayger commented 1 year ago

same problem... funny is the 3.7, 4.0 version it works just fine. Looks like it is problem with mounting folders into volumes. I tried many combinations of permission (even 777 and root:root), nothing works.

CoWayger commented 1 year ago

I found out reason. Be aware that this command:

chown -R nominatim:nominatim /nominatim

will affect all folders mounted into /nominatim/data

So when you have structure like me: /mnt/NVME/europe.pbf /mnt/NVME/nominatim-db

then with this settings: volumes:

Nominatim will shortly after start shoot itself in the leg and DB files will have bad user. Solution is simple: create data dir like:

/mnt/NVME/data/europe.pbf /mnt/NVME/nominatim-db then with this settings: volumes:

Everything works.

aliaz0 commented 2 weeks ago

Same problem on 4.1, 4.2, 4.3, 4.4 4.0 is ok