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

**Code:** `Error acquiring the state lock` · **Category:** Terraform · **Seen on:** Terraform

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

## 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?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/terraform/error-acquiring-the-state-lock)
