{
  "id": "terraform/state-lock-dynamodb-throttling",
  "signature": "Error: Error acquiring the state lock: ConditionalCheckFailedException: The conditional request failed: ProvisionedThroughputExceededException: Rate exceeded",
  "signature_zh": "错误：获取状态锁失败：ConditionalCheckFailedException：条件请求失败：ProvisionedThroughputExceededException：速率超限",
  "regex": "Error acquiring the state lock.*ProvisionedThroughputExceededException.*Rate exceeded",
  "domain": "terraform",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "DynamoDB table used for state locking is experiencing throttling due to high request rates, exceeding its provisioned read/write capacity.",
  "root_cause_type": "generic",
  "root_cause_zh": "用于状态锁定的 DynamoDB 表因请求速率过高而受到限流，超出了预置的读写容量。",
  "versions": [
    {
      "version": "Terraform 1.5.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Terraform 1.6.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Terraform 1.7.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The lock acquisition failed due to throttling, not because the lock is held. Force-unlock doesn't address the throughput issue.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Deleting the table removes all state lock items but also any existing locks. Recreating with default settings still has low throughput.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Terraform's retry mechanism is for provider operations, not for state lock acquisition. The lock mechanism is internal and not configurable.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Increase the DynamoDB table's provisioned read and write capacity units (RCU/WCU) to handle the peak load. Switch to on-demand capacity if workload is unpredictable.",
      "success_rate": 0.85,
      "how": "Increase the DynamoDB table's provisioned read and write capacity units (RCU/WCU) to handle the peak load. Switch to on-demand capacity if workload is unpredictable.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Implement client-side retry logic by wrapping terraform commands in a bash script with exponential backoff.",
      "success_rate": 0.75,
      "how": "Implement client-side retry logic by wrapping terraform commands in a bash script with exponential backoff.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Reduce the frequency of terraform apply/plan operations during peak hours, or stagger multiple CI/CD pipelines to avoid concurrent lock attempts.",
      "success_rate": 0.7,
      "how": "Reduce the frequency of terraform apply/plan operations during peak hours, or stagger multiple CI/CD pipelines to avoid concurrent lock attempts.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "增加 DynamoDB 表的预置读写容量单元以处理峰值负载。如果工作负载不可预测，切换到按需容量模式。",
    "通过将 terraform 命令包装在带有指数退避的 bash 脚本中，实现客户端重试逻辑。",
    "在高峰时段减少 terraform apply/plan 操作的频率，或错开多个 CI/CD 管道以避免并发锁尝试。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://developer.hashicorp.com/terraform/language/settings/backends/s3#dynamodb-table-configuration",
  "official_doc_section": null,
  "error_code": "ProvisionedThroughputExceededException",
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-04-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}