An RDS major version upgrade fails, and the event says `Database instance is in a state that cannot be upgraded: PreUpgrade checks failed`.
AdvancedTroubleshootingRDS, Aurora and DynamoDB
Answer
Likely causes → Pre-checks found blockers: unsupported extensions or extension versions (PostGIS, pg_repack), reg* data types, open prepared transactions, logical replication slots, or for MySQL, objects incompatible with 8.0/8.4 (reserved words, old temporal types).
Diagnose →
aws rds describe-events --source-identifier mydb --source-type db-instance --duration 60
aws rds describe-db-log-files --db-instance-identifier mydb --filename-contains upgrade
aws rds download-db-log-file-portion --db-instance-identifier mydb --log-file-name <precheck-log> --output text
aws rds describe-db-engine-versions --engine postgres --engine-version 15.8 --query 'DBEngineVersions[].ValidUpgradeTarget[].EngineVersion'
Fix →
- Upgrade the extensions (
ALTER EXTENSION postgis UPDATE;), drop replication slots, and commit or roll back prepared transactions - Retry with a matching custom parameter group for the target version
- For minimal downtime, use RDS Blue/Green Deployments
Prevent → Rehearse upgrades on a restored snapshot, and use Blue/Green for major versions.
More on RDS, Aurora and DynamoDB
The app cannot connect to RDS: `psql: error: connection to server at "mydb.abc.us-east-1.rds.amazonaws.com" (10.0.3.12), port 5432 failed: Connection timed out`.Beginner`FATAL: password authentication failed for user "postgres"` and nobody knows the master password.Beginner`FATAL: no pg_hba.conf entry for host "10.0.1.25", user "app", database "orders", no encryption`.IntermediateApp logs show `FATAL: remaining connection slots are reserved for non-replication superuser connections` (or MySQL `ERROR 1040 (HY000): Too many connections`).IntermediateRDS status shows `storage-full` and writes fail.IntermediateA read replica's `ReplicaLag` keeps growing and reports show stale data.Intermediate