← All free tools

Terraform state lock troubleshooter

Paste the 'Error acquiring the state lock' message from Terraform or OpenTofu. Get the lock ID, who holds the lock and for how long, the exact unlock command, and a checklist for unlocking safely. Nothing you paste leaves your browser.

Runs in your browser, nothing is uploaded

The message never leaves your browser. Do not paste secrets, but the lock message itself is safe to paste.

What this lock is

Paste an error to start

Before you unlock

    How to use the Terraform state lock troubleshooter

    1. Run terraform plan or apply and copy the whole "Error acquiring the state lock" message, including the Lock Info block.
    2. Paste it into the box. The tool pulls out the lock ID, who holds it, the operation and how old the lock is.
    3. Work through the checklist, confirm no run is active, then run the force-unlock command shown.

    Example: a lock left by a killed CI job

    A pipeline was cancelled halfway through a plan. The next run fails with a lock held by a runner, taken 3 hours ago, operation plan. The tool shows the lock ID and the command, and the checklist says a stale plan lock is low risk.

    If the same lock came from an apply, the tool tells you to run a plan after unlocking and look for resources the state does not know about.

    Common questions

    Is it safe to run terraform force-unlock?

    It is safe when no run is still using the state. Check your CI and your team first, because unlocking during a live apply can corrupt the state.

    What if force-unlock says the lock does not exist?

    Make sure you run it in the same directory and with the same backend configuration. If the lock is a DynamoDB item or an S3 .tflock file you can remove it by hand in AWS.

    Does this work for OpenTofu?

    Yes. OpenTofu prints the same lock message and has the same force-unlock command.

    Read next: Unlock Terraform state and recover it

    Want the real numbers for your AWS account?

    Send me your setup and I will return a written list of savings and security fixes, safest first. It is free.