terraform-provider-github
terraform-provider-github copied to clipboard
502 Bad request errors when using github_teams datasource
Hi there,
Terraform Version
1.0.11 mainly but tested with 1.2.8 too
Affected Resource(s)
- github_team
Terraform Configuration Files
github_team_names = [
"team1",
"team2",
"teamX",
]
terraform {
required_providers {
github = {
version = "~> 4.12"
source = "integrations/github"
}
}
}
provider "github" {
token = <powerful_token>
owner = <organization>
}
variable "github_team_names" {
type = list(any)
}
data "github_team" "main_teams" {
for_each = toset(var.github_team_names)
slug = each.value
}
Debug Output
│ Error: GET https://api.github.com/organizations/*****/team/****/repos?page=2&per_page=100: 502 Server Error []
│
│ with data.github_team.main_teams["team1"],
│ on github.tf line 42, in data "github_team" "main_teams":
│ 42: data "github_team" "main_teams" {
-always returning a 502 when the team is owning many repos -same behaviour with only one team in "github_team_names" list
Panic Output
no panic error
Expected Behavior
We should not have a 502 error EVERY time... And get all informations from the datasource
Actual Behavior
"502 Server Error" or "Bad request"
Steps to Reproduce
terraform plan
Important Factoids
Teams managing hundreds of repositories Large organization
I checked the token quotas, we're good
Hello, also interested by this issue. I'd like to be able to get teams without their membership. For example, by providing a "membership_type" value as "none".
Could be great also filtering attributes we get from this datasource (no need of all repositories for example, I just need team id)
related: https://github.com/integrations/terraform-provider-github/issues/1377 re "(no need of all repositories for example, I just need team id)"
This should fix it: #1379 I found the same issue on github_organization_teams and was able to fix it with #1176. You can either reduce the number of results_per_page or use the summary_only flag (or both).
👋 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!