21 days ago
Project: orchestator-coco-production Error: server closed connection unexpectedly Impact: Production app down Time: Started ~15:12 UTC Feb 20, 2026
8 Replies
20 days ago
Hey! Your Postgres database service has crashed, which is causing your app to crash too since it can't connect to the database.
Here's what to do:
1. Redeploy Postgres first - Go to the Postgres service, click the three-dot menu, and select "Redeploy". Wait for it to come back healthy.
2. Once Postgres is back up, redeploy your app - Your app is crash-looping because it retries the database connection 9 times, fails, and restarts. Once Postgres is running again, redeploy the Orchestator-Coco service.
3. Check your volume usage - Your Postgres volume is 500MB. If it's getting full, that could have caused the crash. You can check usage in the volume settings and scale it up if needed.
If Postgres won't start after redeploying, let us know and we can investigate further.
Status changed to Awaiting User Response Railway • 20 days ago
sam-a
Hey! Your Postgres database service has crashed, which is causing your app to crash too since it can't connect to the database.Here's what to do:1. Redeploy Postgres first - Go to the Postgres service, click the three-dot menu, and select "Redeploy". Wait for it to come back healthy.2. Once Postgres is back up, redeploy your app - Your app is crash-looping because it retries the database connection 9 times, fails, and restarts. Once Postgres is running again, redeploy the Orchestator-Coco service.3. Check your volume usage - Your Postgres volume is 500MB. If it's getting full, that could have caused the crash. You can check usage in the volume settings and scale it up if needed.If Postgres won't start after redeploying, let us know and we can investigate further.
20 days ago
Hi Sam, thank you for your prompt response. I followed your instructions, restarting the PostgreSQL database first and then the application, but the error persists. Regarding point 3, I checked and today the application's resource consumption increased significantly, approaching 500. Could this be the problem? If so, can I resolve it by upgrading the plan or increasing the capacity? I've attached evidence and my most recent log for your analysis. Logs: AggregateError [ECONNREFUSED]:
at internalConnectMultiple (node:net:1134:18)
at afterConnectMultiple (node:net:1715:7)
[Nest] 43 - 02/20/2026, 10:53:57 PM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (5)...
AggregateError [ECONNREFUSED]:
at internalConnectMultiple (node:net:1134:18)
at afterConnectMultiple (node:net:1715:7)
[Nest] 37 - 02/20/2026, 10:53:57 PM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (3)...
AggregateError [ECONNREFUSED]:
at internalConnectMultiple (node:net:1134:18)
at afterConnectMultiple (node:net:1715:7)
[Nest] 37 - 02/20/2026, 10:54:00 PM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (4)...
AggregateError [ECONNREFUSED]:
at internalConnectMultiple (node:net:1134:18)
at afterConnectMultiple (node:net:1715:7)
[Nest] 43 - 02/20/2026, 10:54:00 PM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (6)...
AggregateError [ECONNREFUSED]:
at internalConnectMultiple (node:net:1134:18)
at afterConnectMultiple (node:net:1715:7)
[Nest] 37 - 02/20/2026, 10:54:03 PM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (5)...
AggregateError [ECONNREFUSED]:
at internalConnectMultiple (node:net:1134:18)
at afterConnectMultiple (node:net:1715:7)
[Nest] 43 - 02/20/2026, 10:54:03 PM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (7)...
AggregateError [ECONNREFUSED]:
at internalConnectMultiple (node:net:1134:18)
at afterConnectMultiple (node:net:1715:7)
[Nest] 37 - 02/20/2026, 10:54:06 PM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (6)...
AggregateError [ECONNREFUSED]:
at internalConnectMultiple (node:net:1134:18)
at afterConnectMultiple (node:net:1715:7)
at afterConnectMultiple (node:net:1715:7)
AggregateError [ECONNREFUSED]:
[Nest] 43 - 02/20/2026, 10:54:06 PM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (8)...
at internalConnectMultiple (node:net:1134:18)
[Nest] 43 - 02/20/2026, 10:54:09 PM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (9)...
AggregateError [ECONNREFUSED]:
at internalConnectMultiple (node:net:1134:18)
at afterConnectMultiple (node:net:1715:7)
[Nest] 43 - 02/20/2026, 10:54:09 PM ERROR [ExceptionHandler]
AggregateError [ECONNREFUSED]:
at internalConnectMultiple (node:net:1134:18)
at afterConnectMultiple (node:net:1715:7)
[Nest] 37 - 02/20/2026, 10:54:09 PM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (7)...
AggregateError [ECONNREFUSED]:
at internalConnectMultiple (node:net:1134:18)
at afterConnectMultiple (node:net:1715:7)
[Nest] 37 - 02/20/2026, 10:54:42 PM ERROR [TypeOrmModule] Unable to connect to the database. Retrying (8)...
Error: Connection terminated due to connection timeout
at Client._connectionCallback (/app/node_modules/pg-pool/index.js:262:17)
at Connection.<anonymous> (/app/node_modules/pg/lib/client.js:149:18)
at Object.onceWrapper (node:events:633:28)
at Connection.emit (node:events:519:28)
at Socket.<anonymous> (/app/node_modules/pg/lib/connection.js:62:12)
at Socket.emit (node:events:519:28)
at TCP.<anonymous> (node:net:346:12)
at Socket.<anonymous> (/app/node_modules/pg/lib/connection.js:62:12)
at Socket.<anonymous> (/app/node_modules/pg/lib/connection.js:62:12)
at Socket.emit (node:events:519:28)
at Socket.emit (node:events:519:28)
at TCP.<anonymous> (node:net:346:12)
at TCP.<anonymous> (node:net:346:12)Attachments
Status changed to Awaiting Railway Response Railway • 20 days ago
0x5b62656e5d
Can you share your Postgres deployment logs?
18 days ago
Look the logs
Attachments
18 days ago
1. Verify Credentials
Check your environment variables (likely in Railway or a .env file). Ensure the PASSWORD and USER match exactly what is defined in your database service.
Note: Your logs show the DB is using
scram-sha-256encryption. Make sure your password doesn't have special characters that might be getting escaped incorrectly in your connection string.
2. Check the Database Host
Since you are using Railway (based on the logs), ensure your DATABASE_HOST is set to the Internal Domain provided by Railway (e.g., postgres.railway.internal) rather than localhost, unless they are in the exact same Docker container.
18 days ago
Try this:
Note: If you have any public access domains for your Postgres service, remove them for now just in case as this process involves disabling password authentication.
⠀
Install Railway CLI (https://docs.railway.com/guides/cli)
Copy the SSH command by right clicking the PostgreSQL service
Once you're in, type in the following command: (Copy paste this EXACTLY as written)
sed -i 's/host all all all scram-sha-256/host all all ::\/0 trust/' /var/lib/postgresql/data/pgdata/pg_hba.confRedeploy your database
Use the SSH command again, and once you're in, type
psqlType the following SQL command.
my_passwordshould be replaced with whatever it actually says in your variables tab for your password (Probably under thePGPASSWORDvariable)ALTER USER postgres with password 'my_password';Type
exitReset your authentication settings with the following command:
sed -i 's/host all all ::\/0 trust/host all all all scram-sha-256/' /var/lib/postgresql/data/pgdata/pg_hba.confRedeploy your database and your other services that depend on your database.