Skip to content
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 taint does not respect required_version #26325

Closed
stellirin opened this issue Sep 22, 2020 · 2 comments · Fixed by #26345
Closed

Terraform taint does not respect required_version #26325

stellirin opened this issue Sep 22, 2020 · 2 comments · Fixed by #26345
Labels
bug explained a Terraform Core team member has described the root cause of this issue in code

Comments

@stellirin
Copy link

Terraform Version

Terraform v0.13.3
+ provider registry.terraform.io/hashicorp/external v1.2.0
+ provider registry.terraform.io/hashicorp/google v3.39.0
+ provider registry.terraform.io/hashicorp/google-beta v3.39.0
+ provider registry.terraform.io/hashicorp/http v1.2.0
+ provider registry.terraform.io/hashicorp/kubernetes v1.13.2
+ provider registry.terraform.io/hashicorp/local v1.4.0
+ provider registry.terraform.io/hashicorp/null v2.1.2
+ provider registry.terraform.io/hashicorp/random v2.3.0
+ provider registry.terraform.io/hashicorp/template v2.1.2
+ provider registry.terraform.io/hashicorp/tls v2.2.0
+ provider registry.terraform.io/hashicorp/vault v2.14.0

Terraform Configuration Files

N/A

Debug Output

N/A

Crash Output

N/A

Expected Behaviour

terraform taint my.special.resource should respect the required_version in versions.tf and not proceed if there is a mismatch, similar to terraform apply.

Actual Behaviour

We have required_version = "0.13.2" set, but Terraform v0.13.3 happily tainted the state and set a new minimal version in the state.

Steps to Reproduce

Run terraform taint my.special.resource with v0.13.3 on a state file from v0.13.2.

Additional Context

We use Homebrew as a makeshift package manager due to inadequacies in macOS. It is easy to 'accidentally' upgrade packages with no easy way to roll back to an older version when the upgrade is discovered. Therefore we set a fixed Terraform version to prevent accidental upgrades of the state file.

Terraform was upgraded on my machine. terraform taint was able to taint my state file without issue. The subsequent terraform apply immediately failed because the Terraform version did not match the value in required_version. After downgrading, terraform apply failed again because the state file was set with a higher Terraform version.

References

@stellirin stellirin added bug new new issue not yet triaged labels Sep 22, 2020
@alisdair
Copy link
Contributor

Thanks for reporting this, @stellirin! I've confirmed the bug exists on 0.13 and 0.14.

@alisdair alisdair added confirmed a Terraform Core team member has reproduced this issue explained a Terraform Core team member has described the root cause of this issue in code and removed new new issue not yet triaged confirmed a Terraform Core team member has reproduced this issue labels Sep 22, 2020
@ghost
Copy link

ghost commented Oct 25, 2020

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.

@ghost ghost locked as resolved and limited conversation to collaborators Oct 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug explained a Terraform Core team member has described the root cause of this issue in code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants