Billing pause → service stopped → and I can’t recover my n8n workflows/agents
marcosmariot
HOBBYOP

3 months ago

Hi everyone — I need help recovering an old Railway database after my project was interrupted due to a billing/payment issue.

What happened

  • My Railway services were stopped because of a payment/billing interruption.

  • After I reactivated everything, I could not restore/access my SQL database (Postgres) where my n8n data lived (workflows, credentials, agents, etc.).

  • To get the stack running again, I created a new setup using the n8n template and redeployed the services (n8n, Redis, etc.). Those parts are working.

  • But the database access/restore fails with an authorization error (permissions / access denied).

Current problem

  • I’m trying to connect to / restore the original Postgres database (the one that contained all my n8n workflows).

  • When I try to access it, I get an error like: “not authorized / permission denied / missing authorization to access”.

  • Because of that, I can’t retrieve my previous n8n data.

Goal

Recover everything from the original n8n database without losing anything (workflows, credentials, agents, execution data if possible).

What I need guidance on

  1. Does Railway keep automated backups/snapshots for Postgres in this situation, and how can I access/restore them after a billing pause?

  2. If the original Postgres service still exists (or its volume exists), can it be reattached to a new project/service, or restored into a new Postgres instance?

  3. If this is a roles/permissions issue:

    • What’s the correct way to reset the DB user / rotate credentials / fix role grants so I can read the old schemas/tables again?

  4. What’s the safest migration path to move old data into the new template stack?
    (e.g., pg_dump from old → pg_restore into new)

Info I can provide (no secrets)

  • n8n version: <your n8n version>

  • DB type: Postgres (Railway plugin)

  • The exact error message (sanitized):
    <paste the exact error text here — remove passwords/URLs>

  • Whether the old Postgres service/volume still appears in the Railway dashboard: <yes/no>

If anyone has been through a similar “billing pause → DB access denied” scenario, I’d love the exact steps to recover the original Postgres data and import it into the new n8n setup.

Thanks!

$10 Bounty

11 Replies

dardameiz
PRO

3 months ago

Hey earlier they solved it like this:

You need to redeploy Postgres, Redis, Worker, Primary, in that order. Then railway helpem them. But it was with a trial not with payment issue but it might be the same from railway side.


3 months ago

Hey, Railway retains your data for 60 days in case you miss a payment. If you resolve your billing issues within that 60-day period, all your data should still be accessible.

For your issue regarding not authorized / permission denied / missing authorization to access did you make any changes to your database? Are you able to access it through the data tab or via an external database viewer? Additionally, even if your data completely resets (volume), you should still be able to access your database using the same username and password, but it would be empty.


marcosmariot
HOBBYOP

3 months ago

Hey everyone, thanks a lot for replying.

The PostgreSQL server wasn't changed, and I managed to deploy all the other services except for it.

The payment problem was resolved in less than 30 days.

And the access data wasn't changed. However, I tested several custom start commands with the help of GPT trying to fix it, but I wasn't successful and honestly I don't remember exactly where I left off, as I don't have any programming knowledge.

Do you think support can help me? Should I open a ticket?

If you want, I can send the custom start command and the deployment log.

Thank you very much so far.


dardameiz
PRO

3 months ago

You can attach here your logs. Normally it does not contain credentials.


marcosmariot

Hey everyone, thanks a lot for replying.The PostgreSQL server wasn't changed, and I managed to deploy all the other services except for it.The payment problem was resolved in less than 30 days.And the access data wasn't changed. However, I tested several custom start commands with the help of GPT trying to fix it, but I wasn't successful and honestly I don't remember exactly where I left off, as I don't have any programming knowledge.Do you think support can help me? Should I open a ticket?If you want, I can send the custom start command and the deployment log.Thank you very much so far.

3 months ago

Please rollback to the original start command. If you leave it empty, it should revert to the original one.

If you're unable to even start your PostgreSQL service after that, please send your logs as suggested by the user above.


marcosmariot
HOBBYOP

3 months ago

I left the space blank, and the deployment was successful, but when trying to access it I get error 503: database is not ready.

Sorry for the delay, but we've made progress, at least the problem is now different.

this: psql: error: connection to server at "localhost" (::1), port 5432 failed: FATAL: role "postgres" does not exist

Connection matched file "/var/lib/postgresql/data/pgdata/pg_hba.conf" line 128: "host all all all scram-sha-256"

