23 days ago
Hi, I'm having a private networking issue in my project sweet-abundance, service SimuladorMarketing (www.simulamarketing.com.br), connected to the Postgres service in the same project/environment (production).
Since deploy 0a3299a6 (started on 2026-09-12 at 14:03 BRT), the application has been unable to connect to the database. The deploy logs repeatedly show:
NeonDbError: Error connecting to database: fetch failed
[cause]: Error: getaddrinfo ENOTFOUND api.railway.internal
code: 'ENOTFOUND'
syscall: 'getaddrinfo'
hostname: 'api.railway.internal'
This is happening continuously, including right now (latest occurrences around 14:19 BRT), and is causing a 400 error on every user login attempt (POST /api/auth/login).
What I've already checked:
The Postgres service shows "Online" and its own logs show normal checkpoints happening — the database itself appears healthy.
The Postgres service's own "Database" tab in the Railway dashboard also gets stuck on "Attempting to connect to the database...", never resolving.
I already restarted the SimuladorMarketing service — the error persists minutes later.
I checked Railway's public status page and there's no listed incident.
My project is on the trial plan with a low balance (29 days or $4.88 remaining at the time of the issue) — not sure if that's related, but wanted to flag it.
Could you check this project's private networking and help me re-establish the connection between the two services? Thank you.
3 Replies
23 days ago
This thread has been opened as a bounty so the community can help solve it.
Status changed to Open Railway • 23 days ago
23 days ago
Is the name of the Postgres service api? The domain of the private URL should be <SERVICE_NAME>.railway.internal.
I'd recommend using existing reference variables (https://docs.railway.com/variables) instead of hardcoding them.
23 days ago
Thank you both, this nailed it. Confirmed in the code: pg-storage.ts was importing drizzle-orm/neon-http + @neondatabase/serverless, and there's even a leftover check for "neon.tech" in DATABASE_URL — so yes, this app was originally wired up against a real Neon.tech database before the Postgres service was added on Railway. x1t's diagnosis on the driver mismatch was spot on.
I've swapped the driver to pg + drizzle-orm/node-postgres and added pg/@types/pg as proper dependencies (not just transitive via drizzle-kit). About to update DATABASE_URL to the ${{Postgres.DATABASE_URL}} reference variable and redeploy. Will report back once it's confirmed working. Really appreciate the fast, precise help!
23 days ago
Good catch on the build-vs-runtime private networking distinction. In our case the drizzle-kit push migration runs as a Railway "pre-deploy" command (not part of the build step), so it already executes at deploy time, inside the private network — that lines up with why it always succeeded even before the driver fix.
Confirmed working now: redeployed with pg + drizzle-orm/node-postgres and the DATABASE_URL reference variable, and logins are succeeding again in production with class data loading correctly. Thanks again to both of you for the fast, precise diagnosis!
Status changed to Solved lauragarden • 23 days ago

