Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storage bucket: Surface non-retryable object delete error #1929

Conversation

modular-magician
Copy link
Collaborator

Release Note Template for Downstream PRs (will be copied)

storage: fixed bug where deleting a `google_storage_bucket` that contained non-deletable objects would retry indefinitely 

This PR fixes a bug when Storage Bucket delete operation is stuck in a never-ending loop when it can't delete objects - fixes hashicorp/terraform-provider-google#6034.

Please see the above-mentioned ticket on how to reproduce the issue.

With this PR in place, the terraform will give up when hitting a non-retryable error during objects delete (we will still try to delete the bucket in case we can):

google_storage_bucket.static-site: Destroying... [id=stepan-playground-tfdelete]

Error: could not delete non-empty bucket due to error when deleting contents: googleapi: Error 403: Object 'stepan-playground-tfdelete/test.txt' is under active Temporary hold and cannot be deleted, overwritten or archived until hold is removed., forbidden

I tried to add a test to cover this issue, but didn't find a way how to test Error on destroy with current Test() plumbing. If this is desirable I would appreciate help on how to best implement the test.

Derived from GoogleCloudPlatform/magic-modules#3336

…3336)

* Storage bucket: Surface non-retryable object delete error

* storage: test deleting bucket with non-deletable objects error

Signed-off-by: Modular Magician <magic-modules@google.com>
@ghost ghost added the size/m label Apr 3, 2020
@modular-magician modular-magician merged commit 68db373 into hashicorp:master Apr 3, 2020
@modular-magician modular-magician deleted the downstream-pr-5e208eaecc69409400f848df6c131b8023728992 branch November 16, 2024 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GCS Bucket - delete operation stuck in never-ending loop when it can't delete objects
1 participant