{
  "id": "terraform/terraform-state-lock-unlock-failed",
  "signature": "Error: Error acquiring the state lock: ConditionalCheckFailedException: The conditional request failed: The conditional request failed",
  "signature_zh": "错误：获取状态锁失败：条件检查异常：条件请求失败",
  "regex": "Error acquiring the state lock: ConditionalCheckFailedException",
  "domain": "terraform",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "Another Terraform process holds the state lock, or a previous lock was not released properly.",
  "root_cause_type": "generic",
  "root_cause_zh": "另一个 Terraform 进程持有状态锁，或之前的锁未正确释放。",
  "versions": [
    {
      "version": "Terraform v1.6",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Terraform v1.7",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Terraform v1.8",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "AWS Provider v5.0+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Deleting the lock file can corrupt state if another process is still running, leading to state conflicts.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Using a wrong lock ID will not release the lock, and may cause additional errors if the lock is actually held by a different process.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The lock may still be held by the previous process, and restarting will not release it automatically.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Force unlock the state using 'terraform force-unlock <lock_id>' after verifying no other Terraform process is running. First, run 'terraform plan' to see if the lock is stale.",
      "success_rate": 0.8,
      "how": "Force unlock the state using 'terraform force-unlock <lock_id>' after verifying no other Terraform process is running. First, run 'terraform plan' to see if the lock is stale.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If using S3 backend, manually delete the lock file from the DynamoDB table using AWS CLI: 'aws dynamodb delete-item --table-name <table-name> --key {\"LockID\":{\"S\":\"<lock-id>\"}}'",
      "success_rate": 0.9,
      "how": "If using S3 backend, manually delete the lock file from the DynamoDB table using AWS CLI: 'aws dynamodb delete-item --table-name <table-name> --key {\"LockID\":{\"S\":\"<lock-id>\"}}'",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Force unlock the state using 'terraform force-unlock <lock_id>' after verifying no other Terraform process is running. First, run 'terraform plan' to see if the lock is stale.",
    "If using S3 backend, manually delete the lock file from the DynamoDB table using AWS CLI: 'aws dynamodb delete-item --table-name <table-name> --key {\"LockID\":{\"S\":\"<lock-id>\"}}'"
  ],
  "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": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-08-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}