Unable to run init after botched version upgrade [SOLVED]


we’re using terraform along with terragrunt with AWS and S3 to store our remote state. I’ve inherited the terraform codebase from a former colleague, and the update process from 0.12.17 to 0.14.5 had been completely botched before I inherited the code. So now, we have resources created with different terraform versions.

I have a terragrunt.hcl file where the source refers to a tagged module, and the module with the given tag has required_version = 0.12.17". So, my first attempt was to run init with terraform version 0.12.17:

Error: Initialization required. Please see the error message above.

Failed to load state: state snapshot was created by Terraform v0.13.1, which is newer than current v0.12.17; upgrade to Terraform v0.13.1 or greater to work with this state

This is surprising, because when I inspect the terraform.tfstate file from the S3 bucket, it says: "terraform_version": "0.12.17"

My next attempt to run init with terraform version 0.13.1 also failed with this error message:

Error: Initialization required. Please see the error message above.

Notice that this is the only error message, there is no “error message above”.

I’m not sure how to continue from here, because the error messages don’t give out much information. I appreciate any advice!

I figured it out myself: The terragrunt.hcl file had a few dependencies, and those dependencies had their state in version 0.13.1.
Since I just need to destroy the resources created by this terragrunt.hcl file, I guess I can simply remove the dependencies and just copy-paste the ARNs.