PostgreSQL Service Unreachable from API Service - Internal Network Issue
yashwant86
FREEOP

2 months ago

I'm experiencing a connectivity issue between my API service and PostgreSQL database service on Railway, both deployed in the same project and environment (production).

Issue Details:

  • API Service: Running successfully, listening on port 4000

  • PostgreSQL Service: Running and ready to accept connections

  • Problem: API cannot connect to PostgreSQL at postgres.railway.internal:5432

  • Error:PrismaClientInitializationError: Can't reach database server at postgres.railway.internal:####

What I've tried:

  1. Restarted both services multiple times

  2. Verified DATABASE_URL is correctly configured

  3. Confirmed PostgreSQL logs show: "database system is ready to accept connections"

  4. Both services are in the same project/environment

  5. Verified all environment variables are set correctly

Expected behavior: API should be able to reach PostgreSQL on the private network

Current status: API and PostgreSQL are deployed but cannot communicate internally

Could this be a network isolation issue or a known problem? Is there anything I should check or reconfigure?

Solved

4 Replies

Railway
BOT

2 months ago


ray-chen
EMPLOYEE

2 months ago

Your setup looks correct. Are you able to consistently reproduce this or is it intermittent?


Status changed to Awaiting User Response Railway 2 months ago


apotapov
PRO

2 months ago

Same issue. And please stop closing threads that are describing this issue as solved. Clearly lots of folks are still having this problem


Status changed to Awaiting Railway Response Railway 2 months ago


noahd
EMPLOYEE

2 months ago

Hmmm, I'm looking at your most recent logs and it appears as though everything is functioning just fine now. Are you still having this issue? Would need some more info before I can debug.


Status changed to Awaiting User Response Railway about 2 months ago


Railway
BOT

2 months 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 about 2 months ago


Loading...