Cannot Connect Backend to Postgres via Internal Network (postgres.railway.internal:5432) – Only Dotted Line
couvedevelopment
HOBBYOP

10 months ago

Hi Railway Support,

I’m experiencing a persistent issue connecting my backend service to my Postgres database in the same project/environment (couve-backend, staging). Here’s a summary of the situation:

  • Postgres service is healthy and “ready to accept connections.”
  • I can connect and create tables using the public proxy (mainline.proxy.rlwy.net:55779) from my local machine.
  • The backend service in Railway fails to connect using the internal address (postgres.railway.internal:5432) with the error:

Error: P1001: Can't reach database server at postgres.railway.internal:5432

  • DATABASE_URL is set to ${{ Postgres.DATABASE_URL }} in the backend service variables.
  • Both services are in the same project and environment.
  • In the Architecture tab, there is only a dotted line (variable reference) between the backend and Postgres, not a solid line (true dependency).
  • The UI does not offer an option to add a true dependency or connect the services for private networking.
  • Restarting both services and redeploying does not resolve the issue.
  • No password or port mismatch, and no hardcoded URLs.

Is there a way to enable a true dependency (solid line) for private network access between my backend and Postgres? Or is there a platform/networking issue affecting my project?

Thank you for your help!

$10 Bounty

1 Replies

Railway
BOT

10 months ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


Welcome!

Sign in to your Railway account to join the conversation.

Loading...