Internal networking: postgres.railway.internal not resolving from app service
mileskailburn
PROOP

a month ago

Issue: My Next.js app service cannot connect to my Postgres service using the internal hostname postgres.railway.internal:5432. The connection fails with "Can't reach database server".

What I've verified:

- Both services are in the same project and environment

- Postgres service is running and healthy (logs show "database system is ready to accept connections")

- Postgres is listening on IPv4 0.0.0.0:5432 and IPv6 :::5432

- The public/proxy URL works fine (I can connect and seed the database from external tools)

- Restarted both services

- Tried both uppercase (Postgres.railway.internal) and lowercase (postgres.railway.internal) hostnames

Error from app logs:
Can't reach database server at postgres.railway.internal:5432

Please make sure your database server is running at postgres.railway.internal:5432.

The internal DNS doesn't appear to be resolving between services. The public URL works, but I'd prefer to use internal networking for performance and cost reasons.

Project ID: dbd7dc60-4329-4cb7-befb-73c8eb7b3243

Environment ID: 103c3af5-e9d5-4861-803f-ca2184bf54e1

Solved

6 Replies

congdv
HOBBY

a month ago

Not sure if this works for you.
For my case, I go to Postgres instance and change the endpoint in Private Networking to lower case postgres.railway.internal

and then I update the db connection url to lower case version postgresql://postgres:<password>@postgres.railway.internal:5432/railway


snugglepilot
PRO

a month ago

This worked for me as well. the capital P was messing things up.


Railway
BOT

a month ago

Hello!

We're acknowledging your issue and attaching a ticket to this thread.

We don't have an ETA for it, but, our engineering team will take a look and you will be updated as we update the ticket.

Please reply to this thread if you have any questions!


mileskailburn
PROOP

a month ago

That worked. While I wasn't able to switch the "P" to "p" as the "name was taken" I was able to add a suffix to postgresXX and get it to load now. Thank for the quick comments everyone!


a month ago

Hey all! Yes we had a short period where private networks were getting created with capital letters. Extremely sorry you ran into this!
The fix would be renaming them to the lowercase variant and updating all references.


Status changed to Awaiting User Response Railway about 1 month ago


Railway
BOT

a month ago

✅ The ticket Private domain creation issue has been marked as completed.


Railway
BOT

25 days ago

This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!

Status changed to Solved Railway 25 days ago


Loading...