Writes fail on Aurora MySQL with `ERROR 1290 (HY000): The MySQL server is running with the --read-only option so it cannot execute this statement`.
IntermediateTroubleshootingRDS, Aurora and DynamoDB
Answer
Likely causes → The app is connected to a reader: through the reader endpoint, an instance endpoint that became a reader after failover, or a pooled connection that lived through a failover.
Diagnose →
aws rds describe-db-clusters --db-cluster-identifier orders \
--query 'DBClusters[].[Endpoint,ReaderEndpoint,DBClusterMembers[].[DBInstanceIdentifier,IsClusterWriter]]'
mysql -h <host> -e "select @@aurora_server_id, @@innodb_read_only;"
Fix →
- Point write traffic at the cluster (writer) endpoint, never at an instance endpoint
- Recycle pools after failover. The AWS Advanced JDBC Wrapper handles this
- Retry the write after a reconnect
Prevent → Use separate writer and reader data sources in the app, and run failover drills (aws rds failover-db-cluster).
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