Skip to content

terraform force-unlock: Failed to load state:remote workspace Terraform version "0.13.5" does not match local Terraform version "0.15.4" #28853

@ecerulm

Description

@ecerulm

Terraform Version

Terraform v0.15.4
on darwin_amd64
+ provider registry.terraform.io/hashicorp/aws v3.42.0
+ provider registry.terraform.io/hashicorp/helm v2.1.2
+ provider registry.terraform.io/hashicorp/kubernetes v2.2.0

Terraform Configuration Files

...

Debug Output

Crash Output

Expected Behavior

terraform force-unlock xxxx should just unlock the state. Or at least tell me exactly which remote state is the offending one as I can think of several

  • The backend "remote" that hold the state of this terraform configuration
  • Any of the 5 data "terraform_remote_state" "xxx" that are used in this terraform configuration (I checked in Terraform Cloud and they are have "terraform_version": "0.15.4",

Actual Behavior

terraform force-unlock xxxxxx seems to remove the lock, but immediatelly after terraform fails with

 Failed to load state: Remote workspace Terraform version "0.13.5" does not match local Terraform version "0.15.4"

leaving the state locked again (with a new lock ID)

Steps to Reproduce

I'm not sure how I landed in this state

Additional Context

I tried to

terraform apply -refresh-only -lock=false
terraform force-unlock 85f52642-4dc4-379f-8031-a286b7db6aa9

but I still get the `Failed to load state: Remote workspace Terraform version "0.13.5" does not match local Terraform version "0.15.4"

At this point all the remote workspaces referenced in the terraform configuration are already on 0.15.4 (both the backend "remote" and the 5 data "terraform_remote_state "xxx") , I've checke on Terraform Cloud and all of them have "terraform_version": "0.15.4",

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions