Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERROR: The instance or operation is not in an appropriate state to handle the request

Using Google Cloud SQL I was attempting to restore my main instance to a prior backup, but first I wanted to clone the instance for the tables and databases that I didn't want reverted. After waiting over an hour for the clone, I canceled out of the clone and attempted to delete the cloned instance. However, the clone is now stuck in Maintenance status and attempting to delete I get the following error.

mycomputer:~ myuser$ gcloud sql instances delete cloned
All of the instance data will be lost when the instance is deleted.

Do you want to continue (Y/n)?  y

ERROR: (gcloud.sql.instances.delete) The instance or operation is not in an appropriate state to handle the request.

The instance was created with the following command and then just exited out with CTRL+C after waiting too long.

mycomputer:~ myuser$ gcloud sql instances clone main cloned
Cloning Cloud SQL instance.../ERROR: Caught socket error, retrying:[Errno 54] Connection reset by peer
ERROR: Caught socket error, retrying: [Errno 54] Connection reset by peer
Cloning Cloud SQL instance...|
Cloning Cloud SQL instance...\^C

Command killed by keyboard interrupt
like image 625
pensivepie Avatar asked Apr 29 '15 20:04

pensivepie


2 Answers

I tried replicating this problem with the Cloud SQL API Explorer. I found this error message on a different thread initiated on the Google forums. The error message "The instance or operation is not in an appropriate state to handle the request" occurs when the same name for the instance is being used. Now it also made sense to me why, in the official documentation of Terraform, a random_id resource is created as database name suffix.

like image 112
Sebastiaan Avatar answered Sep 24 '22 00:09

Sebastiaan


I was getting this error while creating SQL instance in GCP with terraform

Error: Error, failed to create instance <name>: googleapi: Error 409: The instance or operation is not in an appropriate state to handle the request., invalidState

I was able to solve it by changing the SQL instance name in the conf and it worked like perfectly

like image 37
Abhinay Gupta Avatar answered Sep 22 '22 00:09

Abhinay Gupta