calm-blue
burni80
HOBBYOP
2 months ago
Description: Self-hosted CouchDB for Obsidian LiveSync
Category: Storage
1 Replies
burni80
HOBBYOP
2 months ago
Railway Healthcheck Intermittent Failure — Fix
Root Cause
Gunicorn is likely binding to 127.0.0.1 (localhost) instead of 0.0.0.0 (all interfaces). Railway's healthcheck can't reach the app on 127.0.0.1, so it retries 14x and tears down the deployment — even though gunicorn/Django boot fine internally.
This also explains why build logs show "Healthcheck succeeded" but the deploy fails: the builder's healthcheck runs in a different network context than runtime.
Fix
Change your gunicorn start command to bind 0.0.0.0:
gunicorn myproject.wsgi:application --bind 0.0.0.0:${PORT:-8080}Or via gunicorn.conf.py:
bind = "0.0.0.0:8080"Or via env vars:
HOST=0.0.0.0
PORT=8080If it still fails
- Add a lightweight healthcheck endpoint (
/health/) that doesn't hit the DB, and sethealthcheckPathinrailway.toml. - Increase
healthcheckTimeoutto 30s. - Open a Railway ticket referencing your deployment IDs (
b1d132c7,e5280956) — their own build logs contradicting deploy state points to a platform-side issue.