`terraform force-unlock` returns `Failed to unlock state: lock ID "..." does not match existing lock`.
BeginnerTroubleshootingState Locking and Backend Errors
Answer
Likely causes → You copied an old lock ID; the original lock was already released and a new run has taken a fresh lock; or you are pointed at a different workspace/key.
Diagnose → Re-run terraform plan to see the current Lock Info, and check terraform workspace show and the backend key.
Fix → Use the ID from the latest error message. If the new lock belongs to an active run, do not unlock it.
Prevent → Treat force-unlock as a manual, logged action. Paste the exact Lock Info into the incident/PR before unlocking.
More on State Locking and Backend Errors
`terraform plan` fails with `Error acquiring the state lock` and `ConditionalCheckFailedException: The conditional request failed`.BeginnerWith the S3 backend and `use_lockfile = true`, you get `Error acquiring the state lock` with `StatusCode: 412` and `PreconditionFailed`.IntermediateA teammate ran `terraform apply -lock=false` "because the lock was stuck". Now the plan shows resources you never touched being recreated.Advanced`terraform init` fails with `Error: Backend configuration changed`.Beginner`terraform init -migrate-state` asks `Do you want to copy existing state to the new backend?` and the new backend already has a state. What is the danger?Intermediate`Error: Backend initialization required, please run "terraform init"` with `Reason: Initial configuration of the requested backend "s3"`.Beginner