2 months ago
I'm experiencing a critical issue with my production deployment where Railway keeps terminating my container with SIGTERM after approximately 60-65 seconds, despite the application running perfectly healthy.
- Service: enterprise-persona-backend-production.up.railway.app
- Container uptime before SIGTERM**: 60-65 seconds consistently
- Memory usage: Stable at 16-17MB (no memory leaks)
- Application status: Server running successfully, listening on port 8080
- Health checks: All endpoints (/ping, /ready, /health) responding correctly
- Keepalive: Continuous pings every 1 second to prevent idle detection
What I've Implemented
- Aggressive keepalive mechanism (every 1 second)
- Multiple health check endpoints with Railway-specific headers
- Comprehensive process monitoring
- Graceful shutdown handling
- Memory and CPU usage logging
Logs from Latest Deployment:
```
Keepalive ping - Container is active
Memory: 16MB used, 18MB total
Keepalive ping - Container is active
Memory: 17MB used, 18MB total
Stopping Container
npm error path /app
npm error command failed
npm error signal SIGTERM
npm error command sh -c node server.js
Health check - Uptime: 65s, Status: Running
```
Technical Environment:
- Node.js v20.18.1
- Express.js server
- Platform: Railway production environment
- No application errors or crashes
- Server remains responsive until SIGTERM
1. Is there a platform-level timeout policy that terminates containers after ~60 seconds?
2. Are there any "idle container" policies that might be triggering this?
3. Could this be related to my Railway plan or service configuration?
4. Are there any known issues with container lifecycle management?
What I've Tried:
- Multiple health check configurations
- Aggressive keepalive mechanisms
- Different endpoint configurations
- Process monitoring and logging
Anyone encounter anything similar?
2 Replies
2 months ago
Hey there! We've found the following might help you get unblocked faster:
🧵 Healthy, non-serverless service is being terminated after successful health check
🧵 Container keeps terminating exactly 8 seconds after starting
If you find the answer from one of these, please let us know by solving the thread!
2 months ago
Hello,
Your current deployment has been online well past 60 to 65 seconds (5 hours now).
You may be looking at your old, removed deploys.
Best,
Brody
Status changed to Awaiting User Response Railway • about 2 months ago
Status changed to Solved allenvatican • about 2 months ago