-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Terraform crashing on terraform show -json plan.cache
#28903
Comments
Just guessing, if the code works with all versions pre-0.15.4 then breaks on 0.15.4, it's probably because of the changes outside of terraform functionality that was introduced in https://github.com/hashicorp/terraform/releases/tag/v0.15.4 is part of the plan file (#28803 (comment)). This might be something where the |
Hi @davidalger, Thanks for filing the issue. The crash itself is relatively easy to fix, but I'm more interested in how you got to the state that managed to cause it. I don't have any ideas yet, other than I'm guessing it's related to deposed instances. Could you share the human-readable output from |
Ah, looking at it again, I see how you may have gotten here. It must be a deposed instance that no longer exists, resulting in a NoOp change, which is not accounted for in the json output logic. |
@jbardin Thanks for jumping on this. I've downloaded the Terraform binary artifact from Circle CI to test against the environments where this occurred, and the crash does in fact appear to be resolved on both environments where it was occurring. The plan is successfully rendered in JSON format, including a couple deposed no-op resources as you had figured were there. As for how these no-op deposed resources got in there, I'm not 100% sure, but very likely related to some hiccups we had with GKE node pool creation not too long ago where the node pools got into a bizarre state from which the Google provider couldn't recover because it couldn't tear down the deposed node pools due to them being in some odd infinite auto-healing loop when they were created due to an issue GCP was having. After finally getting them deleted manually, which got Terraform unstuck, they created just fine the following morning…and apparently left behind the no-op deposed resources which are now (it seems) forever present in the state file since they have become no-ops. Anyways, thanks again, and we look forward to 1.0.1 being released with the fix for this. Cheers! |
Thanks for the follow up @davidalger! The resources should get removed from the state, even though the end up being a no-op in the plan. Let me verify that however, as I've seen a few cases where deposed resources seem to be reported far more often than one would expect. |
I think this issue should be re-opened this also happened on a project in our infrastructure that was upgrade to v0.15. Someone made a change directly on an S3 bucket.
|
Thanks @rrijkse, but I'm not sure I understand. Are you saying that you can still replicate the above crash when testing with a build from the current v1.0 or main branch? |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Terraform Version
Terraform Configuration Files
...
Debug Output
Crash Output
https://gist.github.com/davidalger/2de8d19baf24901aaef670326cd856e1
Expected Behavior
Plans should be printed.
Actual Behavior
Terraform crashes.
Steps to Reproduce
terraform init
terraform plan -out plan.cache
terraform show -json plan.cache
Additional Context
Running
terraform show plan.cache
works whileterraform show -json plan.cache
crashes, due to the error seemingly being found buried in the JSON marshaling. This only occurs on 2 of dozens of Terraform pipelines (locally and in CI).The code works with both 0.14.11 and 0.15.3, breaks in 0.15.4 and 0.15.5 as well as 1.0.0. The architecture doesn't matter, it's broken both on
linux_amd64
anddarwin_amd64
I can attempt to create an isolated reproduce case if need be, but may not be easy since it occurs on only two of our pipelines and I have no idea what triggers it.
References
The text was updated successfully, but these errors were encountered: