Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP 422 due to invalid API request payload #185

Closed
mattburgess opened this issue Feb 8, 2019 · 2 comments
Closed

HTTP 422 due to invalid API request payload #185

mattburgess opened this issue Feb 8, 2019 · 2 comments
Labels
Type: Bug Something isn't working as documented Upstream

Comments

@mattburgess
Copy link

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.

@mattburgess
Copy link
Author

Looks like this is an issue with the vendored go-github library. google/go-github#1014 fixed by google/go-github@02e358b. I'll see if I can get a simple PR together that simply bumps that dependency to a recent version.

@radeksimko radeksimko added Type: Bug Something isn't working as documented Upstream labels Feb 21, 2019
@paultyng paultyng closed this as completed May 2, 2019
@paultyng
Copy link
Contributor

paultyng commented May 2, 2019

2.0.0 has been released with an update for the vendored SDK that should address this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working as documented Upstream
Projects
None yet
Development

No branches or pull requests

3 participants