nominatim-docker
nominatim-docker copied to clipboard
Fatal error occurs if nominatim database already exists
Describe the bug
I have an instance of PostgreSQL running on my host server and I'm running docker with --network="host"
and -e PGHOSTADDR=127.0.0.1
. If the nominatim database does not exist, the container starts up. If it does, then I get this fatal error.
createdb: error: database creation failed: ERROR: database "nominatim" already exists
FATAL: Creating new database failed.
This requires me to drop the database in PostgreSQL before starting the container. Can this error be treated as non-fatal?
To Reproduce Steps to reproduce the behavior:
- Install PostgreSQL on the host machine and start it
- Start a nominatim container and use host networking mode with PGHOSTADDR set to 127.0.0.1
- Stop the container after it has created the nominatim database
- Attempt to start another container
Expected behavior The container should attempt to use the existing database.
Desktop / Server (please complete the following information):
- OS & Version: RHEL 8.4
- Docker Version: 20.10.18
- Nominatim Version: 4.1