`FATAL: password authentication failed for user "postgres"` and nobody knows the master password.
BeginnerTroubleshootingRDS, Aurora and DynamoDB
Answer
Likely causes → The password is wrong or was rotated (Secrets Manager managed password), or the username is wrong. The master username is set at creation and is not always postgres.
Diagnose →
aws rds describe-db-instances --db-instance-identifier mydb \
--query 'DBInstances[].[MasterUsername,MasterUserSecret.SecretArn]'
aws secretsmanager get-secret-value --secret-id <secret-arn> --query SecretString --output text
Fix →
- If RDS manages the secret, read the current value from Secrets Manager
- Otherwise reset the password:
aws rds modify-db-instance --db-instance-identifier mydb --master-user-password '<new>' --apply-immediately - Update the apps, and restart connection pools
Prevent → Use --manage-master-user-password so RDS stores and rotates the password in Secrets Manager, and give apps their own least-privilege DB users.
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: 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.IntermediateAfter a Multi-AZ failover, some app servers keep failing with connection errors for 10+ minutes while others recover in a minute.Advanced