integrations / terraform-provider-github

Terraform GitHub provider
https://www.terraform.io/docs/providers/github/
MIT License
887 stars 728 forks source link

[Github Enterprise] fail to persist github_team resource to tfstate, data provider fails to look up teams #698

Open reegnz opened 3 years ago

reegnz commented 3 years ago

I'm using GitHub Enterprise and I'm experiencing the following issue when trying to manage teams with this provider.

Terraform Version

❯ terraform -v
Terraform v0.14.5
+ provider registry.terraform.io/hashicorp/github v4.3.2
+ provider registry.terraform.io/integrations/github v4.3.2

Affected Resource(s)

Terraform Configuration Files

Using the resource: https://gist.github.com/reegnz/757384aa0f57476cde2b29d1bb5a421f Using the data source: https://gist.github.com/reegnz/5c3c4bcbef7093fbd45966c54f5d76c8

Debug Output

Using the resource: https://gist.github.com/reegnz/757384aa0f57476cde2b29d1bb5a421f Using the data source: https://gist.github.com/reegnz/5c3c4bcbef7093fbd45966c54f5d76c8

Expected Behavior

The provider should have created the github team in the organization. The data source should be able to look up teams in the organization by slug name.

Actual Behavior

When using the resource the team got created, but terraform failed with an error and failed to persist the resource details to the tfstate file.

When using the data source on the existing team terraform fails with an error, not being able to look up the team.

Steps to Reproduce

  1. terraform init
  2. terraform apply

You can then check the team in the org got created.

Then for the data source you can try to fetch the team with that set of configs:

  1. terraform init
  2. terraform apply

Important Factoids

Issue is happening with a private hosted Github Enterprise Server 2.20.17

In the logs I've replaced our company url with https://redacted.example.com.

hyei commented 3 years ago

Same problem here with github teams plan.

The url in the error below and what is showing at api.github.com suggests that the URI has changed organizations to orgs?

Error: PATCH https://api.github.com/organizations/48567122/team/3723703: 404 Not Found []

on iam.tf line 25, in resource "github_team" "developers": 25: resource "github_team" "developers" {

https://api.github.com/

github-actions[bot] commented 1 year ago

πŸ‘‹ Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!

github-actions[bot] commented 4 months ago

πŸ‘‹ Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!

reegnz commented 4 months ago

I'm still having issues with this one....

vveliev-tc commented 2 months ago

data failing and resource import with team ID is also failing. I have noticed that it was not returning my team from api as well unless I used pagination integer

https://api.github.com/orgs/{org}/teams\?page=5