{
  "id": "aws/dynamodb-conditional-check-failed",
  "signature": "An error occurred (ConditionalCheckFailedException) when calling the PutItem operation: The conditional request failed",
  "signature_zh": "调用 PutItem 操作时发生错误 (ConditionalCheckFailedException)：条件请求失败",
  "regex": "ConditionalCheckFailedException.*PutItem.*conditional request failed",
  "domain": "aws",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "A conditional expression on a DynamoDB PutItem (e.g., attribute_not_exists) evaluated to false, meaning the item already exists or a condition was not met.",
  "root_cause_type": "generic",
  "root_cause_zh": "DynamoDB PutItem 上的条件表达式（例如 attribute_not_exists）评估为 false，意味着项目已存在或条件未满足。",
  "versions": [
    {
      "version": "DynamoDB 2012-08-10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "AWS SDK for Python 1.33.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "AWS CLI 2.14.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Retry the PutItem operation with the same condition.",
      "why_fails": "The condition still fails because the underlying data hasn't changed.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "Remove all conditions from the PutItem call.",
      "why_fails": "This bypasses the intended logic, potentially causing duplicate records or data corruption.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "Increase the read/write capacity of the table.",
      "why_fails": "Throughput is not the issue; it's a logical condition failure.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Check the item's current state using a GetItem call before PutItem, and adjust the condition expression accordingly (e.g., use attribute_not_exists only if item should be new).",
      "success_rate": 0.9,
      "how": "Check the item's current state using a GetItem call before PutItem, and adjust the condition expression accordingly (e.g., use attribute_not_exists only if item should be new).",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use UpdateItem with a condition expression that checks the expected state, or use a transaction with TransactWriteItems to handle conflicts atomically.",
      "success_rate": 0.85,
      "how": "Use UpdateItem with a condition expression that checks the expected state, or use a transaction with TransactWriteItems to handle conflicts atomically.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "在 PutItem 之前使用 GetItem 调用检查项目的当前状态，并相应调整条件表达式（例如，仅在项目应为新项目时使用 attribute_not_exists）。",
    "使用带有条件表达式的 UpdateItem 来检查预期状态，或使用 TransactWriteItems 中的事务以原子方式处理冲突。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithItems.html#WorkingWithItems.ConditionalUpdate",
  "official_doc_section": null,
  "error_code": "ConditionalCheckFailedException",
  "verification_tier": "ai_generated",
  "confidence": 0.89,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2023-03-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}