Service builds successfully but shows 0/1 replicas running — no deploy logs, 502 on all requests
nyashapascalm-ai
HOBBYOP

2 months ago

My FastAPI service (Python, deployed via Nixpacks) builds successfully but won't start — it shows 0/1 replicas running and returns 502 on every request, including the healthcheck endpoint. This started suddenly; the same code had been running fine for weeks.I've also tried filtering logs by the exact deployment ID and replica in the dashboard — it returns "No logs found" even though the build succeeded and the image pushed. So the container appears to never emit any runtime output at all.

$10 Bounty

2 Replies

Railway
BOT

2 months ago

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

Status changed to Open Railway 2 months ago


If there are no indications to what might be causing your application to not start. I suggest you delete your service entirely, and add it again. See if it works, or fails and generates error logs to help debug the issue.


lleywyn
PRO

2 months ago

build ok + image pushed but 0/1 replicas and zero runtime logs means the container is dying instantly on start before it can log anything. for fastapi/nixpacks the usual suspect is the start command, its binding to the wrong host/port or crashing on import. make sure youre starting with uvicorn main:app --host 0.0.0.0 --port $PORT (must be 0.0.0.0 and railways $PORT, not 127.0.0.1 or a hardcoded port, thats the #1 cause of the 502 healthcheck fail). if it ran for weeks then died with no code change, also check for a dependency that floated to a new version on rebuild. deleting + re-adding the service (like was suggested) can clear a stuck deploy state and will often finally surface real error logs, so worth a shot if the start cmd checks out.


Welcome!

Sign in to your Railway account to join the conversation.

Loading...