nominatim-docker icon indicating copy to clipboard operation
nominatim-docker copied to clipboard

Fatal error occurs if nominatim database already exists

Open acass91 opened this issue 2 years ago • 2 comments

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:

  1. Install PostgreSQL on the host machine and start it
  2. Start a nominatim container and use host networking mode with PGHOSTADDR set to 127.0.0.1
  3. Stop the container after it has created the nominatim database
  4. 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

acass91 avatar Oct 17 '22 18:10 acass91