-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
Cannot remove modules from state. Error: leftover module #23859
Comments
If you run into this problem you can fix manually the state file following this steps:
|
I've started seeing this in any workspace that upgrades to Terraform v0.12.19 :S |
#23822 appears to fix this issue (haven't verified myself) and was merged after v0.12.19, so I imagine it will appear in v0.12.20. |
Hello! 🤖 Duplicate of #23821 |
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
Expected Behavior
Terraform should delete module resources and remove them from state.
Actual Behavior
Terraform deletes the resources but leaves the state file with information about the deleted modules. This causes CI systems to break.
Error: leftover module module.security_group_example_http.module.sg in state that should have been removed; this is a bug in Terraform and should be reported
Steps to Reproduce
terraform init
terraform apply
terraform apply
Additional Context
I did the same steps using version v0.12.18 and it works as expected.
References
The issue #22579 states that "-target" should be used in the "apply" to reproduce but it seems that it's a bigger problem now.
The text was updated successfully, but these errors were encountered: