-
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
Running an empty destroy with an interpolated output in module fails #17862
Comments
@apparentlymart FYI |
Have the same issue on v0.11.5:
Error occurs during destroy If apply was failed.
but it doesn't work with |
Cool, after couple of hours I found the workaround: Inspired by #16681 (comment) We don't need several So it works:
Don't forget to fix references to this resources in another places in my case from |
I'm seeing this as well on 0.11.7 with:
In my case the initial destroy failed after actually deleting everything; I'm left with an empty state file but every destroy fails with these errors for interpolated outputs:
|
@jantman have you tried |
+1 for fixing this issue. If a single issue occurs during our delete process our environment is left in a half destroyed yet undestroyable state. The |
The TF_WARN_OUTPUT_ERRORS variable does not see to work with 0.11.8 on Linux 64 bit Please refer this link as well |
I just found another use case related to that:
I'm getting:
The issue was there for a while preventing implementing integration testing with |
Hey @llibicpep, If you would like to open an issue against Kitchen-Terraform, we may be able to identity a workflow or configuration to avoid your particular problem. |
We have the same problem with Terraform v0.11.8 on Linux 64bit. The output looks a little bit different:
With TF_WARN_OUTPUT_ERRORS=1, the problem disappears but it should not happen in the first place IMHO. |
Hello, Any updates on this bug? It's quite a problem to not be able to destroy resources |
This is still a problem with variables: $ TF_WARN_OUTPUT_ERRORS=1 terraform destroy --auto-approve
Error: Error applying plan:
1 error(s) occurred:
* module.dcos.local.cluster_name: local.cluster_name: variable "id" is nil, but no error was reported |
@bernadinm I overcame a very similar sounding problem in 0.11 using this approach: locals {
result = {
command = ""
}
kubeadm_join_results = "${concat(data.external.kubeadm_join.*.result, list(local.result))}"
kubeadm_join_command = "${lookup(local.kubeadm_join_results["0"], "command", "")}"
}
output "kubeadm_join_command" {
depends_on = ["null_resource.masters_provisioner"]
value = "${local.kubeadm_join_command}"
} Full description here: https://groups.google.com/d/msg/terraform-tool/y9H4rAVOcLA/G5iftvErBwAJ |
Hello! 🤖 This issue relates to an older version of Terraform that is no longer in active development, and because the area of Terraform it relates to has changed significantly since the issue was opened we suspect that the issue is either fixed or that the circumstances around it have changed enough that we'd need an updated issue report in order to reproduce and address it. If you're still seeing this or a similar issue in the latest version of Terraform, please do feel free to open a new bug report! Please be sure to include all of the information requested in the template, even if it might seem redundant with the information already shared in this issue, because the internal details relating to this problem are likely to be different in the current version of Terraform. Thanks! |
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. |
Seems like another scenario when TF fail to run destroy. Reproducible on empty setup even without creating resources.
Since it's reproducible without provider credentials, is it possible to add tests?
#17768 fixed code but didn't add any tests
Community Note
Note: this block was copy-pasted from terraform-provider-aws
Terraform Version
Terraform Configuration Files
main.tf
cluster/cluster-main.tf
Debug Output
https://gist.github.com/dvishniakov/58ab1fef3126665d85c63f13803b3b05
Expected Behavior
No error output, successful output, exit with code 0
Actual Behavior
Error: Error applying plan:
TF 0.11.4, 0.11.5,
3 error(s) occurred:
TF 0.11.6, 0.11.7
2 error(s) occurred:
Steps to Reproduce
terraform init
terraform plan -input=false --destroy -out=terraform.plan
terraform apply -input=false terraform.plan
References
#17691, probably partially fixed by @jbardin in #17768
The text was updated successfully, but these errors were encountered: