-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
0.7.0 regression: "unknown variable accessed" in destroy #7378
Comments
Looks like it's this commit 559f017 |
Without any idea of what this does, this seems to 'fix' this particular issue: Not sure what right looks like though. |
closed via #7496 |
Frustratingly, while #7496 does appear to fix the minimized reproduction I posted above, it doesn't fix the actual bug I was seeing in our actual TF setup. (I have been trying to add full end to end testing with an entirely clean test environment to our system and so have been stress testing things like creating new environments and destroying them on these prereleases.) Will try to minimize again. |
@jbardin I've pushed another commit to https://github.com/glasser/terraform-destroy-bug Running terraform at 4c602d1 (which includes #7496), my original reproduction passes, but my newer reproduction does not pass, with a similar error:
The change I made to my reproduction was to replace the null_resource with a template_file that actually uses the var, and to add another template_file to the bottom module. (I don't think template_file specifically is relevant here; my actual configuration uses datadog_monitor.) Please reopen this bug, or I can file a new one. |
Hi @glasser, thanks for the update. I'll reopen this one since it's appears to still be the same issue. |
The report in #7378 led us into a deep rabbit hole that turned out to expose a bug in the graph walk implementation being used by the `NoopTransformer`. The problem ended up being when two nodes in a single dependency chain both reported `Noop() -> true` and needed to be removed. This was breaking the walk and preventing the second node from ever being visited. Fixes #7378
dag: fix ReverseDepthFirstWalk when nodes remove themselves
Great, this fixes not only my minimized reproduction but my real use case as well! |
I'm getting this error now trying to migrate my codebase to 0.7. |
Hi @eyalzek - sorry to hear that! Can you file a fresh issue with a bit more detail about your environment? Then we can dig in and hopefully get it sorted for v0.7.1. |
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. |
Terraform Version
I can reproduce this with today's HEAD (ebb9b7a) and with 0.7.0-rc2. The issue does not occur with 0.6.16: this is a 0.7.0 regression.
Affected Resource(s)
Seems like core.
Terraform Configuration Files
You can get this by
git clone https://github.com/glasser/terraform-destroy-bug
and here is the code inline:Steps to Reproduce
terraform get
terraform apply
terraform destroy -force
Expected Behavior
This should create and destroy the single
null_resource
.Actual Behavior
The
destroy -force
fails with:It does not matter which of the three modules contains the
null_resource
(and the issue is not specific tonull_resource
); it just appears that the configuration must contain at least one resource somewhere for the bug to be triggered.Debug Output
TF_LOG=DEBUG
: https://gist.github.com/glasser/9ad8b72709072ceddae2ae44111c9a94TF_LOG=TRACE
: https://gist.github.com/glasser/e830d64ec640c80b63c0614cc4123406References
This seems similar to #7131 (fixed by @phinze and reviewed by @jen20); however, the fix there does not fix this situation. (I think we were also encountering whatever #7131 fixed in our stack, as upgrading to get that fix did reduce the number of errors of this form that we saw, but not entirely.)
The text was updated successfully, but these errors were encountered: