Skip to content

HTTP 422 due to invalid API request payload #185

Closed
@mattburgess

Description

@mattburgess

Terraform Version

$ terraform -v
Terraform v0.11.11
+ provider.github v1.3.0

Affected Resource(s)

At least github_repository, but probably more

Terraform Configuration Files

resource "github_repository" "matts-test-repo" {
  name        = "matts-test-repo"
  description = "Just a test"

  allow_merge_commit = false
}

Expected Behavior

The repository should have been created

Actual Behavior

I got the following error:


1 error(s) occurred:

* github_repository.matts-test-repo: 1 error(s) occurred:

* github_repository.matts-test-repo: POST https://github.internal/api/v3/orgs/myorg/repos: 422 Invalid request.

"archived" is not a permitted key. []

Steps to Reproduce

  1. terraform apply

Important Factoids

This was run against a GitHub Enterprise instance that was previously working. It recently got upgraded to v1.16.1 and since then has been failing. It turns out this is a known issue (see the bottom bullet point of https://enterprise.github.com/releases/2.16.1/notes) due to the stricter API checks carried out in that release. Whilst it could be argues this is a problem with GitHub Enterprise, because they shouldn't have broken the behaviour like that, it sounds like that breakage is going to happen at some point, so the Terraform provider could do with updating to avoid issues in the future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: BugSomething isn't working as documentedUpstream

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions