Hello,
How can I forcefully remove Cloud SQL for SQL Server node?
I'm trying to build a cluster using Cloud SQL for SQL Server and read replica stuck on PENDING_CREATE.
All the nodes show DONE as its status, however, primary node has Type: CREATE_REPLICA, Error: INTERNAL and other replicas have Type: CREATE_REPLICA, Error: UNKNOWN
Then there is no way to change/delete the read replica nodes from web, gcloud cli.
Following is error from CLI when I tried to remove the protection.
ERROR: (gcloud.sql.instances.patch) HTTPError 409: The instance or operation is not in an appropriate state to handle the request.
I have faced this issue earlier , you have deletion protection checkbox enabled while creating your SQL instance.
Go to Edit > Data Protection >Instance deletion protection as shown in below screenshot and untick checkbox to delete your instance.
I can't disable that option. I got the error above when I tried to disable the protection.
➜ ~ gcloud sql instances patch sqlserver-eval-replica-2 --no-deletion-protection
The following message will be used for the patch API method.
{"name": "sqlserver-eval-replica-2", "project": "***********", "settings": {"deletionProtectionEnabled": false}}
ERROR: (gcloud.sql.instances.patch) HTTPError 409: The instance or operation is not in an appropriate state to handle the request.
And here is the screenshot from the web console.
From your screenshots it's clear that database is not in running state, that's why it's not allowing you to edit .
They are stuck as "PENDING_CREATE" for more than four days. So I want to remove them even if they are not in running state.
➜ ~ gcloud sql instances list
NAME DATABASE_VERSION LOCATION TIER PRIMARY_ADDRESS PRIVATE_ADDRESS STATUS
sqlserver-eval-replica SQLSERVER_2017_ENTERPRISE us-central1-b db-custom-2-8192 - - PENDING_CREATE
sqlserver-eval-replica-2 SQLSERVER_2017_ENTERPRISE us-east1-d db-custom-2-8192 - - PENDING_CREATE
sqlserver-eval SQLSERVER_2017_ENTERPRISE us-west1-c db-custom-2-8192 aaa.bbb.ccc.ddd - RUNNABLE
I can see similar issues raised earlier as well , sounds like genuine issue , hope someone from google team might help here.