-
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 destroy fails when Terraform apply failed #23886
Comments
Hi @varmax2511, There have been numerous fixes since the Thanks! |
Hi @jbardin -- this is an intermittent issue and we are working on reproducing it. Meanwhile, below is the state file for the compute instance at the time of failure of destroy job
State of the
|
This issue is also associated with an issue that was reported to support in ZenDesk, so the terraform core team is going to let support handle triage and reproduction and escalate it to engineering through the internal escalation process because support is already working with them on this. |
The failure here is during the refresh walk, which is partially driven by the configuration. Because data sources need to be fully re-evaluated during refresh, the entire config is loaded. Problems arise when the managed resource instances in the config do not match what is in the state. This leads to the situation where expressions from numerous places could require evaluating non-existent resource instances. This class of issue is going to require refactoring the refresh cycle, probably consisting of the changes laid out in #17034. Closing this one as a duplicate of #21096 to consolidate the discussion. |
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
Terraform Configuration Files
Debug Output
Crash Output
Error: Invalid index
in resource "oci_core_volume" "block":
availability_domain = oci_core_instance. test_instance[each.value.instance_name].availability_domain
|----------------
| each.value.instance_name is "jump"
| oci_core_instance.test_instance is object with no attributes
The given key does not identify an element in this collection value.
Expected Behavior
Even though the apply failed, the destroy operation should have succeeded
Actual Behavior
When Apply failed at provisioning the instance (instance got in state Terminating from Provisioning, TF destroy also failed
Steps to Reproduce
Run Terraform apply
if apply fails
run TF destroy
Additional Context
References
The text was updated successfully, but these errors were encountered: