3 months ago
Hi Railway Support Team,
I am experiencing a persistent issue with my Node.js deployment. My application container is being actively stopped by the system exactly 6-7 seconds after every single startup, rendering the app inaccessible.
The Issue: Every time the container starts, whether from a manual redeploy or an incoming web request (from sleep), my logs show a successful startup and port binding, followed immediately by a Stopping Container event.
What I've already checked/fixed:
- Port Binding: The Express server correctly binds to
0.0.0.0andprocess.env.PORT. - Database: I am using
better-sqlite3attached to a persistent volume, and it connects without issue. - Healthchecks: I suspected the default healthcheck was hitting my
/route (which returns a302 redirectfor unauthenticated users) and killing the app. So, I created a public/healthzroute (returns200 OK {"status": "ok"}) and added a railway.toml file settinghealthcheckPath = "/healthz". - Sleep State: I've added a self-ping interval inside the app that uses
fetchto ping the public Railway domain every 5 minutes to prevent Hobby plan sleep.
Despite these fixes, the deployment logs still show this exact repeating pattern. Interestingly, yesterday the service became active again at around 15:00, but this morning the shutdown behavior returned.
Since my app isn't crashing (there are no stack traces, memory limit errors, or unhandled exceptions), and I have explicitly configured the 200 OK health check, could you please investigate why the platform ingress or health check orchestrator keeps killing this container?
Thank you,
1 Replies
Status changed to Awaiting Railway Response Railway • 3 months ago
3 months ago
I suggest you remove the self-ping mechanism to prevent your service from sleeping, as you can disable serverless in your Service Settings > Enable Serverless, since you are on the hobby plan**.** This is likely causing your container to be stopped.