Backend service randomly restarting/stopping with no error logs (Hobby plan)
markoi2017
HOBBYOP

11 days ago

Service: Node.js 20 (Alpine) backend running in a Docker container

Issue:

My backend service keeps randomly restarting throughout the day with no error logs, no crash messages, and no

SIGTERM/exit handlers firing. The container just stops and starts again at irregular intervals (anywhere from 18 minutes

to 5+ hours apart).

What the logs show:

- No application errors, no uncaught exceptions, no unhandled rejections

- No SIGTERM received (I have handlers that log this — they never fire)

- No process.on('exit') logs appear

- Same deployment ID and replica ID across all restarts (not new deployments)

- Service works perfectly fine after each restart — health check passes immediately

Memory is NOT the issue:

- I have 5-minute memory snapshots logging heapUsed, heapTotal, and RSS

- heapUsedMB: consistently 38-47 MB (out of 2,096 MB limit set via --max-old-space-size=2048)

- rssMB: consistently 117-125 MB with zero upward trend

- No memory leak or growth — the process uses ~2% of its heap limit

Configuration:

- railway.json: restartPolicyType: "ON_FAILURE", restartPolicyMaxRetries: 5, healthcheckPath: "/health",

healthcheckTimeout: 120

- Dockerfile CMD: node --max-old-space-size=2048 dist/index.js

- Migrations run via Railway deploy command (configured in UI)

- Plan: Hobby

What I've ruled out:

- Memory/OOM kills — memory is flat at ~120 MB RSS across all process lifetimes

- Application crashes — no error handlers fire, no exceptions logged

- New deployments — same deployment ID on all restarts

- Health check failures — service starts fine and responds to health checks within 1 second

Restart pattern today (same deployment):

- 05:57 → 06:15 (18 min uptime)

- 06:15 → 08:20 (2 hr uptime)

- 08:20 → 09:20 (1 hr uptime)

- 09:20 → 10:56 (1.5 hr uptime)

- 10:56 → 16:15 (5 hr uptime)

- 16:15 → ongoing

Has anyone experienced similar behavior? Is there any Railway-side container eviction or node rescheduling that could

cause this on the Hobby plan?

Solved$10 Bounty

0 Replies

Status changed to Awaiting Railway Response Railway 11 days ago


Status changed to Solved markoi2017 6 days ago


Loading...