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

Error: googleapi: Error 404: Resource Not Found: <id>, notFound #132

Closed
dwilliams782 opened this issue Aug 10, 2021 · 7 comments · Fixed by #136
Closed

Error: googleapi: Error 404: Resource Not Found: <id>, notFound #132

dwilliams782 opened this issue Aug 10, 2021 · 7 comments · Fixed by #136
Assignees
Labels
bug Something isn't working
Milestone

Comments

@dwilliams782
Copy link

dwilliams782 commented Aug 10, 2021

Hi,

When a user has been deleted, our entire plan fails due to the group_member resource still being in state:

Error: googleapi: Error 404: Resource Not Found: 1040763465893, notFound

I understand why, but until these groups are fully adopted into our JML process, this breaks the terraform plan for all other groups / users. It's not easy to identify which user this is, either.

We have identified the failed user, however the plan still errors due to that user being in state, and it attempts to refresh the resource. This breaks our whole pipeline, for cases where the user is removed prior to the group being updated. We cannot manage users in this same workflow. Is there a way to prevent this? I've had to remove the group member resource from state to fix this.

@jacobstr
Copy link

Finding this may be quite the thorn to work around as well. It'd be nice to have some notion of authoritative group membership vs non-authoritative ala (google_iam_member vs. google_iam_binding).

@dwilliams782
Copy link
Author

I've seen similar patterns with SQL related providers before where, if the user doesn't exist, it simply gets removed from state as part of the plan. That would be sufficient for us; the plan would show one to add, which would then fail on apply as the user doesn't exist so can't be added to the group.

@megan07
Copy link
Contributor

megan07 commented Aug 11, 2021

Hi @dwilliams782 !
Thanks for reporting this. Would you mind sharing your configuration so I can make sure I'm understanding this correctly? Or at least a mock up of it.
Thanks!

@megan07 megan07 added the bug Something isn't working label Aug 11, 2021
@megan07 megan07 self-assigned this Aug 11, 2021
@jacobstr
Copy link

"resource" "googleworkspace_group" "department-software" {
  "email" = "[email protected]"
}

"resource" "googleworkspace_group_member" "department-software-members-bob-at-example-com" {
  "email" = "[email protected]"

  "group_id" = "${googleworkspace_group.department-software.id}"

  "role" = "MEMBER"

  "type" = "USER"
}
  1. Terraform apply to make [email protected] a member of [email protected].
  2. Remove [email protected] from the group via the GUI.
  3. Terraform plan will now fail with a 404.

Expectation at 3 is that the terraform plan would try to re-add [email protected] to [email protected].

@megan07
Copy link
Contributor

megan07 commented Aug 11, 2021

@jacobstr - Thanks for the quick response! I've got a fix in for this now. Sorry about that!

@dwilliams782
Copy link
Author

Thanks @jacobstr!

@megan07 quick work! This will make a significant difference, thank you, fingers crossed 0.5.0 is released soon!

@dwilliams782
Copy link
Author

@megan07 Just deployed 0.4.1, instantly fixed our issue, thank you again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants