Database Connection Rejected
Anonymous
PROOP

2 months ago

I am presenting a crash in my service since I lost connection with my PostgreSQL database, I am just presenting it, I am sure that it is not due to changes made in my app but that even the tab to quickly view the data of my app stopped working.

Logs of my app:

In Connector.php line 67:

SQLSTATE[08006] [7] connection to server at "postgres.railway.internal" (10

.137.195.128), port 5432 failed: timeout expired

connection to server at "postgres.railway.internal" (fd12:499f:4da2:1:d000:

49:5889:c380), port 5432 failed: timeout expired

1:M 20 Aug 2026 22:47:12.061 * 1 changes in 60 seconds. Saving...

1:M 20 Aug 2026 22:47:12.065 * Background saving started by pid 23715

23715:C 20 Aug 2026 22:47:12.660 * BGSAVE done, 26867 keys saved, 0 keys skipped, 49620153 bytes written.

23715:C 20 Aug 2026 22:47:13.104 * DB saved on disk

23715:C 20 Aug 2026 22:47:13.106 * Fork CoW for RDB: current 3 MB, peak 3 MB, average 2 MB

1:M 20 Aug 2026 22:47:13.172 * Background saving terminated with success

)

.....1m FAIL

2026-08-20 22:48:00 Running ['artisan' campaigns:dispatch-due] In Connection.php line 857:

SQLSTATE[08006] [7] connection to server at "postgres.railway.internal" (10

In Connector.php line 67:

.137.195.128), port 5432 failed: timeout expired

connection to server at "postgres.railway.internal" (fd12:499f:4da2:1:d000:

49:5889:c380), port 5432 failed: timeout expired (Connection: pgsql, Host:

SQLSTATE[08006] [7] connection to server at "postgres.railway.internal" (10

postgres.railway.internal, Port: 5432, Database: railway, SQL: select * fro

.137.195.128), port 5432 failed: timeout expired

m "monitored_scheduled_tasks" where "name" = campaigns:dispatch-due limit 1

connection to server at "postgres.railway.internal" (fd12:499f:4da2:1:d000:

49:5889:c380), port 5432 failed: timeout expired

Solved$20 Bounty

6 Replies

Railway
BOT

2 months ago

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

Status changed to Open Railway • about 2 months ago


yahir-lope
PRO

2 months ago

Hey there!

The SQLSTATE[08006] timeout expired error pointing to postgres.railway.internal:5432 over both IPv4 and IPv6 means your application cannot reach your PostgreSQL instance over Railway's internal network. Since your Data tab is also unresponsive, the issue is on the database container side rather than your code.

Here are a few quick checks to resolve this:

-Check DB Status & Metrics: Go to your Postgres service in the Railway dashboard and check the Metrics tab. Look out for high RAM/CPU usage that might have triggered an Out-Of-Memory (OOM) kill or caused the service to crash/hang.

-Restart the Postgres Service: Try doing a manual Restart on the Postgres container to restore the process and internal DNS routes.

-Verify Service References: Ensure your app’s environment variables are still correctly reference-bound to the Postgres service (e.g., ${{Postgres.DATABASE_URL}} or ${{Postgres.RAILWAY_PRIVATE_DOMAIN}}).

-Check Volumes / Storage: If your database volume ran out of disk space, Postgres will stop accepting write operations or refuse new incoming connections.

If a restart doesn't bring the Data tab back up, drop your Project ID here so the Railway team or community can take a closer look!


Anonymous
PROOP

2 months ago

The problem isn't my app itself; I lost connection to the database instance. I already have a backup and its backup, and now I'm going to see if I can access it another way to recover its data.

app # nc -vz -w 5 postgres.railway.internal 5432

nc: connect to postgres.railway.internal (10.137.195.128) port 5432 (tcp) timed out: Operation in progress

nc: connect to postgres.railway.internal (fd12:499f:4da2:1:d000:49:5889:c380) port 5432 (tcp) timed out: Operation in progress


Are there any errors in your Postgres service?


Anonymous
PROOP

2 months ago

In the logs of the instance, no log was marked with which I could have an indication of the cause of the error, I tried to access through the TCP Proxy and it failed, I tried to do a redeployment and it also failed, leaving it hanging in the creation of the container


ayoubdukeli-svg
HOBBY

2 months ago

I also have my database on Postgres down, and I got an email from Railway saying it would be restored within 60 minutes, but that time has passed and the issue still isn't fixed. If they can't restore it, I've lost a week of work and will have to redo everything from scratch.


Anonymous
PROOP

2 months ago

I have regained the connection to the database, the service has been restored


Status changed to Solved Anonymous • about 2 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...