mediagis / nominatim-docker

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

Fatal error occurs if nominatim database already exists #384

Open acass91 opened 1 year ago

acass91 commented 1 year ago

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):

AntoineGGG commented 1 year ago

Same problem here.

Marlonzao commented 1 year ago

Same problem here.