There was an error initializing DB

What can we do here?

There was an error initializing DB
password authentication failed for user "postgres"
User settings loaded from: /home/node/.n8n/config
Last session crashed

where do you get this errors?
did you change the password in the .env file?

yes. is there a initial password in coles package?

yes, you need to set it in the .env file, but if you didnt know about that, where did you change the password :slight_smile:

I mean if there is a default in the env file which I overwrote.

ok, I am not sure how it is handled, but did you change this before started the first time? I could imagine the password is persisted after started the DB once and if you change it afterwards it does not match.

If you changed after, change back to the default and see if it works.

As I understand this is the default
POSTGRES_PASSWORD=your-super-secret-and-long-postgres-password

… and I changed it to a reasonable password (n8npassword).
I still get the following, even after reinstall:

cli input:
$ docker logs n8n

cli output:
Initializing n8n process
There was an error initializing DB
password authentication failed for user "postgres"
User settings loaded from: /home/node/.n8n/config
Last session crashed

I also get this from the logs:

22/Apr/2025:02:07:21 +0000: Starting PostgREST 12.2.8...
22/Apr/2025:02:07:21 +0000: Listening on port 3000
22/Apr/2025:02:07:21 +0000: Failed to establish a connection. {"code":"PGRST000","details":"connection to server at \"db\" (172.19.0.4), port 5432 failed: FATAL:  password authentication failed for user \"authenticator\"\n","hint":null,"message":"Database connection error. Retrying the connection."}
22/Apr/2025:02:07:21 +0000: Failed listening for notifications on the "pgrst" channel. Just "connection to server at \"db\" (172.19.0.4), port 5432 failed: FATAL:  password authentication failed for user \"authenticator\"\n"postgrest: thread killed

did you try to set just back as well?

reinstall => did you also remove / make sure all volumes are deleted as well, otherwise the data would still be the old one as far as I know, depending on what you mean with “reinstall”

[SOLVED]
Thank you, thats right. I also removed networks etc.
Now it works on my headless.

1 Like