Postgres unreachable from API container — postgres.railway.internal connection refused.
martinalex
HOBBYOP

10 days ago

Started ~90min ago. FastAPI/Python service on Railway, attached Postgres. Everything was healthy until I shipped a small migration + code change.

What's broken:

- API container's /health (no DB) was returning 200, has since started timing out too

- Every DB-touching route hangs in middleware on a Postgres connection

- Container logs show:

psycopg2.OperationalError: connection to server at "postgres.railway.internal"

(fd12:2b0b:4fae:1:2000:90:2781:c1ab), port 5432 failed: Connection refused

- and received invalid response to SSL negotiation: H to the same host

- railway connect postgres from my laptop also hangs — so it's not just the internal hop; the external Postgres proxy for my project appears down

too

- Postgres service logs are quiet apart from WARNING: Invalid HTTP request received (looks like healthcheck noise, not errors)

- railway redeploy --yes on the API restarts the container cleanly — still can't reach DB

- Public status page is green

Question: anyone else seeing internal Postgres routing issues right now, or known way to force a Postgres service restart from CLI? Project-scoped

incident, not on the public status page.

$10 Bounty

3 Replies

Status changed to Open Railway 10 days ago


10 days ago

Do you have outbound ipv6 enabled on the service settings?


martinalex
HOBBYOP

10 days ago

Outbound IPv6 on the service is on; the issue is Postgres not listening on IPv6 from inside Railway's private network. IPv4 connect to the same Postgres works fine from the container.


martinalex

**Outbound IPv6 on the service is on; the issue is Postgres not listening on IPv6 from inside Railway's private network. IPv4 connect to the same Postgres works fine from the container.**

9 days ago

While it is not optimal, have you tried using the public url?


Welcome!

Sign in to your Railway account to join the conversation.

Loading...