Terraform refresh followed by terraform plan claimed repo needed to be created from scratch. #630
Labels
r/repository
Status: Stale
Used by stalebot to clean house
Type: Bug
Something isn't working as documented
Terraform Version
terraform -v
Terraform v0.14.2
Affected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
Debug Output
Please provide a link to a GitHub Gist containing the complete debug output: https://www.terraform.io/docs/internals/debugging.html. Please do NOT paste the debug output in the issue; just paste a link to the Gist.
Expected Behavior
What should have happened?
Actual Behavior
Please list the steps required to reproduce the issue, for example:
I needed to update the local Terraform variable to reflect the state of the world in Github.
I did
terraform refresh -target=module.repos.github_repository.ops-kube-synthetic
The next time I did
terraform plan -refresh=true
it said the entireops-kube-synthetic
repository needed to be created from scratch.I thought the state might have gotten corrupted so I did
terraform import module.repos.github_repository.ops-kube-synthetic ops-kube-synthetic
to unstick it.Unfortunately I got
Error: Cannot import non-existent remote object
repeatedlyI confirmed repeatedly the Github repository did in fact exist.
I eventually manually fired up my Python3 terminal, instantiated a Github client with
PyGithub
, manually iterated over the set of repos to confirm theops-kube-synthetic
repo existed (it did).I hit the up arrow on my terminal and re-ran the exact same
import
commandIt worked!
The subsequent plan worked.
I suspect the Github API is to blame here but am unsure. This has happened just twice in the past three months, but it's incredibly annoying when it does. Advice would be appreciated.
Important Factoids
Is there anything atypical about your accounts that we should know? For example: Running in EC2 Classic? Custom version of OpenStack? Tight ACLs?
References
Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:
The text was updated successfully, but these errors were encountered: