The homepage loads, but every page that needs data shows "Error establishing a database connection".

BeginnerTroubleshootingSite down
Answer

Likely causes → DB down or failing over, credentials rotated, connection limit reached, or a security group/NACL change between app and DB.

Diagnose →

nc -vz db.internal 5432
psql "host=db.internal user=app dbname=app" -c 'select 1'
aws rds describe-events --source-type db-instance --duration 60

Fix → Restore connectivity or credentials. If the DB is overloaded, restart the noisy client rather than the DB.

Prevent → Alert on DB connections and availability, rotate secrets with dual-credential overlap, and show a friendly degraded page instead of a raw error.

All Real-World Interview questions Roadmap: Interview readiness

More on Site down