Skip to content

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

Closed

Description

@shaun-rutherford

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.

Activity

  1. anGie44 commented on Apr 24, 2020

    @anGie44
    Collaborator

    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

  2. shaun-rutherford commented on Apr 29, 2020

    @shaun-rutherford
    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.

  3. anGie44 commented on Apr 29, 2020

    @anGie44
    Collaborator

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions