Closed ZPascal closed 4 years ago
@ZPascal The error is INTERNAL_ERROR
from Cloud SQL (the response code 200). I guess this is SQL error. I am afraid there are not much we can do about it at this moment. What do you see if you run the Terraform again? I would suggest file a issue to Cloud SQL.
@edwardmedia If I run terraform again, I get the same error. I will open an issue at GCP and post the result here.
@ZPascal below call looks good to me. Yes, we need helps from Cloud SQL to resolve this issue. I am closing this issue now. Feel free to reopen it if you see we can help further about this. Thank you
DELETE /sql/v1beta4/projects/xxxxxxx-gcp-cfr-dev/instances/abcd-luke-dev03-1597333529-11/users?alt=json&host=&name=vcap
@edwardmedia
GCP answer:
This error message typically occurs when there are tables, views etc. in the DB that are depending on the user you are trying to delete. Before deleteing a user from Postgres, all privilieges must be revoked. Running the "REVOKE ALL FROM user " should revoke all privileges from the user you would like to delete. You may find more information in the PostgreSQL documentation.
After you revoke the privileges from the aforementioned user, kindly try to delete the user using Terraform again. If this fails, please run the "gcloud sql users delete" command with the --verbosity=debug flag and provide us the output of the command here so we can investigate further.
Shouldn't this step actually be done by Terraform? Please, reopen the issue.
I'm going to lock this issue because it has been closed for 30 days β³. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error π€ π , please reach out to my human friends π hashibot-feedback@hashicorp.com. Thanks!
Community Note
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.Terraform Version
Terraform v0.12.28
Affected Resource(s)
Terraform Configuration Files
Debug Output
Expected Behavior
Destroying of the selected cloudsql postgres databases.
Actual Behavior
Unfortunately the following error occurs when destroying the databases.
Error: Error, failure waiting for deletion of vcap in abcd-luke-dev03-1597333529-11
Steps to Reproduce
terraform init -plugin-dir <plugin_dir> <tf_dir>
terraform destroy -force -plugin-dir -var-file=<path>/terraform.tfvars.json -state=<state_file>