{
  "id": "terraform/state-lock-dynamodb-throughput-exceeded",
  "signature": "Error: Error acquiring the state lock: ConditionalCheckFailedException: The conditional request failed: ProvisionedThroughputExceededException",
  "signature_zh": "错误：获取状态锁时出错：ConditionalCheckFailedException：条件请求失败：ProvisionedThroughputExceededException",
  "regex": "Error acquiring the state lock: ConditionalCheckFailedException: The conditional request failed: ProvisionedThroughputExceededException",
  "domain": "terraform",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "The DynamoDB table used for state locking has insufficient read/write capacity units to handle the concurrent lock requests, causing throttling.",
  "root_cause_type": "generic",
  "root_cause_zh": "用于状态锁定的 DynamoDB 表的读写容量单位不足，无法处理并发锁定请求，导致节流。",
  "versions": [
    {
      "version": "Terraform v1.5",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "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": "AWS SDK v1.44",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Increasing DynamoDB table read capacity units without increasing write capacity",
      "why_fails": "State locking uses write operations (PutItem, DeleteItem) for lock acquisition and release; increasing only read capacity doesn't help with throttled writes.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Switching to a different DynamoDB table with same capacity settings",
      "why_fails": "The issue is capacity, not table identity; any table with low capacity will throttle under high concurrency.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "Adding a delay in CI/CD pipeline but not using exponential backoff",
      "why_fails": "Fixed delays are ineffective because concurrent lock attempts can still cluster; Terraform's default retry uses exponential backoff, but if capacity is too low, all retries fail.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Increase DynamoDB table provisioned capacity: `aws dynamodb update-table --table-name terraform-locks --provisioned-throughput ReadCapacityUnits=10,WriteCapacityUnits=10` or switch to on-demand billing mode.",
      "success_rate": 0.95,
      "how": "Increase DynamoDB table provisioned capacity: `aws dynamodb update-table --table-name terraform-locks --provisioned-throughput ReadCapacityUnits=10,WriteCapacityUnits=10` or switch to on-demand billing mode.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Implement a retry with jitter in your CI/CD script: `for i in 1 2 3 4 5; do terraform apply && break || sleep $((RANDOM % 10 + 5)); done`",
      "success_rate": 0.7,
      "how": "Implement a retry with jitter in your CI/CD script: `for i in 1 2 3 4 5; do terraform apply && break || sleep $((RANDOM % 10 + 5)); done`",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use `terraform apply -lock=false` to bypass locking entirely (only for non-critical environments, as it risks state corruption).",
      "success_rate": 0.6,
      "how": "Use `terraform apply -lock=false` to bypass locking entirely (only for non-critical environments, as it risks state corruption).",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Increase DynamoDB table provisioned capacity: `aws dynamodb update-table --table-name terraform-locks --provisioned-throughput ReadCapacityUnits=10,WriteCapacityUnits=10` or switch to on-demand billing mode.",
    "Implement a retry with jitter in your CI/CD script: `for i in 1 2 3 4 5; do terraform apply && break || sleep $((RANDOM % 10 + 5)); done`",
    "Use `terraform apply -lock=false` to bypass locking entirely (only for non-critical environments, as it risks state corruption)."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://developer.hashicorp.com/terraform/language/settings/backends/s3#dynamodb-state-locking",
  "official_doc_section": null,
  "error_code": "ProvisionedThroughputExceededException",
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-11-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}