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

[BUG]: 422 User doesn't satisfy the two-factor authentication requirements for this organization #2258

Open
1 task done
Kristijan opened this issue May 10, 2024 · 0 comments
Labels
Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented

Comments

@Kristijan
Copy link

Expected Behavior

Gracefully handle when a user doesn't satisfy the two-factor authentication requirements for an organization when being created, rather than produce an error.

Actual Behavior

When I encounter a user that doesn't have two-factor enabled, and I attempt to add them to the GitHub organization, I encounter the below error. As far as I can tell, there doesn't appear to be a data source telling me if a user has two-factor authentication enabled on their account prior to trying to add it to the organization.

╷
│ Error: Provider produced inconsistent result after apply
│
│ When applying changes to github_membership.add-to-org["kristian"], provider "provider[\"registry.terraform.io/integrations/github\"]" produced an
│ unexpected new value: Root object was present, but now absent.
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
╵
╷
│ Error: PUT https://ghes.url/api/v3/organizations/13927/team/28489/memberships/kristian: 422 User doesn't satisfy the two-factor authentication requirements for this organization. [{Resource:TeamMember Field:user Code:no_2fa Message:}]
│
│   with github_team_membership.team-members["Test Group.user.kristian"],
│   on teams.tf line 16, in resource "github_team_membership" "team-members":
│   16: resource "github_team_membership" "team-members" {
│

Terraform Version

terraform --version
Terraform v1.8.3
on darwin_arm64
+ provider registry.terraform.io/integrations/github v6.2.1

Affected Resource(s)

  • github_membership
  • github_team_membership

Terraform Configuration Files

No response

Steps to Reproduce

$ terraform apply

Debug Output

No response

Panic Output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Kristijan Kristijan added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented
Projects
None yet
Development

No branches or pull requests

1 participant