-
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
[ERROR] <<resource>>: eval: *terraform.EvalForgetResourceState, err: orphan resource <<resource>> still has a non-empty state after apply; this is a bug in Terraform #21559
Comments
Hi! Thank you for reporting this issue, and I am sorry that you've experienced it. It will help if we can see your configuration files (including modules), or a simplified reproduction case, to figure out what's going on here. The error states that there is a reference to an undeclared module so it would be good to see your module layout and config: https://gist.github.com/andresvia/b4127a773f804737f85ab20c23e4aefc#file-gistfile1-txt-L2442
🤔 I'd also like to see the output from your Thanks again! |
@mildwonkey thanks for taking a look. I'm sorry I've been a little busy, I'll provide plan trace and some stripped down version of the configuration ASAIC. |
@mildwonkey I'm sorry It took me some time to re-build a repro that failed in the same way. But it was actually easier than try to clean up all the sensitive information from a trace. To repro:
I've highlighted the part that is weird here: https://gist.github.com/andresvia/7ee8813d4f1df942bb21a9386b457888#file-main-tf-L20 Because just by commenting that line everything works. BTW
I guess I'll try with 0.12.1 |
I can confirm that the error persist on 0.12.1. |
I have just verified that this is still an issue in 0.12.4:
When my team ran into this we transitioned from using three aws_subnet blocks to one with a count. For some reason, the second subnet was orphaned during this transition. ¯\_(ツ)_/¯ Here is a code snippet of how we ran into this if that helps: Old code:
New code:
What I did to get around this was to ensure that the resources provisioned were manually deleted then I carefully edited my remote state (after backing it up). Super sloppy I know, but I couldn't figure out a way to gracefully reconcile this. 😕 EDIT: I also realize that the new |
Experienced such issue with: hashicorp/terraform-provider-aws#11024 |
Error still present on 0.12.12 with Google Provider 2.19 orphan resource google_compute_instance_template.<...> still has a non-empty state after apply; this is a bug in Terraform |
0.12.4 Not sure how to fix this. Found this thread. |
@eddideku I outlined how I was able to work around this by editing my remote state, maybe you could do something similar, but I would recommend doing the following rather than manually editing your state yourself:
|
We just ran into this same problem with version 0.12.12, and had to use terraform state rm to fix it like @unacceptable suggested above. We now upgraded to version 0.12.18, in hope of that keeping this problem from returning. |
we have the same issue on terraform v. 0.12.19 and aws provider v. 2.43.0 |
upgraded to terraform v0.12.19 and aws provider v2.44.0 And now every apply throws this error, which fails every CI/CD pipeline we have when deploying terraform changes.
And we tried deleting that resource, but that resource persists. |
hello, this issue also we are experiencing with terraform v0.12.19 and provider.aws v2.41.0 |
Facing the same issue with |
Same issue here as well since I updated terraform to 12.19 |
I was previously getting this issue: #23821 Then I updated to 0.12.20 and started getting these which I assume are more refined errors for the same issue. provider.aws is 2.48.0 |
I'd like to add that after Also, you can run |
Looks like the issue has gone in a 0.12.21 version. |
Experienced this issue with Terraform v0.12.24. The 3 issues that were affected were two |
@andresilva I ran this against 0.12.0 exactly as you described, and I am able to reproduce the issue. I really appreciate the work you put into making your reproduction case. When I try to reproduce it against 0.12.26, I run into an error:
To get around this,I have copied your reproduction case to https://github.com/danieldreier/terraform-issue-reproductions/tree/master/21559, commented out This issue has enough upvotes that I believe it's real - at least was in a previous version - but this particular reproduction case no longer works for 0.12.26. If you, or anyone else on here can make a PR against https://github.com/danieldreier/terraform-issue-reproductions/tree/master/21559 to show a reproduction of this problem that works on 0.12.26 or 0.13.0, I would very much appreciate it. Without a reproduction case, there really isn't any way to fix this. |
For the record, I believe @danieldreier meant to tag @andresvia 😉 |
@danieldreier -- Sorry, I didn't realize my comment would drop the waiting-response label. Reapply? |
@andresvia thanks for your PR there. I appreciate the clarification. I am definitely able to reproduce this on 0.12.0 exactly as reported. On 0.12.26 this appears to have been fixed. If nobody here can provide a reproduction that causes this issue on 0.12.26 or on an 0.13.0 beta, I think we need to consider this fixed. I'll leave this open for a bit in case someone is able to contribute a reproduction that happens on current TF versions. |
@danieldreier Having Based on comments some folks are affected, but is difficult for me to figure it out why, they may have not upgraded to latest 0.12.x and at the same time they may be sourcing some external module with the Or maybe the issue is reflecting another deeper problem. Thanks! |
Thanks for clarifying, @andresvia (and sorry for tagging the wrong person earlier!) I'm going to consider this resolved. I agree that it was odd to have type in output in the first place. |
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
https://gist.github.com/andresvia/b4127a773f804737f85ab20c23e4aefc
Crash Output
Expected Behavior
Plan is applied.
Actual Behavior
Steps to Reproduce
Additional Context
source
for thelive
module is remote (git
),uw2
,core
andconfig
are "local" (filesystem
) modules.References
The text was updated successfully, but these errors were encountered: