mediagis / nominatim-docker

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

Docker compose container permission errors #571

Open LukasRdm opened 1 month ago

LukasRdm commented 1 month ago

Docker container made with compose with bind mounts has many permission issues.

I am using docker compose to start the container. Here is the docker-compose.yml:

version: "3"

x-logging: &default-logging options: max-size: '50m' max-file: '10' driver: json-file

services: nominatim: container_name: nominatim image: mediagis/nominatim:4.4 ports:

First error is met at Postgres DB start up. Error says: Starting PostgreSQL 14 database server * Error: The cluster is owned by user id 1026 which does not exist This can be overcome by adding this line to compose file: command: bash -c "sudo chown -R postgres:postgres /var/lib/postgresql/14/main && /app/start.sh"

Second and third error is met when trying to update the Nominatim data. The daily updates didn't come through, so I tried updating the data manually with command: docker exec -it nominatim sudo -u nominatim nominatim replication --catch-up

The second error looks like: PermissionError: [Errno 13] Permission denied: '/app/tokenizer

After manually giving permission with command: docker exec -it container_id sudo chown nominatim:nominatim /app

I try to manually update again. I get through the second error, but similar error pops up: RuntimeError: Open failed for '/nominatim/osmosischange.osc': Permission denied

I am trying the same command: docker exec -it container_id sudo chown nominatim:nominatim /app Which should finally finish the update.

Desktop / Server (please complete the following information):

LukasRdm commented 1 month ago

Yes, after using command chown on folder /app for the second time, the update has successfully finished.

LukasRdm commented 1 month ago

I switched to normal volumes which solved the permission issues. Still had trouble with docker exec -it nominatim sudo -u nominatim nominatim replication --catch-up, but after using the --project-dir docker exec -it nominatim sudo -u nominatim nominatim replication --catch-up --project-dir /nominatim all went well. Automatic updates with parameter UPDATE_MODE=once in docker-compose still doesn't work tho.