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

Github_team - Error: Provider produced inconsistent result after apply #434

Closed
shaun-rutherford opened this issue Apr 21, 2020 · 3 comments

Comments

@shaun-rutherford
Copy link

Hi Everyone,

Ran into a bug I couldn't find in the issue tracker (apologies if I missed it).

Creating a github_team using any version greater then v2.4.1 results in an error (posted below).

The team is created but never committed to the state file despite the error.

Running the following versions:
Terraform v0.12.24

  • provider.github v2.6.1

Tested against:
Github Enterprise v2.17.12 and Github Enterprise v2.20.3

Affected Resource(s)

  • github_team

Terraform Configuration Files

github_teams.tf (module)

resource "github_team" "team_created" {
  for_each    = var.github_teams

  name           = each.key
  description    = lookup(each.value, "description", "")
  privacy        = lookup(each.value, "privacy", "secret")
  ldap_dn        = lookup(each.value, "ldap_dn", "")

}

main.tf

module "PITA_Membership" {
  source = "./Modules/Github_Organizations"
  github_teams = {

    Puppet = {
      description = "Puppet Team"
      privacy = "closed"
    }
  }

}

Debug Output

https://gist.github.com/shaun-rutherford/e7bdaab7d998c8ef41c771cdc9a9421e

Panic Output

No crash log

Expected Behavior

What should have happened?
Github Team created with a proper exit.

Actual Behavior

What actually happened?
module.PITA_Membership.github_team.team_created["Puppet"]: Creating...

Error: Provider produced inconsistent result after apply

When applying changes to
module.PITA_Membership.github_team.team_created["Puppet"], provider
"registry.terraform.io/-/github" produced an unexpected new value for was
present, but now absent.

This is a bug in the provider, which should be reported in the provider's own
issue tracker.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply

Important Factoids

Running against github enterprise private instance.

References

None I'm aware of.

@anGie44
Copy link
Contributor

anGie44 commented Apr 24, 2020

Hi @shaun-rutherford, thank you for reporting this issue! I believe it's quite similar to #404. Unfortunately, this compatibility issue is still present in the provider AFIK and issue #404 illustrates a similar use case. Essentially the go-github client library in use is using an API method (to get a team) that is not supported by the enterprise API - explains why you're seeing the 404 response from the request: GET /api/v3/organizations/5/team/36 (the GitHub Enterprise API v2.20 supports only GET /api/v3/orgs/:org/teams/:team_slug or GET /api/v3/teams/:team_id).
more info available here as well:
https://developer.github.com/enterprise/2.20/v3/teams/#get-team-by-name
https://developer.github.com/enterprise/2.20/v3/teams/#get-team

@shaun-rutherford
Copy link
Author

Hi @anGie44 thanks much for the explanation, sorry I missed the #404 issue when I was searching for something similar.

I'll close this now since the #404 issue basically covers this I think.

@anGie44
Copy link
Contributor

anGie44 commented Apr 29, 2020

@shaun-rutherford of course, no worries! if you do come across other inconsistencies with the provider and your github enterprise setup please let us know :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants