Skip to content

[BUG]: github_repository unable to create a private repo in personal space of GitHub Enterprise org #3354

@fabiendelpierre

Description

@fabiendelpierre

Expected Behavior

Using github_repository resource with visibility set to "private" while logged in as an enterprise user creates a repo successfully.

Actual Behavior

Terraform returns:

github_repository.example: Creating...
╷
│ Error: POST https://api.github.com/user/repos: 422 Public repositories are not permitted for Enterprise Managed Users. []
│
│   with github_repository.example,
│   on main.tf line 15, in resource "github_repository" "example":
│   15: resource "github_repository" "example" {
│
╵

Terraform Version

% terraform version
Terraform v1.11.4
on darwin_arm64
+ provider registry.terraform.io/integrations/github v6.11.1

Affected Resource(s)

  • github_repository

Terraform Configuration Files

terraform {
  required_version = "~> 1.11"
  required_providers {
    github = {
      source  = "integrations/github"
      version = "~> 6.11"
    }
  }
}

provider "github" {}

resource "github_repository" "example" {
  name        = "example-repo"
  description = "Example repo made with Terraform"
  visibility  = "private"
}

Steps to Reproduce

While logged in to an enterprise account with an EMU, simply run the attached code example (terraform init -> terraform apply -> say "yes")

Note: the code example works fine when I'm authenticated with my personal account. But it returns that 422 error when I'm logged in with my enterprise account. The error is nonsense because I'm not trying to create a public repo.

I'm using an Enterprise Managed User (EMU) to access an enterprise org. I opened this issue with my personal account, but I have a separate account called e.g. fabien_myorg that was provided by my employer via the EMU process. https://github.com/fabien_myorg is my personal space within that enterprise org and I was trying to manage its repos with Terraform.

I've seen other issues here where the attempt to create a new repo was based on a template. I am not using a template.

Public repos are indeed disabled by policy in my enterprise, but as I mentioned, I'm not trying to create a public one although the provider seems to think I asked for one.

I am able to create a private repo by clicking my way through the website as well as via GH CLI:

% gh auth status
github.com
  ✓ Logged in to github.com account <EMU_username> (keyring)
  - Active account: true
  - Git operations protocol: https
  - Token: gho_************************************
  - Token scopes: 'gist', 'read:org', 'repo', 'workflow'

  ✓ Logged in to github.com account fabiendelpierre (keyring)
  - Active account: false
  - Git operations protocol: https
  - Token: gho_************************************
  - Token scopes: 'gist', 'read:org', 'repo', 'workflow'

% gh repo create
? What would you like to do? Create a new repository on github.com from scratch
? Repository name fabien-test
? Repository owner <EMU_username>
? Description fabien-test
? Visibility Private
? Would you like to add a README file? No
? Would you like to add a .gitignore? No
? Would you like to add a license? No
? This will create "fabien-test" as a private repository on github.com. Continue? Yes
✓ Created repository <EMU_username>/fabien-test on github.com
  https://github.com/<EMU_username>/fabien-test
? Clone the new repository locally? No

That I'm able to do this via GH CLI but not via Terraform using the same access token tells me that something is likely wrong with how the provider is trying to interact with the API.

I've also tried explicitly setting the owner argument in the provider block like so:

provider "github" {
  owner = "<EMU_username>"
}

Just in case, I also tried to set the correct token explicitly with the token argument, but neither of those things made a difference. I realize the outcome may be affected by enterprise policy but at the very least, it seems to me the error message isn't accurately reporting what's really happening.

Hope I'm not doing something stupid but let me know if I am :)

Debug Output

Output of TF_LOG=DEBUG terraform apply -auto-approve

2026-04-20T15:39:21.896-0400 [INFO]  Terraform version: 1.11.4
2026-04-20T15:39:21.897-0400 [DEBUG] using github.com/hashicorp/go-tfe v1.70.0
2026-04-20T15:39:21.897-0400 [DEBUG] using github.com/hashicorp/hcl/v2 v2.23.0
2026-04-20T15:39:21.897-0400 [DEBUG] using github.com/hashicorp/terraform-svchost v0.1.1
2026-04-20T15:39:21.897-0400 [DEBUG] using github.com/zclconf/go-cty v1.16.0
2026-04-20T15:39:21.897-0400 [INFO]  Go runtime version: go1.23.3
2026-04-20T15:39:21.897-0400 [INFO]  CLI args: []string{"/Users/<REDACTED>/.tenv/Terraform/1.11.4/terraform", "apply", "-auto-approve"}
2026-04-20T15:39:21.897-0400 [DEBUG] Attempting to open CLI config file: /Users/<REDACTED>/.terraformrc
2026-04-20T15:39:21.897-0400 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2026-04-20T15:39:21.898-0400 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2026-04-20T15:39:21.898-0400 [DEBUG] ignoring non-existing provider search directory /Users/<REDACTED>/.terraform.d/plugins
2026-04-20T15:39:21.898-0400 [DEBUG] ignoring non-existing provider search directory /Users/<REDACTED>/Library/Application Support/io.terraform/plugins
2026-04-20T15:39:21.898-0400 [DEBUG] ignoring non-existing provider search directory /Library/Application Support/io.terraform/plugins
2026-04-20T15:39:21.899-0400 [INFO]  CLI command args: []string{"apply", "-auto-approve"}
2026-04-20T15:39:21.934-0400 [DEBUG] checking for provisioner in "."
2026-04-20T15:39:21.934-0400 [DEBUG] checking for provisioner in "/Users/<REDACTED>/.tenv/Terraform/1.11.4"
2026-04-20T15:39:21.938-0400 [INFO]  backend/local: starting Apply operation
2026-04-20T15:39:21.952-0400 [DEBUG] created provider logger: level=debug
2026-04-20T15:39:21.952-0400 [INFO]  provider: configuring client automatic mTLS
2026-04-20T15:39:21.963-0400 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/integrations/github/6.11.1/darwin_arm64/terraform-provider-github_v6.11.1 args=[".terraform/providers/registry.terraform.io/integrations/github/6.11.1/darwin_arm64/terraform-provider-github_v6.11.1"]
2026-04-20T15:39:21.965-0400 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/integrations/github/6.11.1/darwin_arm64/terraform-provider-github_v6.11.1 pid=43434
2026-04-20T15:39:21.965-0400 [DEBUG] provider: waiting for RPC address: plugin=.terraform/providers/registry.terraform.io/integrations/github/6.11.1/darwin_arm64/terraform-provider-github_v6.11.1
2026-04-20T15:39:22.004-0400 [INFO]  provider.terraform-provider-github_v6.11.1: configuring server automatic mTLS: timestamp=2026-04-20T15:39:22.001-0400
2026-04-20T15:39:22.012-0400 [DEBUG] provider: using plugin: version=5
2026-04-20T15:39:22.013-0400 [DEBUG] provider.terraform-provider-github_v6.11.1: plugin address: address=/var/folders/13/c2qxdjqn0pq84mrb5jjjnxbh0000gq/T/plugin1648390600 network=unix timestamp=2026-04-20T15:39:22.012-0400
2026-04-20T15:39:22.039-0400 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2026-04-20T15:39:22.041-0400 [INFO]  provider: plugin process exited: plugin=.terraform/providers/registry.terraform.io/integrations/github/6.11.1/darwin_arm64/terraform-provider-github_v6.11.1 id=43434
2026-04-20T15:39:22.047-0400 [DEBUG] provider: plugin exited
2026-04-20T15:39:22.048-0400 [DEBUG] Building and walking validate graph
2026-04-20T15:39:22.053-0400 [DEBUG] ProviderTransformer: "github_repository.example" (*terraform.NodeValidatableResource) needs provider["registry.terraform.io/integrations/github"]
2026-04-20T15:39:22.054-0400 [DEBUG] ReferenceTransformer: "github_repository.example" references: []
2026-04-20T15:39:22.054-0400 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/integrations/github\"]" references: []
2026-04-20T15:39:22.055-0400 [DEBUG] Starting graph walk: walkValidate
2026-04-20T15:39:22.060-0400 [DEBUG] created provider logger: level=debug
2026-04-20T15:39:22.060-0400 [INFO]  provider: configuring client automatic mTLS
2026-04-20T15:39:22.063-0400 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/integrations/github/6.11.1/darwin_arm64/terraform-provider-github_v6.11.1 args=[".terraform/providers/registry.terraform.io/integrations/github/6.11.1/darwin_arm64/terraform-provider-github_v6.11.1"]
2026-04-20T15:39:22.065-0400 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/integrations/github/6.11.1/darwin_arm64/terraform-provider-github_v6.11.1 pid=43435
2026-04-20T15:39:22.065-0400 [DEBUG] provider: waiting for RPC address: plugin=.terraform/providers/registry.terraform.io/integrations/github/6.11.1/darwin_arm64/terraform-provider-github_v6.11.1
2026-04-20T15:39:22.085-0400 [INFO]  provider.terraform-provider-github_v6.11.1: configuring server automatic mTLS: timestamp=2026-04-20T15:39:22.082-0400
2026-04-20T15:39:22.092-0400 [DEBUG] provider: using plugin: version=5
2026-04-20T15:39:22.092-0400 [DEBUG] provider.terraform-provider-github_v6.11.1: plugin address: address=/var/folders/13/c2qxdjqn0pq84mrb5jjjnxbh0000gq/T/plugin2473637218 network=unix timestamp=2026-04-20T15:39:22.092-0400
2026-04-20T15:39:22.105-0400 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2026-04-20T15:39:22.106-0400 [INFO]  provider: plugin process exited: plugin=.terraform/providers/registry.terraform.io/integrations/github/6.11.1/darwin_arm64/terraform-provider-github_v6.11.1 id=43435
2026-04-20T15:39:22.110-0400 [DEBUG] provider: plugin exited
2026-04-20T15:39:22.110-0400 [INFO]  backend/local: apply calling Plan
2026-04-20T15:39:22.110-0400 [DEBUG] Building and walking plan graph for NormalMode
2026-04-20T15:39:22.111-0400 [DEBUG] ProviderTransformer: "github_repository.example (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/integrations/github"]
2026-04-20T15:39:22.112-0400 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/integrations/github\"]" references: []
2026-04-20T15:39:22.112-0400 [DEBUG] ReferenceTransformer: "github_repository.example (expand)" references: []
2026-04-20T15:39:22.112-0400 [DEBUG] Starting graph walk: walkPlan
2026-04-20T15:39:22.115-0400 [DEBUG] created provider logger: level=debug
2026-04-20T15:39:22.115-0400 [INFO]  provider: configuring client automatic mTLS
2026-04-20T15:39:22.118-0400 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/integrations/github/6.11.1/darwin_arm64/terraform-provider-github_v6.11.1 args=[".terraform/providers/registry.terraform.io/integrations/github/6.11.1/darwin_arm64/terraform-provider-github_v6.11.1"]
2026-04-20T15:39:22.120-0400 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/integrations/github/6.11.1/darwin_arm64/terraform-provider-github_v6.11.1 pid=43436
2026-04-20T15:39:22.120-0400 [DEBUG] provider: waiting for RPC address: plugin=.terraform/providers/registry.terraform.io/integrations/github/6.11.1/darwin_arm64/terraform-provider-github_v6.11.1
2026-04-20T15:39:22.150-0400 [INFO]  provider.terraform-provider-github_v6.11.1: configuring server automatic mTLS: timestamp=2026-04-20T15:39:22.149-0400
2026-04-20T15:39:22.157-0400 [DEBUG] provider: using plugin: version=5
2026-04-20T15:39:22.157-0400 [DEBUG] provider.terraform-provider-github_v6.11.1: plugin address: address=/var/folders/13/c2qxdjqn0pq84mrb5jjjnxbh0000gq/T/plugin2292164545 network=unix timestamp=2026-04-20T15:39:22.157-0400
2026-04-20T15:39:22.164-0400 [WARN]  ValidateProviderConfig from "provider[\"registry.terraform.io/integrations/github\"]" changed the config value, but that value is unused
2026-04-20T15:39:22.164-0400 [INFO]  provider.terraform-provider-github_v6.11.1: 2026/04/20 15:39:22 [INFO] Selecting owner  from GITHUB_OWNER environment variable: timestamp=2026-04-20T15:39:22.164-0400
2026-04-20T15:39:22.164-0400 [INFO]  provider.terraform-provider-github_v6.11.1: 2026/04/20 15:39:22 [INFO] No token found, using GitHub CLI to get token from hostname api.github.com: timestamp=2026-04-20T15:39:22.164-0400
2026-04-20T15:39:22.355-0400 [INFO]  provider.terraform-provider-github_v6.11.1: 2026/04/20 15:39:22 [INFO] Using the token from GitHub CLI: timestamp=2026-04-20T15:39:22.355-0400
2026-04-20T15:39:22.355-0400 [INFO]  provider.terraform-provider-github_v6.11.1: 2026/04/20 15:39:22 [INFO] Setting write_delay_ms to 1000: timestamp=2026-04-20T15:39:22.355-0400
2026-04-20T15:39:22.355-0400 [INFO]  provider.terraform-provider-github_v6.11.1: 2026/04/20 15:39:22 [DEBUG] Setting read_delay_ms to 0: timestamp=2026-04-20T15:39:22.355-0400
2026-04-20T15:39:22.355-0400 [INFO]  provider.terraform-provider-github_v6.11.1: 2026/04/20 15:39:22 [DEBUG] Setting retry_delay_ms to 0: timestamp=2026-04-20T15:39:22.355-0400
2026-04-20T15:39:22.355-0400 [INFO]  provider.terraform-provider-github_v6.11.1: 2026/04/20 15:39:22 [DEBUG] Setting max_retries to 3: timestamp=2026-04-20T15:39:22.355-0400
2026-04-20T15:39:22.355-0400 [INFO]  provider.terraform-provider-github_v6.11.1: 2026/04/20 15:39:22 [DEBUG] Setting retriableErrors to map[500:true 502:true 503:true 504:true]: timestamp=2026-04-20T15:39:22.355-0400
2026-04-20T15:39:22.355-0400 [INFO]  provider.terraform-provider-github_v6.11.1: 2026/04/20 15:39:22 [DEBUG] Setting max_per_page to 100: timestamp=2026-04-20T15:39:22.355-0400
2026-04-20T15:39:22.355-0400 [INFO]  provider.terraform-provider-github_v6.11.1: 2026/04/20 15:39:22 [DEBUG] Setting parallel_requests to false: timestamp=2026-04-20T15:39:22.355-0400
2026-04-20T15:39:22.559-0400 [DEBUG] Resource instance state not found for node "github_repository.example", instance github_repository.example
2026-04-20T15:39:22.559-0400 [DEBUG] ReferenceTransformer: "github_repository.example" references: []
2026-04-20T15:39:22.560-0400 [DEBUG] refresh: github_repository.example: no state, so not refreshing
2026-04-20T15:39:22.570-0400 [WARN]  Provider "registry.terraform.io/integrations/github" produced an invalid plan for github_repository.example, but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .allow_rebase_merge: planned value cty.True for a non-computed attribute
      - .allow_squash_merge: planned value cty.True for a non-computed attribute
      - .merge_commit_title: planned value cty.StringVal("MERGE_MESSAGE") for a non-computed attribute
      - .squash_merge_commit_title: planned value cty.StringVal("COMMIT_OR_PR_TITLE") for a non-computed attribute
      - .web_commit_signoff_required: planned value cty.False for a non-computed attribute
      - .archived: planned value cty.False for a non-computed attribute
      - .squash_merge_commit_message: planned value cty.StringVal("COMMIT_MESSAGES") for a non-computed attribute
      - .delete_branch_on_merge: planned value cty.False for a non-computed attribute
      - .merge_commit_message: planned value cty.StringVal("PR_TITLE") for a non-computed attribute
      - .allow_merge_commit: planned value cty.True for a non-computed attribute
      - .ignore_vulnerability_alerts_during_read: planned value cty.False for a non-computed attribute
      - .allow_auto_merge: planned value cty.False for a non-computed attribute
      - .security_and_analysis: attribute representing nested block must not be unknown itself; set nested attribute values to unknown instead
