2 months ago
Hi Railway team,
-
My app's Postgres private hostname never resolves. Across 3 separate deploys today (04:11:53Z, 04:33:18Z, 04:52:12Z), the app reads DATABASE_PRIVATE_URL correctly and tries the private hostname on port 5432, but every attempt fails with "failed to lookup address information: Name or service not known" — 100% consistent at every retry (0s through 195s+), never once resolving. Not a propagation delay; app-side config is correct and the app isn't crash-looping (health endpoint binds fine, only the DB connection fails).
-
Setting DATABASE_URL as a reference to the Postgres service's private URL keeps saving/resolving as an empty string instead of the actual value.
-
In the variable-reference autocomplete, DATABASE_URL doesn't appear in the suggestion list even though it exists on the Postgres service.
This is blocking production — the app can't reach its DB at all. Can you check for a private-networking issue on this project, and look into #2/#3 as dashboard bugs? Happy to send logs or IDs.
Thanks
3 Replies
2 months ago
All three symptoms trace to one thing: your app service and your Postgres service are in separate projects, and private networking (including *.railway.internal DNS, variable references, and the autocomplete list) is scoped to services within the same project and environment. Moving the Postgres service into the same project as your app (or vice versa) will resolve the DNS failures, the empty variable reference, and the missing autocomplete entry. See How Private Networking Works for details on network isolation.
Status changed to Awaiting User Response Railway • about 2 months ago
2 months ago
Guide me on how to create postgres in same environment of my project.
Status changed to Awaiting Railway Response Railway • about 2 months ago
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
eager4top
Guide me on how to create postgres in same environment of my project.
2 months ago
Open the project environment that contains your app, then add new Postgres service there
Then, edit DATABASE_URL on your app Variables to reference to DATABASE_URL of the new Postgres service and deploy
Status changed to Open mayori • about 1 month ago
Status changed to Solved mayori • about 1 month ago