Nexus 3 Fails to Connect to PostgreSQL with "password authentication failed for user 'nexus'" Despite Correct Credentials

I am running Nexus Repository Manager 3 (version 3.77.0, previously 3.76.1) in Kubernetes, using the official Helm chart. I am attempting to migrate from the embedded H2 database to an external PostgreSQL (Cloud SQL) instance.

  • The Kubernetes secret for database credentials is correct and matches what works with psql from a debug pod.
  • The Nexus pod’s environment variables (POSTGRES_USER, POSTGRES_PASSWORD, etc.) are set correctly and match the new PostgreSQL user and database.
  • I can connect to the database from a debug pod using the same credentials.
  • However, Nexus fails to start and logs show:
    FATAL: password authentication failed for user "nexus"
  • The logs also show Nexus is still trying to connect as user “nexus” to the old database, even after updating the environment variables and secret to use a new user/database.
  • I have not removed or renamed the nexus.mv.db file, as per Sonatype documentation.
  • I need to preserve all existing data during this migration.

What I’ve Tried:

  • Verified all secrets, environment variables, and network connectivity.
  • Created a new PostgreSQL user and database, updated the secret, and restarted the pod.
  • Confirmed the pod is using the new environment variables.
  • Nexus still attempts to connect with the old user/database, not the new ones.

How can I safely migrate Nexus from H2 to PostgreSQL, ensuring it uses the new user/database and preserves all existing data, without removing the H2 files?

Hi,

Our official Helm chart only supports PRO licenses, if you have a pro license you can open a support ticket.

The environment variables mentioned don’t match those in our documentation - Install Nexus Repository with a PostgreSQL Database

Its possible you’re using a third party helm chart in which case you’d need to contact the maintainer, or determine how to configure variables yourself.