2026-04-20T15:39:22.573-0400 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2026-04-20T15:39:22.576-0400 [INFO]  provider: plugin process exited: plugin=.terraform/providers/registry.terraform.io/integrations/github/6.11.1/darwin_arm64/terraform-provider-github_v6.11.1 id=43436
2026-04-20T15:39:22.582-0400 [DEBUG] provider: plugin exited
2026-04-20T15:39:22.583-0400 [DEBUG] building apply graph to check for errors
2026-04-20T15:39:22.583-0400 [DEBUG] Resource state not found for node "github_repository.example", instance github_repository.example
2026-04-20T15:39:22.583-0400 [DEBUG] ProviderTransformer: "github_repository.example" (*terraform.NodeApplyableResourceInstance) needs provider["registry.terraform.io/integrations/github"]
2026-04-20T15:39:22.584-0400 [DEBUG] ProviderTransformer: "github_repository.example (expand)" (*terraform.nodeExpandApplyableResource) needs provider["registry.terraform.io/integrations/github"]
2026-04-20T15:39:22.584-0400 [DEBUG] ReferenceTransformer: "github_repository.example (expand)" references: []
2026-04-20T15:39:22.584-0400 [DEBUG] ReferenceTransformer: "github_repository.example" references: []
2026-04-20T15:39:22.584-0400 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/integrations/github\"]" references: []

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  �[32m+�[0m create�[0m

Terraform will perform the following actions:

�[1m  # github_repository.example�[0m will be created
�[0m  �[32m+�[0m�[0m resource "github_repository" "example" {
      �[32m+�[0m�[0m allow_auto_merge                        = false
      �[32m+�[0m�[0m allow_forking                           = (known after apply)
      �[32m+�[0m�[0m allow_merge_commit                      = true
      �[32m+�[0m�[0m allow_rebase_merge                      = true
      �[32m+�[0m�[0m allow_squash_merge                      = true
      �[32m+�[0m�[0m archived                                = false
      �[32m+�[0m�[0m default_branch                          = (known after apply)
      �[32m+�[0m�[0m delete_branch_on_merge                  = false
      �[32m+�[0m�[0m description                             = "An example repository created with Terraform"
      �[32m+�[0m�[0m etag                                    = (known after apply)
      �[32m+�[0m�[0m fork                                    = (known after apply)
      �[32m+�[0m�[0m full_name                               = (known after apply)
      �[32m+�[0m�[0m git_clone_url                           = (known after apply)
      �[32m+�[0m�[0m html_url                                = (known after apply)
      �[32m+�[0m�[0m http_clone_url                          = (known after apply)
      �[32m+�[0m�[0m id                                      = (known after apply)
      �[32m+�[0m�[0m ignore_vulnerability_alerts_during_read = false
      �[32m+�[0m�[0m merge_commit_message                    = "PR_TITLE"
      �[32m+�[0m�[0m merge_commit_title                      = "MERGE_MESSAGE"
      �[32m+�[0m�[0m name                                    = "example-repository"
      �[32m+�[0m�[0m node_id                                 = (known after apply)
      �[32m+�[0m�[0m primary_language                        = (known after apply)
      �[32m+�[0m�[0m private                                 = (known after apply)
      �[32m+�[0m�[0m repo_id                                 = (known after apply)
      �[32m+�[0m�[0m source_owner                            = (known after apply)
      �[32m+�[0m�[0m source_repo                             = (known after apply)
      �[32m+�[0m�[0m squash_merge_commit_message             = "COMMIT_MESSAGES"
      �[32m+�[0m�[0m squash_merge_commit_title               = "COMMIT_OR_PR_TITLE"
      �[32m+�[0m�[0m ssh_clone_url                           = (known after apply)
      �[32m+�[0m�[0m svn_url                                 = (known after apply)
      �[32m+�[0m�[0m topics                                  = (known after apply)
      �[32m+�[0m�[0m visibility                              = "private"
      �[32m+�[0m�[0m vulnerability_alerts                    = (known after apply)
      �[32m+�[0m�[0m web_commit_signoff_required             = false

      �[32m+�[0m�[0m security_and_analysis (known after apply)
    }

�[1mPlan:�[0m 1 to add, 0 to change, 0 to destroy.
�[0m2026-04-20T15:39:22.587-0400 [INFO]  backend/local: apply calling Apply
2026-04-20T15:39:22.587-0400 [DEBUG] Building and walking apply graph for NormalMode plan
2026-04-20T15:39:22.587-0400 [DEBUG] Resource state not found for node "github_repository.example", instance github_repository.example
2026-04-20T15:39:22.588-0400 [DEBUG] ProviderTransformer: "github_repository.example (expand)" (*terraform.nodeExpandApplyableResource) needs provider["registry.terraform.io/integrations/github"]
2026-04-20T15:39:22.588-0400 [DEBUG] ProviderTransformer: "github_repository.example" (*terraform.NodeApplyableResourceInstance) needs provider["registry.terraform.io/integrations/github"]
2026-04-20T15:39:22.588-0400 [DEBUG] ReferenceTransformer: "github_repository.example" references: []
2026-04-20T15:39:22.588-0400 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/integrations/github\"]" references: []
2026-04-20T15:39:22.588-0400 [DEBUG] ReferenceTransformer: "github_repository.example (expand)" references: []
2026-04-20T15:39:22.588-0400 [DEBUG] Starting graph walk: walkApply
2026-04-20T15:39:22.589-0400 [DEBUG] created provider logger: level=debug
2026-04-20T15:39:22.589-0400 [INFO]  provider: configuring client automatic mTLS
2026-04-20T15:39:22.594-0400 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/integrations/github/6.11.1/darwin_arm64/terraform-provider-github_v6.11.1 args=[".terraform/providers/registry.terraform.io/integrations/github/6.11.1/darwin_arm64/terraform-provider-github_v6.11.1"]
2026-04-20T15:39:22.597-0400 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/integrations/github/6.11.1/darwin_arm64/terraform-provider-github_v6.11.1 pid=43439
2026-04-20T15:39:22.598-0400 [DEBUG] provider: waiting for RPC address: plugin=.terraform/providers/registry.terraform.io/integrations/github/6.11.1/darwin_arm64/terraform-provider-github_v6.11.1
2026-04-20T15:39:22.659-0400 [INFO]  provider.terraform-provider-github_v6.11.1: configuring server automatic mTLS: timestamp=2026-04-20T15:39:22.658-0400
2026-04-20T15:39:22.668-0400 [DEBUG] provider: using plugin: version=5
2026-04-20T15:39:22.668-0400 [DEBUG] provider.terraform-provider-github_v6.11.1: plugin address: address=/var/folders/13/c2qxdjqn0pq84mrb5jjjnxbh0000gq/T/plugin713205873 network=unix timestamp=2026-04-20T15:39:22.668-0400
2026-04-20T15:39:22.676-0400 [WARN]  ValidateProviderConfig from "provider[\"registry.terraform.io/integrations/github\"]" changed the config value, but that value is unused
2026-04-20T15:39:22.677-0400 [INFO]  provider.terraform-provider-github_v6.11.1: 2026/04/20 15:39:22 [INFO] Selecting owner  from GITHUB_OWNER environment variable: timestamp=2026-04-20T15:39:22.677-0400
2026-04-20T15:39:22.677-0400 [INFO]  provider.terraform-provider-github_v6.11.1: 2026/04/20 15:39:22 [INFO] No token found, using GitHub CLI to get token from hostname api.github.com: timestamp=2026-04-20T15:39:22.677-0400
2026-04-20T15:39:22.775-0400 [INFO]  provider.terraform-provider-github_v6.11.1: 2026/04/20 15:39:22 [INFO] Using the token from GitHub CLI: timestamp=2026-04-20T15:39:22.775-0400
2026-04-20T15:39:22.776-0400 [INFO]  provider.terraform-provider-github_v6.11.1: 2026/04/20 15:39:22 [INFO] Setting write_delay_ms to 1000: timestamp=2026-04-20T15:39:22.775-0400
2026-04-20T15:39:22.776-0400 [INFO]  provider.terraform-provider-github_v6.11.1: 2026/04/20 15:39:22 [DEBUG] Setting read_delay_ms to 0: timestamp=2026-04-20T15:39:22.776-0400
2026-04-20T15:39:22.776-0400 [INFO]  provider.terraform-provider-github_v6.11.1: 2026/04/20 15:39:22 [DEBUG] Setting retry_delay_ms to 0: timestamp=2026-04-20T15:39:22.776-0400
2026-04-20T15:39:22.776-0400 [INFO]  provider.terraform-provider-github_v6.11.1: 2026/04/20 15:39:22 [DEBUG] Setting max_retries to 3: timestamp=2026-04-20T15:39:22.776-0400
2026-04-20T15:39:22.776-0400 [INFO]  provider.terraform-provider-github_v6.11.1: 2026/04/20 15:39:22 [DEBUG] Setting retriableErrors to map[500:true 502:true 503:true 504:true]: timestamp=2026-04-20T15:39:22.776-0400
2026-04-20T15:39:22.776-0400 [INFO]  provider.terraform-provider-github_v6.11.1: 2026/04/20 15:39:22 [DEBUG] Setting max_per_page to 100: timestamp=2026-04-20T15:39:22.776-0400
2026-04-20T15:39:22.776-0400 [INFO]  provider.terraform-provider-github_v6.11.1: 2026/04/20 15:39:22 [DEBUG] Setting parallel_requests to false: timestamp=2026-04-20T15:39:22.776-0400
2026-04-20T15:39:23.004-0400 [WARN]  Provider "registry.terraform.io/integrations/github" produced an invalid plan for github_repository.example, but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .allow_squash_merge: planned value cty.True for a non-computed attribute
      - .merge_commit_title: planned value cty.StringVal("MERGE_MESSAGE") for a non-computed attribute
      - .squash_merge_commit_title: planned value cty.StringVal("COMMIT_OR_PR_TITLE") for a non-computed attribute
      - .web_commit_signoff_required: planned value cty.False for a non-computed attribute
      - .archived: planned value cty.False for a non-computed attribute
      - .squash_merge_commit_message: planned value cty.StringVal("COMMIT_MESSAGES") for a non-computed attribute
      - .delete_branch_on_merge: planned value cty.False for a non-computed attribute
      - .merge_commit_message: planned value cty.StringVal("PR_TITLE") for a non-computed attribute
      - .allow_merge_commit: planned value cty.True for a non-computed attribute
      - .ignore_vulnerability_alerts_during_read: planned value cty.False for a non-computed attribute
      - .allow_auto_merge: planned value cty.False for a non-computed attribute
      - .allow_rebase_merge: planned value cty.True for a non-computed attribute
      - .security_and_analysis: attribute representing nested block must not be unknown itself; set nested attribute values to unknown instead
�[0m�[1mgithub_repository.example: Creating...�[0m�[0m
2026-04-20T15:39:23.005-0400 [INFO]  Starting apply for github_repository.example
2026-04-20T15:39:23.005-0400 [DEBUG] github_repository.example: applying the planned Create change
2026-04-20T15:39:23.006-0400 [INFO]  provider.terraform-provider-github_v6.11.1: 2026/04/20 15:39:23 [DEBUG] setting computed for "topics" from ComputedKeys: timestamp=2026-04-20T15:39:23.006-0400
2026-04-20T15:39:23.007-0400 [INFO]  provider.terraform-provider-github_v6.11.1: 2026/04/20 15:39:23 [DEBUG] setting computed for "security_and_analysis" from ComputedKeys: timestamp=2026-04-20T15:39:23.007-0400
2026-04-20T15:39:23.007-0400 [DEBUG] provider.terraform-provider-github_v6.11.1: Sending HTTP Request: Content-Length=623 tf_http_req_body="{\"name\":\"example-repository\",\"description\":\"An example repository created with Terraform\",\"homepage\":\"\",\"visibility\":\"private\",\"has_issues\":false,\"has_projects\":false,\"has_wiki\":false,\"has_discussions\":false,\"is_template\":false,\"auto_init\":false,\"gitignore_template\":\"\",\"license_template\":\"\",\"allow_squash_merge\":true,\"allow_merge_commit\":true,\"allow_rebase_merge\":true,\"allow_update_branch\":false,\"allow_auto_merge\":false,\"delete_branch_on_merge\":false,\"squash_merge_commit_title\":\"COMMIT_OR_PR_TITLE\",\"squash_merge_commit_message\":\"COMMIT_MESSAGES\",\"merge_commit_title\":\"MERGE_MESSAGE\",\"merge_commit_message\":\"PR_TITLE\"}" tf_provider_addr=provider tf_resource_type=github_repository tf_rpc=ApplyResourceChange @module=provider Accept-Encoding=gzip User-Agent=go-github/v82.0.0 tf_http_op_type=request tf_http_req_version=HTTP/1.1 Content-Type=application/json Host=api.github.com tf_http_req_uri=/user/repos tf_http_trans_id=e7200c4f-81d7-0a44-6299-ea15750f9f1b @caller=github.com/hashicorp/terraform-plugin-sdk/v2@v2.38.1/helper/logging/logging_http_transport.go:162 Accept="application/vnd.github.baptiste-preview+json, application/vnd.github.nebula-preview+json,application/vnd.github.stone-crop-preview+json" X-Github-Api-Version=2022-11-28 tf_http_req_method=POST tf_req_id=b32a5f9b-635e-19a5-a8ff-710f140df053 timestamp=2026-04-20T15:39:23.007-0400
2026-04-20T15:39:23.118-0400 [DEBUG] provider.terraform-provider-github_v6.11.1: Received HTTP Response: Content-Length=206 X-Ratelimit-Reset=1776716550 X-Ratelimit-Resource=core tf_resource_type=github_repository X-Oauth-Client-Id=178c6fc778ccc68e1d6a Link="<https://docs.github.com/en/rest/about-the-rest-api/api-versions>; rel=\"deprecation\"; type=\"text/html\"" Strict-Transport-Security="max-age=31536000; includeSubdomains; preload" Sunset="Fri, 10 Mar 2028 00:00:00 GMT" X-Frame-Options=deny X-Github-Request-Id=ED3D:1F25D2:15985BC:561115E:69E680EB Access-Control-Expose-Headers="ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" Content-Security-Policy="default-src 'none'" Content-Type="application/json; charset=utf-8" X-Accepted-Oauth-Scopes="public_repo, repo" X-Ratelimit-Remaining=4984 tf_http_res_version=HTTP/2.0 tf_http_res_body="{\"message\":\"Public repositories are not permitted for Enterprise Managed Users.\",\"documentation_url\":\"https://docs.github.com/rest/repos/repos#create-a-repository-for-the-authenticated-user\",\"status\":\"422\"}" tf_provider_addr=provider Server=github.com Vary="Accept-Encoding, Accept, X-Requested-With" X-Oauth-Scopes="delete_repo, gist, read:org, repo, workflow" X-Ratelimit-Limit=5000 X-Xss-Protection=0 tf_http_trans_id=e7200c4f-81d7-0a44-6299-ea15750f9f1b Access-Control-Allow-Origin="*" Referrer-Policy="origin-when-cross-origin, strict-origin-when-cross-origin" X-Github-Media-Type="github.v3; param=baptiste-preview.nebula-preview.stone-crop-preview; format=json" tf_http_op_type=response @module=provider Date="Mon, 20 Apr 2026 19:39:23 GMT" X-Github-Api-Version-Selected=2022-11-28 tf_http_res_status_code=422 tf_req_id=b32a5f9b-635e-19a5-a8ff-710f140df053 tf_rpc=ApplyResourceChange @caller=github.com/hashicorp/terraform-plugin-sdk/v2@v2.38.1/helper/logging/logging_http_transport.go:162 Deprecation="Tue, 10 Mar 2026 00:00:00 GMT" X-Content-Type-Options=nosniff X-Ratelimit-Used=16 tf_http_res_status_reason="422 Unprocessable Entity" timestamp=2026-04-20T15:39:23.117-0400
2026-04-20T15:39:23.118-0400 [ERROR] provider.terraform-provider-github_v6.11.1: Response contains error diagnostic: diagnostic_severity=ERROR diagnostic_summary="POST https://api.github.com/user/repos: 422 Public repositories are not permitted for Enterprise Managed Users. []" tf_proto_version=5.10 tf_resource_type=github_repository tf_rpc=ApplyResourceChange @caller=github.com/hashicorp/terraform-plugin-go@v0.29.0/tfprotov5/internal/diag/diagnostics.go:58 diagnostic_detail="" tf_provider_addr=provider tf_req_id=b32a5f9b-635e-19a5-a8ff-710f140df053 @module=sdk.proto timestamp=2026-04-20T15:39:23.118-0400
2026-04-20T15:39:23.126-0400 [DEBUG] State storage *statemgr.Filesystem declined to persist a state snapshot
2026-04-20T15:39:23.126-0400 [ERROR] vertex "github_repository.example" error: POST https://api.github.com/user/repos: 422 Public repositories are not permitted for Enterprise Managed Users. []
�[31m╷�[0m�[0m
�[31m│�[0m �[0m�[1m�[31mError: �[0m�[0m�[1mPOST https://api.github.com/user/repos: 422 Public repositories are not permitted for Enterprise Managed Users. []�[0m
�[31m│�[0m �[0m
�[31m│�[0m �[0m�[0m  with github_repository.example,
�[31m│�[0m �[0m  on main.tf line 15, in resource "github_repository" "example":
�[31m│�[0m �[0m  15: resource "github_repository" "example" �[4m{�[0m�[0m
�[31m│�[0m �[0m
�[31m╵�[0m�[0m
2026-04-20T15:39:23.141-0400 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2026-04-20T15:39:23.144-0400 [INFO]  provider: plugin process exited: plugin=.terraform/providers/registry.terraform.io/integrations/github/6.11.1/darwin_arm64/terraform-provider-github_v6.11.1 id=43439
2026-04-20T15:39:23.149-0400 [DEBUG] provider: plugin exited

Panic Output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: TriageThis is being looked at and prioritizedType: BugSomething isn't working as documented

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions