5 days ago
My Node.js service starts successfully and responds to HTTP requests but receives a SIGTERM signal approximately 6 seconds after startup with no error message. I'm on the Hobbyist plan. The service runs node server.js via npm start. I've tried setting healthcheck path to / with 30 second timeout, RAILWAY_HEALTHCHECK_TIMEOUT_SEC=300, restart policy on failure, and 1 replica. The server logs show it responding to GET / successfully before being killed.
1 Replies
5 days ago
This thread has been opened as a bounty so the community can help solve it.
Status changed to Open Railway • 5 days ago
4 days ago
it's your healthcheck failing, not an actual crash. that "boots fine, serves a request, then SIGTERM about 6s in with no error" pattern on railway is almost always the app listening on localhost instead of 0.0.0.0. railway runs the healthcheck over the internal network, it can't reach 127.0.0.1, so the deploy never goes healthy and railway kills the container.
open server.js and make the listen call bind to 0.0.0.0 and use railway's port, so it's app.listen(process.env.PORT || 3000, "0.0.0.0"). if you had the host or port hardcoded, that's the whole bug right there.
the healthcheck timeout settings you added won't matter, it's not timing out, it's never getting a healthy response to begin with. change that and it'll stay up. lmk if it still dies after.