Skip to content

How do I troubleshoot issues when I try to delete an Aurora DB cluster?

3 minute read
0

I want to delete an Amazon Aurora DB cluster. However, I received an error message, or the option to delete is unavailable (grayed out) in the Amazon Relational Database Service (Amazon RDS) console.

Resolution

Note: If you receive errors when you run AWS Command Line Interface (AWS CLI) commands, then see Troubleshooting errors for the AWS CLI. Also, make sure that you're using the most recent AWS CLI version.

If the option to delete an Aurora DB cluster is unavailable, then there are DB instances in the cluster that you must delete first.

Note: If you use the Amazon RDS console to delete the DB instances, then Amazon RDS automatically deletes the cluster when it's empty.

After you delete all instances, you can use the Amazon RDS console, or the AWS CLI to delete the empty cluster.

A DB cluster can have only one writer instance and at least one reader instance or read replica. When you delete the reader instance, you don't affect the writer instance and cluster. If you delete the writer instance, then Aurora automatically promotes the reader instance to a writer instance. This failover operation causes downtime.

If you receive an error when you delete the cluster, then take the following troubleshooting actions based on the error message that you receive.

"Deletion protection option enabled" error

If you activated deletion protection for the cluster, then you might receive the following error:

"This database has deletion protection option enabled, to be able to delete the last Aurora DB instance, modify the Aurora cluster and disable deletion protection".

To resolve this issue, complete the following steps:

  1. Open the Amazon RDS console.
  2. In the navigation pane, choose Databases, and then select the cluster.
  3. Choose Actions, and then choose Modify cluster.
  4. Choose Disable deletion protection, and then choose Continue.
  5. Choose Apply immediately.

"Contains DB instances in non-deleting state" AWS CLI error

If you use the AWS CLI to delete the cluster, then you might receive the following error:

"An error occurred (InvalidDBClusterStateFault) when calling the DeleteDBCluster operation: Cluster cannot be deleted, it still contains DB instances in non-deleting state".

This error shows that there are still DB instances in the cluster that you must delete.

"FinalDBSnapshotIdentified cannot be specified" AWS CLI error

If the AWS CLI can't take a final snapshot of the DB cluster before it runs the delete operation, then you receive the following error:

"InvalidParameterCombination: An error occurred (InvalidParameterCombination) when calling the DeleteDBInstance operation: FinalDBSnapshotIdentifier cannot be specified when deleting a cluster instance".

To resolve this issue, remove the --final-db-snapshot-identifier option or use the --skip-final-snapshot option when you run the delete-db-cluster command.

If you can't delete your global cluster, then run the following modify-global-cluster command to deactivate delete protection in the global cluster:

aws rds modify-global-cluster --global-cluster-identifier example-id --no-deletion-protection --profile example-profile --region example-region

Note: Replace example-id with your global cluster identifier, example-profile with your user profile, and example-region with your AWS Region.

"Cannot delete the last instance of the read replica" error

If the DB cluster that you want to delete is a replica, then you receive the following error:

"InvalidDBClusterStateFault: Cannot delete the last instance of the read replica DB cluster. Promote the DB cluster to a standalone DB cluster in order to delete it".

To resolve this issue, promote the cluster to a standalone DB cluster. Then, delete the cluster.

Related information

How do I delete or terminate Amazon RDS resources?

Managing an Amazon Aurora DB cluster

AWS OFFICIALUpdated a year ago
2 Comments

If you are like me, stuck at deleting a global cluster, here's the CLI

aws rds modify-global-cluster --global-cluster-identifier kekdb --no-deletion-protection --profile superadmin --region us-east-2

replied 2 years ago

Thank you for your comment. We'll review and update the Knowledge Center article as needed.

AWS
EXPERT
replied 2 years ago