-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
GCP Storage Permissions returns error on destroy #5871
GCP Storage Permissions returns error on destroy #5871
Comments
@lwmobeent I used your config to create and destroy the resources. Every time it worked fine and i don't see the errors you are facing. BTW, what role does your terraform service account have ?, mine have I am suspecting some concurrency issue, however i am not able to repro it. Please try setting the
|
The service account I am using with terraform has the storage admin role on the project level, also the complete template has other things as well so it might be conflicting with those if it's a concurrency issue? I can upload the complete template to google drive folder and share with you? |
Please share your config and debug log |
Please find the config file zipped in the folder below |
@lwmobeent I am able to repro the behavior with your whole template, I see its conflicting with
P.S. - I am keeping this issue open |
Hey @lwmobeent, the fix mentioned by @venkykuberan is the way to go. |
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.23
Affected Resource(s)
Terraform Configuration Files
Debug Output
Error: Error reading Resource "storage bucket \"b/demo-test-project-mobeen-lacework-bucket\"" for IAM binding with role "roles/storage.legacyBucketReader": Error applying IAM policy for storage bucket "b/demo-test-project-mobeen-lacework-bucket": Error setting IAM policy for storage bucket "b/demo-test-project-mobeen-lacework-bucket": googleapi: Error 412: Precondition Failed, conditionNotMet
GCP Stackdriver Log
The only issue in the logs, this does not have any authenticationInfo, a similar log for the 'get' is always successful,
Expected Behavior
Remove all of the bindings created on the bucket
Actual Behavior
Every time while destroying the binding policies, there is an error on at least one of them where it gives a 412 error as shown above, looking at the gcp logs there is only one issue that is also stated above. It works fine if you run terraform destroy a second time, but first time it always fails. It also sometimes fail on terraform apply but that is rare
The text was updated successfully, but these errors were encountered: