You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
If you are interested in working on this issue or have submitted a pull request, please leave a comment.
If an issue is assigned to a user, that user is claiming responsibility for the issue.
Customers working with a Google Technical Account Manager or Customer Engineer can ask them to reach out internally to expedite investigation and resolution of this issue.
If necessary, please reach out to our enterprise support account manager who we can provide with a private, redacted debug log.
Expected Behavior
The terraform change should apply cleanly.
Actual Behavior
The following error is output:
╷
│ Error: Error setting IAM policy for storage bucket "b/xxx-pubsub-test-bucket": googleapi: Error 412: At least one of the pre-conditions you specified did not hold., conditionNotMet
│
│
╵
Steps to reproduce
Create a project in the cloud console.
In the supplied terraform, replace <your project name> with the name of the project.
terraform apply the before terraform.
terraform apply the after terraform
Important Factoids
We did some debugging of our own and found out the following pieces of information:
When deleting a google_storage_notification resource, behind the scenes this triggers a change to the google_storage_bucket_iam_policy, and results in a change to the etag for the policy.
When planning, the gcp provider appears to record the current etag for the google_storage_bucket_iam_policy. It will only ever use this value when doing operations on the google_storage_bucket_iam_policy.
Given points 1 and 2, the following appears to be happening. When terraform runs, it first deletes the google_storage_notification resource, triggering a change to the google_storage_bucket_iam_policy resource and resulting in its etag changing. Then, terraform attempts to delete the google_storage_bucket_iam_policy, but in the delete request it specifies an etag precondition using the now-out-of-date etag it got when it first planned the change. This causes a 412 error.
We've reached out to GCP support and they say the above etag behavior is working as expected.
References
No response
b/388547047
The text was updated successfully, but these errors were encountered:
Community Note
Terraform Version & Provider Version(s)
Terraform v1.9.6
on linux_amd64
Affected Resource(s)
google_storage_bucket
google_storage_bucket_iam_policy
google_storage_notification
Terraform Configuration
Before
After:
Debug Output
If necessary, please reach out to our enterprise support account manager who we can provide with a private, redacted debug log.
Expected Behavior
The terraform change should apply cleanly.
Actual Behavior
The following error is output:
Steps to reproduce
<your project name>
with the name of the project.terraform apply
the before terraform.terraform apply
the after terraformImportant Factoids
We did some debugging of our own and found out the following pieces of information:
google_storage_notification
resource, behind the scenes this triggers a change to thegoogle_storage_bucket_iam_policy
, and results in a change to the etag for the policy.google_storage_bucket_iam_policy
. It will only ever use this value when doing operations on thegoogle_storage_bucket_iam_policy
.Given points 1 and 2, the following appears to be happening. When terraform runs, it first deletes the
google_storage_notification
resource, triggering a change to thegoogle_storage_bucket_iam_policy
resource and resulting in its etag changing. Then, terraform attempts to delete thegoogle_storage_bucket_iam_policy
, but in the delete request it specifies an etag precondition using the now-out-of-date etag it got when it first planned the change. This causes a 412 error.We've reached out to GCP support and they say the above etag behavior is working as expected.
References
No response
b/388547047
The text was updated successfully, but these errors were encountered: