-
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 0.12 Crash running apply after upgrade #21396
Comments
Sorry for this crash @bhawk123, and thanks for reporting it. Stack trace for this crash:
This seems to be in the plan rendering codepath, checking if a resource instance object is tainted: terraform/backend/local/backend_plan.go Lines 260 to 267 in c7c69a5
My guess, given this context, is that the existing state contains a resource instance that currently has only deposed objects, and not a "current" object. This logic is assuming (incorrectly) that any instance that appears in the plan will have a current object. I think there's another related inaccuracy here, thinking through what this code is attempting to do: the resource instance change we're rendering might itself have a I think something like this would get the desired effect here (just off the top of my head, not tested at all yet): // check if the change is due to a tainted resource
tainted := false
if !state.Empty() {
if is := state.ResourceInstance(rcs.Addr); is != nil {
if obj := is.GetGeneration(rcs.DeposedKey.Generation()); os != nil {
tainted = obj.Status == states.ObjectTainted
}
}
} |
Also getting this issue. Weirdly enough, I have 4 instances of the same code (each with different parameters, but overall the same structure should be in all of them) and only one of them crashes |
I think the trigger for this crash would be something in the latest Terraform state snapshot, rather than something in the configuration itself: if a previous Terraform version left a "deposed" instance in the state (can result in case of a catastrophic failure during a We had expected that running We do intend to fix this, probably by doing something similar to what I mentioned in my earlier comment (since the existing logic is not totally correct anyway) but in the mean time it may be possible to work around this by making sure |
@apparentlymart I already downgraded the problematic folder back to 0.11, and applied the changes I had pending. |
@apparentlymart the workaround doesn't work for me. |
@apparentlymart
|
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. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
crash.log.zip
The text was updated successfully, but these errors were encountered: