Public domain returns 502 for 'api' service while internal healthcheck passes; 'admin' works fine
onepunchbenjaman
FREEOP

a month ago

Project: Astravia-api (34454287-4914-4155-a2fc-ebf76818c793)

Environment: production (107d5d72-8cfb-4a96-8f91-52d1e21135aa)

Service: api

Region: sfo (us-west2), 1 replica

SYMPTOM


Public domain (api-production-9675b.up.railway.app) returns 502 "Application failed

to respond" in ~1-20ms on every request. Service deployment SUCCESS but unreachable

from internet.

Concurrent service 'admin' same project/region works perfectly.

WHAT WORKS


• Internal healthcheck: GET /health → 200 (logs + Railway probes)

• Code: Tested production build locally (node dist/main + curl /health ×5)

→ all 200, no hangs, no crashes

• Deployment: No build errors; latest commit deployed cleanly

WHAT DOESN'T WORK


• Public HTTP: 502 before app processes request (~1-20ms)

• HTTP logs: [{error: "connection refused"}] × 3 per request, single replica

• Network Flow Logs: Only internal healthcheck to :3000; zero external HTTP traffic

DETAILS


Deploy logs show: app starts → modules init → Prisma connect → "successfully started"

  • first healthcheck 200 at 01:15:19 → then ZERO LOGS. No restart triggered, no

process death announced. Container still running but externally unresponsive.

Binding: app.listen(process.env.PORT ?? 3000, '0.0.0.0') explicit.

Code review: Health/Logging/Prisma modules — no async hangs, no state leaks.

TESTED & RULED OUT


✓ Application code (production build runs locally, responds to healthchecks)

✓ Binding/listening (0.0.0.0:3000 explicit)

✓ Controllers/modules (reviewed, no hangs)

✓ Database connectivity (logs show "Prisma connected")

COMPARISON


'admin' service same project/region works perfectly → not account/network-level issue.

Specific to 'api' or its deployment instance.

$10 Bounty

1 Replies

Railway
BOT

a month ago

This thread has been opened as a bounty so the community can help solve it.

Status changed to Open Railway about 1 month ago


I seem to be able to access the URL just fine...?

75041.png

Attachments


Welcome!

Sign in to your Railway account to join the conversation.

Loading...