Terraform Error: Error acquiring the state lock (ConditionalCheckFailedException)

A previous apply crashed or another CI job is actively holding the S3/DynamoDB lock.

Runs locally in browser Free · No login Independently Verified 2026-11-25 v4.1.0
Identifier: Terraform Error Platform: DevOps
Common Root Causes:
  • A previous apply crashed or another CI job is actively holding the S3/DynamoDB lock.

Interactive Diagnostic Checklist

Verified Solutions:
  1. Confirm no active apply exists before running `terraform force-unlock <LOCK_ID>`.
Safe Diagnostic Command:
Verify no running CI pipeline holds the Lock ID
Warning: Verify configuration changes in staging or with dry-run flags (e.g. nginx -t) before reloading production services.

Technical Explanation

A previous apply crashed or another CI job is actively holding the S3/DynamoDB lock. Recommended diagnostic: `Verify no running CI pipeline holds the Lock ID`. Remediation: Confirm no active apply exists before running `terraform force-unlock <LOCK_ID>`.

Worked Examples

  • Run `Verify no running CI pipeline holds the Lock ID` to verify root cause before applying the remediation.

Limitations & Assumptions

  • Always verify configuration changes in staging or with dry-run flags (e.g. `nginx -t`) before reloading production services.

Source References & Verification

Resource ID: err-tf-error-acquiring-state-lock · Independently verified: 2026-11-25

Related Resources