Repository navigation
Closed as not planned
Labels
Status: StaleUsed by stalebot to clean houseType: BugSomething isn't working as documentedgithub_enterpriser/repository
Description
Terraform Version
$ terraform -v
Terraform v0.14.5
+ provider registry.terraform.io/integrations/github v4.5.0
Your version of Terraform is out of date! The latest version
is 0.14.7. You can update by downloading from https://www.terraform.io/downloads.html
Affected Resource(s)
github_repository
Terraform Configuration Files
../../modules/tf-repo/main.tf (pseudo code):
resource "github_repository" "this" {
name = var.name
description = var.description
...
vulnerability_alerts = null
}.terraform.lock.hcl:
# This file is maintained automatically by "terraform init".
# Manual edits may be lost in future updates.
provider "registry.terraform.io/integrations/github" {
version = "4.5.0"
constraints = "4.5.0"
hashes = [
"h1:KjMtn8N07rakB/oAwEFlmDd6YhJ5fentdjpF7A0fB3c=",
"zh:22cb80695782a750ab8dd61357ed92a3ec3260b3cad15b3ed5cbb5371d1190eb",
"zh:290b3d2b50df075835ff5dba2d02bf834576c9bb20555f715863c68e5ba2b482",
"zh:31a0f119c5f384771706ddfb89f51c6a66ede1eab0091b19b39de5686c6189d3",
"zh:393d3f4010c564aa0828082ec64ca014122cbb798fa28a2219d457e37378e300",
"zh:4e278b74977c7b2eb5805ad549692970fd06546bf92c44d40991d73bc6107221",
"zh:5762e3b7b23ae10537054513aadcc4ac6abc30a5e38464d15267510564e2ebb4",
"zh:6fbf45fdb7c8246caccbf2988f7fa0a20a8c8a7bb660a9740d0f5345da5d024f",
"zh:7f920eac133683763806ecafca2ac8916883368157ad5d1fef4266383ae5170b",
"zh:c4d812f681f8b842c709deca79b44965a7688da96a1a0437c1d605135d9ea510",
"zh:c928cb0ef5f2cae8e3e2c4253275ba9708003f768eed878debf7addd38127297",
"zh:ce4064e833a4d26a7b9d46e438484a9fd1e28f15f3fc7b64b8cd6d39970a875e",
]
}
Debug Output
Panic Output
Expected Behavior
If the GHE instance doesn't support vulnerability-alerts end-point and vulnerability_alerts = null or vulnerability_alerts = false then the provider should not panic when 404 is returned by the API.
Actual Behavior
- repository got created
- error thrown
Error: DELETE https://<BASE URL>.io/api/v3/repos/<ORG NAME>/<REPO NAME>/vulnerability-alerts: 404 Not Found [] on ../../modules/tf-repo/main.tf line 1, in resource "github_repository" "this": 1: resource "github_repository" "this" { - other resources from the module were not created
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply
Important Factoids
References
Reacted by Ben Abrams, Gyorgy Hrabovszki, UncleIS, Alexander Geeraerts, Jeremy Barber, r-bennett, Andrew Kielbasinski, henrytk, Shamil Nunhuck, Josh Myers and 1 more
Metadata
Metadata
Assignees
Labels
Status: StaleUsed by stalebot to clean houseType: BugSomething isn't working as documentedgithub_enterpriser/repository
Activity
czerasz commentedon Mar 2, 2021
Workaround after failed
apply:remove
github_repositoryresource from state:terraform state rm 'module.this["<REPO NAME>"].github_repository.this'import
github_repositoryresource:alxzndr commentedon Mar 14, 2021
I have the same issue. Thanks for posting a workaround.
edit: workaround is not working for me, i cannot import the repo (it does exist in github..)
r-bennett commentedon Mar 26, 2021
This endpoint is actually documented as being available in GHES 2.22, but we ran into the same thing and have confirmed with GitHub support that this is an error in the documentation.
Looks like this is probably means there's a missing test-case from the GHES compatibility tests from #404 as well. It's a slightly weird one in how it crops up as the defaults are different for public and private repos, but I believe running a refresh on a repository resource will always trigger it.
#444 was the change which introduced this, so another workaround is to use
3.0.0or earlierjeffeland commentedon May 7, 2021
The workaround to use the version 3.0.0 from the provider doesn't seem to be available anymore and even the most recent version of the github enterprise doesn't support this feature yet. Any plan for a fix?
colltoaction commentedon Jun 30, 2021
Seeing the same behavior. Workaround worked:
joshmyers commentedon Jul 8, 2021
This is a massive pain and not a great workaround. Any plans for fix?
jeffyaw commentedon Oct 3, 2021
this was the fix for me, similar to @colltoaction, but with the resource name instead of the repo name in the first 2 spots.
github-actions commentedon Dec 4, 2022
👋 Hey Friends, this issue has been automatically marked as
stalebecause it has no recent activity. It will be closed if no further activity occurs. Please add theStatus: Pinnedlabel if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!Danielku15 commentedon Aug 31, 2023
this bug is quite a pain, it prevents proper creation of new repositories via terraform. The workarounds are merely a "recovery" measure not something that gets the provider running.
In our case this also leads to subsequent errors. where autolink references are only partially created. Any references created before this error are there, any references created afterwards are reported as:
github-actions commentedon May 28, 2024
👋 Hey Friends, this issue has been automatically marked as
stalebecause it has no recent activity. It will be closed if no further activity occurs. Please add theStatus: Pinnedlabel if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!