nominatim-docker
nominatim-docker copied to clipboard
Error: The cluster is owned by user id **** which does not exist
Describe the bug I'm trying to run Nominatim v4.0 with postgresdata from backup and I am facing following Postgres problem on startup:
To Reproduce Steps to reproduce the behavior:
sudo docker run -it --rm --shm-size=5GB \
-e PBF_URL=https://download.geofabrik.de/europe/great-britain-latest.osm.pbf \
-e IMPORT_WIKIPEDIA=false \
-e NOMINATIM_PASSWORD=xxxxxxxx\
-v /volume1/docker/nominatim/pg_data:/var/lib/postgresql/12/main \
-v /volume1/docker/nominatim/flatnode:/nominatim/flatnode \
-v /volume1/docker/nominatim/data:/nominatim/data \
-p 8099:8080 \
--name nominatim \
mediagis/nominatim:4.0
Expected behavior Docker should start up and use the backup
Screenshots & Logs
* Starting PostgreSQL 12 database server * Error: The cluster is owned by user id 1026 which does not exist
Additional context This is similar to the bug : https://github.com/mediagis/nominatim-docker/issues/168
I tried updating the permissions for the postgres user using :
chown -R postgres:postgres /var/lib/postgresql
chown -R postgres:postgres /etc/postgresql
chown -R postgres:postgres /var/log/postgresql
chown -R postgres:postgres /var/run/postgresql
This helped move along the issue, now i get the following error
[54] FATAL: data directory "/var/lib/postgresql/12/main" has invalid permissions
[54] DETAIL: Permissions should be u=rwx (0700) or u=rwx,g=rx (0750).
Quick Note : Setting chmod -R 750 /var/lib/postgresql , doesnt help with resolving the issue.
Hiho @abhishekvij 👋
Thanks for reaching me out. The similar issue I had - 168 was pretty long time ago.
As far as I remember, the workaround with executing chown
commands was applied through nominatim container, so for my local development I just ran that through docker compose with overriding the command
property and attaching postgres data directory as a volume:
nominatim:
image: mediagis/nominatim:3.5
restart: always
command: bash -c "sudo chown -R postgres:postgres /var/lib/postgresql/12/main && /app/start.sh"
ports:
- '6432:5432'
- '8080:8080'
volumes:
- YOUR_POSTGRES_DATA_DIRECTORY:/var/lib/postgresql/12/main
You would achieve that through docker command as well:
docker run \
--restart=always \
-p 6432:5432 -p 8080:8080 -d \
--name nominatim \
-v YOUR_POSTGRES_DATA_DIRECTORY:/var/lib/postgresql/12/main \
mediagis/nominatim:3.5 \
bash -c "sudo chown -R postgres:postgres /var/lib/postgresql/12/main && /app/start.sh"
@abhishekvij please let me know if that helped you. Cheers 🙌
@wjossowski : Thanks for reply and your insights into the issue. I tried with adding the command in my docker compose but sadly I still get the same error.
2022-05-09 01:04:13.843 UTC [29] FATAL: data directory "/var/lib/postgresql/12/main" has invalid permissions
2022-05-09 01:04:13.843 UTC [29] DETAIL: Permissions should be u=rwx (0700) or u=rwx,g=rx (0750).
Here is my docker compose :
version: "3"
services:
nominatim:
container_name: nominatim
image: mediagis/nominatim:4.0
restart: always
command: bash -c "sudo chown -R postgres:postgres /var/lib/postgresql/12/main && /app/start.sh"
ports:
- "8099:8080"
environment:
# see https://github.com/mediagis/nominatim-docker/tree/master/4.0#configuration for more options
PBF_URL: https://download.geofabrik.de/europe/great-britain-latest.osm.pbf
NOMINATIM_PASSWORD: XXXXXXXXXXXX
volumes:
- type: bind
source: /volume1/docker/nominatim/pg_data
target: /var/lib/postgresql/12/main
- type: bind
source: /volume1/docker/nominatim/flatnode
target: /nominatim/flatnode
shm_size: 2gb
It's probably not what you want to hear but I would start fresh, delete your volume and reimport the data.
Thank you! This solved my week long issue!
Same error in version 4.2. I applied same workaround and it worked. I generated an image locally and it works fine, when I saved with the "save image" command and copied it to another server the error appear.