2 months ago
My service starts successfully, health check passes (GET /health returns 200 OK), but Railway sends SIGTERM exactly 6-8 seconds after every startup. No cron schedules. numReplicas=1. healthcheckTimeout=120. Just upgraded to Hobby plan. Has been doing this for hours. Project ID: 6d42bfb3-49b0-40df-aa55-ca0bac65cc14
3 Replies
Here's what the logs look like — starts successfully in under 1 second, then immediately gets SIGTERM. No error messages. TCP health check now (no healthcheckPath set). This happens on every single deploy regardless of code changes. Has been happening for 2+ hours across 15+ deploys.
Attachments
2 months ago
Hello maxwell,
i look at your logs, uvicorn is binding to hardcoded port 8080 ("uvicorn running on http://0.0.0.0:8080") but railway does the tcp health check on the $PORT variable it injects, which might not be 8080. if those two don't match, railway sees the tcp check fail and keeps cycling. try changing your start command to use $PORT instead of hardcoded 8080, something like uvicorn main:app --host 0.0.0.0 --port $PORT, then redeploy
Hope this help you :)