Home›Guides›Stuck state lock

A state lock is stuck: when and how to use force-unlock

When a run crashes or a CI job is killed, the state lock can stay behind and block every later plan. force-unlock removes it — but only use it when you are sure nothing is running.

The command

tofu force-unlock LOCK_ID

The lock ID is shown in the error message of the blocked run. -force skips the confirmation prompt.

What the docs say it does — and doesn't

Before you run it

The checks above are our practice, not part of the official docs. If locks get stuck often, the real fix is to run applies only from CI.

Examples use OpenTofu (tofu); in Terraform the commands start with terraform. Check the documentation for your version before relying on a feature.

Locks keep getting stuck?We do this as a fixed-price job.OpenTofu pipelines in GitLab →

Book a 30-minute call

Tell us what you are trying to fix. No preparation needed.

Book a 30-minute call