terraform-provider-github
terraform-provider-github copied to clipboard
[BUG]: failed to create OAuth token from GitHub App
Expected Behavior
that terraform plan would succeed
Actual Behavior
terraform plan failed
but if we pin back to an earlier provider version before https://github.com/integrations/terraform-provider-github/releases/tag/v6.9.0 it works fine, so that is our current workaround
Terraform Version
terraform versions tested, 1.13.5 on [CUSTOMER-A].ghe.com 1.14.0 on [CUSTOMER-B].ghe.com
Affected Resource(s)
- provider "github"
Terraform Configuration Files
provider "github" {
alias = "enterprise"
owner = var.ghe_owner
base_url = var.ghe_base_url
app_auth {
id = var.ghe_app_id
installation_id = var.ghe_installation_id_enterprise
pem_file = file("${path.module}/../../modules/ghe/private.pem") # dynamically generated at runtime from gh secret on ephemeral gh agent
}
}
provider "github" {
alias = "organization"
owner = var.ghe_owner
base_url = var.ghe_base_url
app_auth {
id = var.ghe_app_id
installation_id = var.ghe_installation_id_organization
pem_file = file("${path.module}/../../modules/ghe/private.pem") # dynamically generated at runtime from gh secret on ephemeral gh agent
}
}
Steps to Reproduce
terraform apply
Debug Output
2025-12-07T23:57:06.406Z [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/integrations/github/6.9.0/linux_amd64/terraform-provider-github_v6.9.0 args=[".terraform/providers/registry.terraform.io/integrations/github/6.9.0/linux_amd64/terraform-provider-github_v6.9.0"]
2025-12-07T23:57:06.407Z [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/integrations/github/6.9.0/linux_amd64/terraform-provider-github_v6.9.0 pid=2118
2025-12-07T23:57:06.407Z [DEBUG] provider: waiting for RPC address: plugin=.terraform/providers/registry.terraform.io/integrations/github/6.9.0/linux_amd64/terraform-provider-github_v6.9.0
2025-12-07T23:57:06.411Z [INFO] provider.terraform-provider-github_v6.9.0: configuring server automatic mTLS: timestamp=2025-12-07T23:57:06.411Z
2025-12-07T23:57:06.427Z [DEBUG] provider.terraform-provider-github_v6.9.0: plugin address: address=/tmp/plugin56106065 network=unix timestamp=2025-12-07T23:57:06.427Z
2025-12-07T23:57:06.427Z [DEBUG] provider: using plugin: version=5
2025-12-07T23:57:06.441Z [WARN] ValidateProviderConfig from "provider[\"registry.terraform.io/integrations/github\"].organization" changed the config value, but that value is unused
2025-12-07T23:57:06.442Z [INFO] provider.terraform-provider-github_v6.9.0: 2025/12/07 23:57:06 [INFO] Selecting owner from GITHUB_OWNER environment variable: timestamp=2025-12-07T23:57:06.442Z
Error: -07T23:57:06.519Z [ERROR] provider.terraform-provider-github_v6.9.0: Response contains error diagnostic: @caller=github.com/hashicorp/[email protected]/tfprotov5/internal/diag/diagnostics.go:58 @module=sdk.proto diagnostic_detail="failed to create OAuth token from GitHub App: " tf_provider_addr=provider tf_req_id=502a1d0f-501f-1fc5-49f8-805ccc51dab5 tf_rpc=Configure diagnostic_severity=ERROR diagnostic_summary=Error tf_proto_version=5.10 timestamp=2025-12-07T23:57:06.519Z
Error: -07T23:57:06.520Z [ERROR] vertex "provider[\"registry.terraform.io/integrations/github\"].organization" error: Error
2025-12-07T23:57:06.520Z [WARN] Planning encountered errors, so plan is not applyable
2025-12-07T23:57:06.520Z [INFO] backend/local: plan operation completed
2025-12-07T23:57:06.520Z [INFO] backend/local: writing plan output to: plan.tfplan
Planning failed. Terraform encountered an error while generating this plan.
╷
│ Error: Error
│
│ with provider["registry.terraform.io/integrations/github"].organization,
│ on main.tf line 31, in provider "github":
│ 31: provider "github" {
│
│ failed to create OAuth token from GitHub App:
╵
2025-12-07T23:57:06.839Z [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2025-12-07T23:57:06.840Z [INFO] provider: plugin process exited: plugin=.terraform/providers/registry.terraform.io/integrations/github/6.9.0/linux_amd64/terraform-provider-github_v6.9.0 id=2118
2025-12-07T23:57:06.840Z [DEBUG] provider: plugin exited
Error: Process completed with exit code 1.
Panic Output
N/A
Code of Conduct
- [x] I agree to follow this project's Code of Conduct