2025-12-23 17:24:15.235 UTC [45264] FATAL: password authentication failed for user "postgres"

2025-12-23 17:24:15.235 UTC [45264] DETAIL: Role "postgres" does not exist.

Connection matched file "/var/lib/postgresql/data/pgdata/pg_hba.conf" line 128: "host all all all scram-sha-256"

2025-12-23 17:24:15.739 UTC [45265] FATAL: password authentication failed for user "postgres"

2025-12-23 17:24:15.739 UTC [45265] DETAIL: Role "postgres" does not exist.

Connection matched file "/var/lib/postgresql/data/pgdata/pg_hba.conf" line 128: "host all all all scram-sha-256"

2025-12-23 17:24:16.234 UTC [45266] DETAIL: Role "postgres" does not exist.

Connection matched file "/var/lib/postgresql/data/pgdata/pg_hba.conf" line 128: "host all all all scram-sha-256"

2025-12-23 17:24:16.246 UTC [45267] FATAL: password authentication failed for user "postgres"

2025-12-23 17:24:16.234 UTC [45266] FATAL: password authentication failed for user "postgres"

2025-12-23 17:24:16.246 UTC [45267] DETAIL: Role "postgres" does not exist.

Connection matched file "/var/lib/postgresql/data/pgdata/pg_hba.conf" line 128: "host all all all scram-sha-256"

I never changed the password for postgres

Thank you all for your time.


dardameiz
PRO

3 months ago

When you create the database of postgres, its a default username of postgres. I see in your log that the database was initialized however its weird that postgres is not working. Can you check what is in the env variables under: PGUSER or DATABASE_URL ?

Are you still in dev phase? Do you have any volume? If not might worth to delete the database including the volume and re-do it


dardameiz

When you create the database of postgres, its a default username of postgres. I see in your log that the database was initialized however its weird that postgres is not working. Can you check what is in the env variables under: PGUSER or DATABASE_URL ?Are you still in dev phase? Do you have any volume? If not might worth to delete the database including the volume and re-do it

marcosmariot
HOBBYOP

3 months ago

DATABASE_PUBLIC_URL="postgresql://${{POSTGRES_USER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}/${{POSTGRES_DB}}"

DATABASE_URL="postgresql://${{POSTGRES_USER}}:${{POSTGRES_PASSWORD}}@${{PGHOST}}:${{PGPORT}}/${{{PSTGRES_DB}}"

PGDATA="/var/lib/postgresql/data/pgdata"

PGDATABASE="${{POSTGRES_DB}}"

PGHOST="${{RAILWAY_PRIVATE_DOMAIN}}"

PGPASSWORD="${{POSTGRES_PASSWORD}}"

PGPORT="5432"

PGUSER="${{POSTGRES_USER}}"

POSTGRES_DB="railway"

POSTGRES_PASSWORD="CMsMY-wlPr~HMxkjJSFallBofBT9W0Yp"

POSTGRES_USER="postgres"

RAILWAY_DEPLOYMENT_DRAINING_SECONDS="60"

SSL_CERT_DAYS="820"

Yes, it has the original volume attached to it. The idea is to retrieve that data using my workflow agents, etc. Otherwise, I would have already created everything anew.


dardameiz
PRO

3 months ago

There’s a typo in your DATABASE_URL - it says ${{{PSTGRES_DB} with triple braces and missing the “O” in POSTGRES. Fix that first.

For the missing role, since you need to recover data, try adding this as a temporary start command:

docker-entrypoint.sh postgres -c 'local all all trust' -c 'host all all all trust' -

this disables auth so you can connect and run \du to see what roles actually exist, then create the missing postgres role with CREATE ROLE postgres WITH LOGIN SUPERUSER PASSWORD 'your-password';. After that, remove the custom start command and redeploy normally.


dardameiz
PRO

3 months ago

btw after posting here your env variables, and your problem is solved (hopefully) please change your password at least slightly_smiling_face emoji as this is a public forum


marcosmariot
HOBBYOP

2 months ago

Hi everyone,

Sorry for the delay, but I just got back from vacation and returned to work today.

The deployment was successful, but when accessing the URL I receive this message in the browser: {"code":503,"message":"Database is not ready!"}

I think I'm close to recovering my data. I would appreciate it if someone could help me.

Thank you and Happy 2026!

Loading...