robjuz / helm-charts

https://robjuz.github.io/helm-charts/index.yaml
34 stars 30 forks source link

ERROR: database "nominatim" already exists #51

Closed felipemendes1994 closed 1 year ago

felipemendes1994 commented 1 year ago

Hello guys,

I've been trying to run nominatim over helm on my k8s cluster on GCP, but I've been receiving the following error

Defaulted container "nominatim" out of: nominatim, wait-for-db (init), download-pbf (init)
2023-04-14 19:40:26: Using project directory: /nominatim
2023-04-14 19:40:29: Creating database
createdb: error: database creation failed: ERROR:  database "nominatim" already exists
2023-04-14 19:40:29: FATAL: Creating new database failed.

I have installed nominatim before, but I had to stop the previous installation. I have deleted the nominatim release from helm to avoid issues, and tried to reinstalled it again. But it didn't work.

When I uninstalled nominatim from my cluster, no resources from helm and k8s remains.

I'm using the follow values.yml file, to this first deployment, but my intenttion is migrating the database connection to GCP sql:

nominatimInitialize:
  enabled: true
  pbfUrl: https://download.geofabrik.de/south-america/brazil-latest.osm.pbf
  importWikipedia: false

nominatimReplications:
  enabled: true
  replicationUrl: https://download.geofabrik.de/south-america/brazil-updates/

postgresql:
  primary:
      extendedConfiguration: |
        shared_buffers = 2GB
        maintenance_work_mem = 10GB
        autovacuum_work_mem = 2GB
        work_mem = 50MB
        effective_cache_size = 24GB
        synchronous_commit = off
        max_wal_size = 1GB
        checkpoint_timeout = 10min
        checkpoint_completion_target = 0.9
        fsync = off
        full_page_writes = off

Additional info:

helm list output:
NAME: nominatim                             
NAMESPACE: default
REVISION: 2
UPDATED: 2023-04-14 16:49:00.931065265 -0300 -03
STATUS: deployed
CHART: nominatim-3.8.0
APP VERSION: 4.1

Can anyone help me, please?

hw-rjuzak commented 1 year ago

This is a limitation for now, that the nominatim database cannot exist.

When you really want to tear down the nominatim installation, you should remove the namespace. This will also remove all persistent volumes.

felipemendes1994 commented 1 year ago

Hello @hw-rjuzak,

Your insight about database existance, poped me up an idea. I deleted the PVC created for nominatim chat, and tried to re-install it again, and it worked.

Thank you very much!

felipemendes1994 commented 1 year ago

For those who may face the same issue. I opened a pull request (here), adding instructions for a complete uninstallation of nominatim.

Hope it helps!!!