FATAL: the database system is starting up
PostgreSQL is still starting (or recovering) and not accepting connections yet.
the database system is starting up 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 not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in PostgreSQL
- could not connect PostgreSQL: could not connect to server / connection refused — Is the server running on host and accepting TCP/IP connections?
- pg_restore text dump pg_restore: error: input file appears to be a text format dump. Please use psql.
- 25P02 ERROR: current transaction is aborted, commands ignored until end of transaction block
Other ways to find it
Where this error sits
Origin: Data. Errors that are often confused with or caused by this one (click to open):
🧠 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.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 13 Oct 2026