n8n → Postgres connection issue: “Role ‘postgres’ does not exist

pierrevhm
HOBBY

a month ago

Hi,

I’m having a persistent issue with my Railway project running n8n in queue mode (Primary + Worker + Postgres + Redis).

Since recently, my logs keep showing:

On Worker / Primary:

password authentication failed for user "postgres"

On Postgres:

Role "postgres" does not exist
FATAL: password authentication failed for user "postgres"

What I’ve tried so far:

Opened the Connect tab in Postgres and copied the PGUSER, PGPASSWORD, PGHOST, PGPORT, PGDATABASE values

Updated the DBPOSTGRESDB* environment variables on both Primary and Worker with these values (replacing postgres with the actual PGUSER shown in the Connect tab)

Removed duplicates like DATABASEURL or other DB* vars to avoid conflicts

Redeployed Postgres, Primary, and Worker in that order

I’m still getting the same error.

Any idea what else could cause this issue?
Is there something specific to Railway I should check to make sure the user role is recognized by Postgres?

Thanks in advance 🙏

$10 Bounty

2 Replies

pierrevhm
HOBBY

a month ago

d13ecc4d-e7d3-4d0e-a66b-4019ebfd77ab


fra
HOBBYTop 5% Contributor

a month ago

why you copy/paste? you can just use the variable dropdown selector


Check the variable references in dockerfile and docker-compose.yml in your project. If it's set up as something else entirely compared to what you set up in Railway, you would face issues.


n8n → Postgres connection issue: “Role ‘postgres’ does not exist - Railway Help Station