Database Connection Issues
Troubleshoot database connectivity problems.
PostgreSQL Connection Refusedโ
Symptom: ECONNREFUSED 127.0.0.1:5432
Fixes:
- Check PostgreSQL is running:
pg_isready - Verify
DB_HOSTandDB_PORTin.env - Check PostgreSQL
pg_hba.confallows connections
Authentication Failedโ
Symptom: password authentication failed for user
Fixes:
- Verify
DB_USERandDB_PASSin.env - Check user exists:
\duin psql - Reset password:
ALTER USER gauzy WITH PASSWORD 'new-password';
SSL Requiredโ
Symptom: no pg_hba.conf entry for host ... SSL off
Fix: Set SSL mode:
DB_SSL_MODE=true
Connection Pool Exhaustedโ
Symptom: too many clients already or slow queries
Fixes:
- Increase pool size:
DB_POOL_SIZE=60 - Use PgBouncer for connection pooling
- Check for connection leaks (unclosed connections)
Migration Errorsโ
Symptom: relation "xxx" does not exist
Fix:
# Run pending migrations
yarn typeorm migration:run
# Check migration status
yarn typeorm migration:show
SQLite Lock Errorsโ
Symptom: SQLITE_BUSY: database is locked
Fix: SQLite doesn't support concurrent writes. For multi-user, switch to PostgreSQL:
DB_TYPE=postgres
Related Pagesโ
- Database Backup & Recovery โ backup guide
- Environment Variables โ DB config