19 days ago
My cozy-truth service (ID: e9869136-a631-4dab-8110-c2984852648e) cannot connect to my Postgres service (Postgres-lwGX, ID: 82f30c0a-91ad-4ade-ba50-569225b92850) in project e7039ff6-3bac-4556-ac7f-443156e37a3b.
The connection fails with "Connection terminated unexpectedly" when using ssl:false and the DATABASE_URL from ${{Postgres-lwGX.DATABASE_URL}}.
This worked until May 23, 2026. The Postgres service appears to have had its credentials rotated. Please confirm the correct DATABASE_URL for internal connections between these two services.
1 Replies
19 days ago
This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.
Status changed to Open Railway • 19 days ago
19 days ago
"Connection terminated unexpectedly" with ssl:false is the postgres server hanging up after the tls negotiation fails. railway bumped postgres recently (lines up with your May 23 date) to a version where ssl is required for internal connections — your explicit ssl:false now causes the rejection.
fix for node-postgres:
new Pool({
connectionString: process.env.DATABASE_URL,
ssl: { rejectUnauthorized: false }
})internal Postgres uses a self-signed cert so rejectUnauthorized: false is fine. if you're on a postgres 17+ client library and want it explicit, also set PGSSLNEGOTIATION=postgres as an env var on cozy-truth — that switches the client off "direct ssl" mode which needs ALPN that some networks don't handle cleanly.
reference variables (${{Postgres-lwGX.DATABASE_URL}}) update automatically when railway rotates anything — credentials weren't rotated in a way that breaks the substitution. the URL is fine; the issue is the ssl requirement.