FATAL: the database system is starting up
PostgreSQL is still starting (or recovering) and not accepting connections yet.
Seen on:
PostgreSQL
Meaning
After a restart or crash, PostgreSQL replays WAL before accepting connections. Apps that start at the same time (Docker Compose) connect too early.
Common causes
- App starting before the database is ready
- Crash recovery replaying WAL
- Replica not yet consistent
β‘ Quick fix
- Add retries/backoff on startup
- Use Compose healthchecks with depends_on: condition: service_healthy
- Check logs if it stays in this state
Detailed fix by platform
Docker
healthcheck: { test: ["CMD-SHELL", "pg_isready -U postgres"], interval: 5s, retries: 10 }
How to diagnose
- Duration β Seconds or stuck?
- Logs β Recovery progress?
π§ Still stuck? Analyze your error
Paste the full message, response headers or stack trace β we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026