{
  "id": "cicd/terraform-state-lock-error",
  "signature": "Error: Error acquiring the state lock: ConditionalCheckFailedException: The conditional request failed",
  "signature_zh": "错误：获取状态锁时出错：ConditionalCheckFailedException：条件请求失败",
  "regex": "Error acquiring the state lock.*ConditionalCheckFailedException",
  "domain": "cicd",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "Terraform failed to acquire the state lock in DynamoDB because another process holds the lock, or the lock item has been modified by a concurrent operation.",
  "root_cause_type": "generic",
  "root_cause_zh": "Terraform 无法获取 DynamoDB 中的状态锁，因为另一个进程持有锁，或者锁项已被并发操作修改。",
  "versions": [
    {
      "version": "Terraform 1.5.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "AWS Provider 5.10.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "DynamoDB",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Force-unlocking without verifying who holds the lock can corrupt state or cause data loss.",
      "fail_rate": 0.3,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Deleting the DynamoDB lock table removes all locks but also breaks state locking for future operations.",
      "fail_rate": 0.1,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Identify the lock holder by checking DynamoDB table: aws dynamodb get-item --table-name <lock_table> --key '{\"LockID\": {\"S\": \"<state_path>\"}}'. If the lock is stale, use terraform force-unlock <lock_id> after manual verification.",
      "success_rate": 0.95,
      "how": "Identify the lock holder by checking DynamoDB table: aws dynamodb get-item --table-name <lock_table> --key '{\"LockID\": {\"S\": \"<state_path>\"}}'. If the lock is stale, use terraform force-unlock <lock_id> after manual verification.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If the lock is held by a crashed process, wait for the lock timeout (default 15 minutes) and retry, or increase the lock timeout in the backend config.",
      "success_rate": 0.8,
      "how": "If the lock is held by a crashed process, wait for the lock timeout (default 15 minutes) and retry, or increase the lock timeout in the backend config.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Identify the lock holder by checking DynamoDB table: aws dynamodb get-item --table-name <lock_table> --key '{\"LockID\": {\"S\": \"<state_path>\"}}'. If the lock is stale, use terraform force-unlock <lock_id> after manual verification.",
    "If the lock is held by a crashed process, wait for the lock timeout (default 15 minutes) and retry, or increase the lock timeout in the backend config."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://developer.hashicorp.com/terraform/language/state/locking",
  "official_doc_section": null,
  "error_code": "ConditionalCheckFailedException",
  "verification_tier": "ai_generated",
  "confidence": 0.9,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2023-09-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}