Error acquiring the state lock 🟪 Terraform

Terraform: Error: Error acquiring the state lock — ConditionalCheckFailedException / state blob is already locked

Another Terraform run holds the state lock, or a previous run crashed and left the lock behind.

Seen on: Terraform

Meaning

Remote backends (S3+DynamoDB, Azure blob, GCS, Terraform Cloud) lock state during plan/apply. Concurrent pipelines or killed runs leave stale locks; the error shows the Lock ID and who holds it.

Common causes

  • Another plan/apply running (CI + local)
  • Previous run killed (Ctrl+C, runner timeout)
  • Pipeline concurrency without serialization

⚡ Quick fix

  1. Wait for the other run to finish
  2. force-unlock only when sure nothing is running
  3. Serialize pipeline runs per workspace

Detailed fix by platform

Shell

  1. terraform force-unlock 6f2a1c9d-xxxx-xxxx-xxxx-1a2b3c4d5e6f

How to diagnose

  1. Lock — Who/when (Info in the error)
  2. Runs — Anything still running?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.