Skip to content

fix: IAM Policy 409 concurrent changes error - take 2#11564

Merged
modular-magician merged 1 commit intohashicorp:mainfrom
modular-magician:downstream-pr-36e905682dbbc21df5dc2832ae7956835d316898
Feb 13, 2026
Merged

fix: IAM Policy 409 concurrent changes error - take 2#11564
modular-magician merged 1 commit intohashicorp:mainfrom
modular-magician:downstream-pr-36e905682dbbc21df5dc2832ae7956835d316898

Conversation

@modular-magician
Copy link
Collaborator

Fixes hashicorp/terraform-provider-google#25305

There is already a backoff retry mechanism but it's broken due to wrapped error. The current usage for checking if it's googleapi error doesn't work well.

#15972 reverted #15825 due to regressions. However, the original IAM 409 concurrent error is now back due to that.

I debugged that specific error and found that the err var returned is by the type fmt.Errorf on level 0 and googleapi.Error on level 1.
errwrap simply doesn't detect it.

I wanted to avoid walking or unwrapping and make minimal changes as possible.

Given the fact we have to keep using errwrap for now, I added the same changes I did originally below the current errwrap code and also I added tests.

I tested the generated provider and it solves the 409 issue.

Tagging @slevenick @ScottSuarez @BBBmau for extra verification and input.

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.

iam: fixed error 409 concurrency policy changes by correctly detecting the error type.

Derived from GoogleCloudPlatform/magic-modules#15995

[upstream:36e905682dbbc21df5dc2832ae7956835d316898]

Signed-off-by: Modular Magician <magic-modules@google.com>
@modular-magician modular-magician merged commit b0448fb into hashicorp:main Feb 13, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error 409 setting IAM policy for artifactregistry repository - There were concurrent policy changes

1 participant