# An error occurred (ConditionalCheckFailedException) when calling the PutItem operation: The conditional request failed

- **ID:** `aws/dynamodb-conditional-check-failed`
- **Domain:** aws
- **Category:** data_error
- **Error Code:** `ConditionalCheckFailedException`
- **Verification:** ai_generated
- **Fix Rate:** 90%

## 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.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| DynamoDB 2012-08-10 | active | — | — |
| AWS SDK for Python 1.33.0 | active | — | — |
| AWS CLI 2.14.0 | active | — | — |

## Workarounds

1. **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).** (90% success)
   ```
   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).
   ```
2. **Use UpdateItem with a condition expression that checks the expected state, or use a transaction with TransactWriteItems to handle conflicts atomically.** (85% success)
   ```
   Use UpdateItem with a condition expression that checks the expected state, or use a transaction with TransactWriteItems to handle conflicts atomically.
   ```

## Dead Ends

- **Retry the PutItem operation with the same condition.** — The condition still fails because the underlying data hasn't changed. (95% fail)
- **Remove all conditions from the PutItem call.** — This bypasses the intended logic, potentially causing duplicate records or data corruption. (70% fail)
- **Increase the read/write capacity of the table.** — Throughput is not the issue; it's a logical condition failure. (85% fail)
