_This issue was originally opened by @KevinCSI as hashicorp/terraform#16024. It was migrated here as a result of the provider split. The original body of the issue is below._
Hi there,
I was trying to destroy a cluster that contained an instance based off of a (now) deleted ami, but Terraform is unable to pass the refresh phase. It failed due to not being able to locate the ami in question (query failed, see below for details in Steps to Reproduce).
Terraform v0.10.3
Cluster should destroy successfully
What actually happened?
terraform failed during the refresh phase
Please list the full steps required to reproduce the issue, for example:
Your query returned no results. Please change your search criteria and try againI would suggest disabling the -refresh phase using the appropriate flag
https://www.terraform.io/docs/commands/plan.html#refresh-true
Adding -refresh=true to terraform plan command didn't help. I'm using Terraform v0.11.11 from the Docker container.
$ terraform plan -refresh=true
X: Refreshing state...
Y: Refreshing state...
...
Releasing state lock. This may take a few moments...
2019/03/19 02:29:24 [DEBUG] plugin: waiting for all plugin processes to complete...
Error: Error refreshing state: 4 error(s) occurred:
* data.aws_ami.bastion: 1 error(s) occurred:
* data.aws_ami.bastion: data.aws_ami.bastion: Your query returned no results. Please change your search criteria and try again.
* data.aws_ami.base-linux: 1 error(s) occurred:
* data.aws_ami.base-linux: data.aws_ami.base-linux: Your query returned no results. Please change your search criteria and try again.
* data.aws_ami.jenkins-master: 1 error(s) occurred:
* data.aws_ami.jenkins-master: data.aws_ami.jenkins-master: Your query returned no results. Please change your search criteria and try again.
* data.aws_ami.jenkins-docker-slave: 1 error(s) occurred:
* data.aws_ami.jenkins-docker-slave: data.aws_ami.jenkins-docker-slave: Your query returned no results. Please change your search criteria and try again.
Yes, terraform destroy -refresh=false destroyed the infra.
This appears to be resolved, so closing this issue. 👍
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!
Most helpful comment
Yes,
terraform destroy -refresh=falsedestroyed the infra.