Skip to content
RTFE_
Error library
TerraformTerraformKnown error

Error acquiring the state lock

Someone else holds the state lock

Terraform state locking

What the error looks like

  • Error code
  • WHO โ€” identity
  • WHAT โ€” action
  • WHERE โ€” scope
  • Policy
  • Correlation / trace
โ”‚ Error: Error acquiring the state lockCODE
โ”‚
โ”‚ Error message: state blob is already locked
โ”‚ Lock Info:
โ”‚   ID:        9f8e7d6c-0000-4000-8000-000000000009TRACE
โ”‚   Path:      tfstate/platform.tfstate
โ”‚   Operation: OperationTypeApply
โ”‚   Who:       runner@agent-07
โ”‚   Version:   1.8.5
โ”‚   Created:   2026-03-14 08:41:02 UTC
โ”‚
โ”‚ Terraform acquires a state lock to protect the state from being written
โ”‚ by multiple users at the same time.

What you told me

โ€œTerraform is stuck.โ€

you ยท just now

Let's read it.

RTFE ยท seen

What it actually says

Another run holds the lease on the state blob in the Azure Storage backend. The lock info tells you who and when.

Azure outage? No. Locking is working. That's the point.

The fix

  1. 01Read 'Who' and 'Created'. Check whether that run is still active.
  2. 02If it is, wait.
  3. 03Only if you're certain nothing is running, force-unlock with the lock ID.

Force-unlocking while another run is still applying can corrupt your state. Confirm first.

Terraform
terraform force-unlock <LOCK_ID>

Read it faster next time

The lock ID and the culprit are both in the error. Ask 'Who' before you force anything.

Further reading

Open Microsoft Learn

Related errors