{
  "id": "aws/dynamodb-transaction-canceled",
  "signature": "An error occurred (TransactionCanceledException) when calling the TransactWriteItems operation: Transaction cancelled, please refer cancellation reasons for specific details [ConditionalCheckFailed, None]",
  "signature_zh": "调用 TransactWriteItems 操作时出错 (TransactionCanceledException)：事务已取消，请参考取消原因了解具体细节 [ConditionalCheckFailed, None]",
  "regex": "TransactionCanceledException.*Transaction cancelled, please refer cancellation reasons",
  "domain": "aws",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "A condition expression on one or more items in the DynamoDB transaction failed, causing the entire transaction to roll back.",
  "root_cause_type": "generic",
  "root_cause_zh": "DynamoDB 事务中一个或多个项目的条件表达式失败，导致整个事务回滚。",
  "versions": [
    {
      "version": "DynamoDB API 2012-08-10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "AWS SDK v2.21.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Retry the transaction with exponential backoff without checking conditions",
      "why_fails": "Retrying a transaction with a failing condition will keep failing; the condition must be fixed first.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "Increase DynamoDB write capacity units",
      "why_fails": "Throughput is not the issue; this is a condition check failure, not a throttling error.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "Ignore cancellation reasons and assume transient error",
      "why_fails": "Cancellation reasons like 'ConditionalCheckFailed' indicate a specific logic error that must be addressed.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Parse the cancellation reasons array from the error. For each item, check the condition expression logic. Example in Python: `error.response['Error']['Code'] == 'TransactionCanceledException' and 'ConditionalCheckFailed' in error.response['Error']['Message']`",
      "success_rate": 0.85,
      "how": "Parse the cancellation reasons array from the error. For each item, check the condition expression logic. Example in Python: `error.response['Error']['Code'] == 'TransactionCanceledException' and 'ConditionalCheckFailed' in error.response['Error']['Message']`",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use DynamoDB Streams to capture pre-image and verify condition logic offline before retrying.",
      "success_rate": 0.7,
      "how": "Use DynamoDB Streams to capture pre-image and verify condition logic offline before retrying.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Simplify transaction: reduce number of items per transaction or split into individual PutItem/UpdateItem calls with retry logic.",
      "success_rate": 0.75,
      "how": "Simplify transaction: reduce number of items per transaction or split into individual PutItem/UpdateItem calls with retry logic.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "从错误中解析取消原因数组。对于每个项目，检查条件表达式逻辑。Python 示例：`error.response['Error']['Code'] == 'TransactionCanceledException' and 'ConditionalCheckFailed' in error.response['Error']['Message']`",
    "使用 DynamoDB Streams 捕获前镜像，并在重试前离线验证条件逻辑。",
    "简化事务：减少每个事务的项目数，或拆分为单独的 PutItem/UpdateItem 调用并添加重试逻辑。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/transaction-apis.html",
  "official_doc_section": null,
  "error_code": "TransactionCanceledException",
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-06-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}