Skip to content
n8n repeatedly crashes after rotation of Postgres password
Anonymous
OP

a month ago

Hello Railway Support Team,

I'm experiencing a persistent issue with my n8n deployment on Railway and would appreciate your help.

My original n8n service crashed after regeneration of password suggested as per notice, so I created a new n8n service and a new PostgreSQL service. Although both new services sometimes show as Online, the n8n editor remains inaccessible and the deployment repeatedly crashes.

The logs have shown these errors:

EACCES: permission denied, open '/home/node/.n8n/config'

connect ECONNREFUSED ::1:5432

I've tried troubleshooting the volume permissions and configuring the PostgreSQL connection variables, but the issue remains unresolved.

Could you please help me determine why the service is failing and how to configure the deployment correctly?

Project: dependable-vibrancy

Environment: production

New n8n service: n8n-new

Database service: Postgres-new

I can provide deployment logs and screenshots if needed. Please let me know what additional information would help.

Thank you.

Screenshot 2026-10-25 145633.png

$10 Bounty

13 Replies

Railway
BOT

a month ago

This thread has been opened as a bounty so the community can help solve it.

Status changed to Open Railway • 27 days ago


a month ago

Try set RAILWAY_RUN_UID=0 in the n8n Service Variables


mayori

Try set `RAILWAY_RUN_UID=0` in the n8n Service Variables

Anonymous
OP

a month ago

I did it but it is not resolved yet.


Anonymous
OP

a month ago

This is what happens when I open n8n via link given in n8n service.

Screenshot 2026-10-25 161409.png


Since you created a new n8n service and a new db, I assume you don't have any data to lose, so I suggest you just start a new n8n project from a template. You can try this one: https://railway.com/deploy/n8n-5 as this uses the latest stable version pinned, unlike the others, to avoid unwanted updates on redeploys in the future.


darseen

Since you created a new n8n service and a new db, I assume you don't have any data to lose, so I suggest you just start a new n8n project from a template. You can try this one: https://railway.com/deploy/n8n-5 as this uses the latest stable version pinned, unlike the others, to avoid unwanted updates on redeploys in the future.

Anonymous
OP

a month ago

Well, Thanks for your advice but I have created another fresh one DB and N8n, but it also crashed right after deployment.


Can you share the error logs?


darseen

Can you share the error logs?

Anonymous
OP

a month ago

Yes, Please check it


It seems like n8n is failing to connect to postgres, is postgres even healthy and running? Also, can you check the variable DB_POSTGRESDB_HOST and that its value is set to postgres.railway.internal. I just deployed the template, and everything seems to be working as expected! Can you start a brand new project with the template, and check again?


Anonymous
OP

a month ago

Yes, Postgres is healthy and online. Let me apply these changings as you suggested.


darseen

It seems like n8n is failing to connect to postgres, is postgres even healthy and running? Also, can you check the variable `DB_POSTGRESDB_HOST` and that its value is set to `postgres.railway.internal`. I just deployed the template, and everything seems to be working as expected! Can you start a brand new project with the template, and check again?

Anonymous
OP

a month ago

Yes, Postgres is healthy and online. Let me apply these changings as you suggested.


Yes, Postgres is healthy and online. Let me apply these changings as you suggested.

Any updates?


Anonymous
OP

a month ago

It did not work and Now I have created another template and its is working now.


nilu-mukherjee

a month ago

For n8n connected to PostgreSQL on Railway, the important variables include:

DB_TYPE=postgresdb

DB_POSTGRESDB_HOST=${{Postgres.PGHOST}}

DB_POSTGRESDB_PORT=${{Postgres.PGPORT}}

DB_POSTGRESDB_DATABASE=${{Postgres.PGDATABASE}}

DB_POSTGRESDB_USER=${{Postgres.PGUSER}}

DB_POSTGRESDB_PASSWORD=${{Postgres.PGPASSWORD}}

Here Postgres must match the actual database service name. Railway reference variables avoid manually copying credentials, but the exact supported variable names should be checked in that service.

Also, if the original n8n instance contains workflows or credentials, do not delete its database or persistent volume just because a fresh template works.


Welcome!

Sign in to your Railway account to join the conversation.

Loading...