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

"Error releasing the state lock!". Executing force-unlock is impossible as no lock id is provided. #19296

Closed
Lasering opened this issue Nov 6, 2018 · 2 comments

Comments

@Lasering
Copy link

Lasering commented Nov 6, 2018

Terraform Version

Terraform v0.11.10

Terraform Configuration Files

terraform {
    backend "consul" {
      address = "my.address.local"
      scheme = "https"
      datacenter = "datacenter1"
      access_token = "${random_uuid.consul-terraform-state-token.result}"
      path = "a/path/to/the/state"
      gzip = true
    }
  }

Actual Behavior

While running terraform apply I sometimes get:

Error releasing the state lock!

Error message: consul lock was lost

Terraform acquires a lock when accessing your state to prevent others
running Terraform to potentially modify the state at the same time. An
error occurred while releasing this lock. This could mean that the lock
did or did not release properly. If the lock didn't release properly,
Terraform may not be able to run future commands since it'll appear as if
the lock is held.

In this scenario, please call the "force-unlock" command to unlock the
state manually. This is a very dangerous operation since if it is done
erroneously it could result in two people modifying state at the same time.
Only call this command if you're certain that the unlock above failed and
that no one else is holding a lock.

I would like to execute the force-unlock but to do that I need a lock id, which in this scenario seems impossible to acquire.

References

#14312
#17535

@remilapeyre
Copy link
Contributor

Hi @Lasering, thanks for reporting the issue.

The lock ID is now given when Terraform fails to acquire the lock. There is however an issue when running terraform force-unlock $ID that is tracked in #22174 and should be fixed by #25837.

I think we can close this issue as it is no longer relevant, feel free to open it again to give more information if you think I'm missing something.

@ghost
Copy link

ghost commented Sep 13, 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 and limited conversation to collaborators Sep 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants