ConditionalCheckFailedException: The conditional request failed
A write’s ConditionExpression evaluated to false, so DynamoDB didn’t perform it — often exactly as designed.
Seen on:
AWS
Meaning
Conditions like attribute_not_exists(pk) (create-only) or version = :v (optimistic locking) fail when the item already exists or changed. Handle it as a business outcome (duplicate, conflict), not a crash.
Common causes
- Item already exists (attribute_not_exists)
- Version/attribute changed by another writer
- Condition expression references the wrong attribute name
⚡ Quick fix
- Catch the exception and handle duplicate/conflict
- Re-read and retry with the new version
- Use ReturnValuesOnConditionCheckFailure to see the current item
Detailed fix by platform
Python
- python
try: table.put_item(Item=item, ConditionExpression="attribute_not_exists(pk)") except table.meta.client.exceptions.ConditionalCheckFailedException: pass # already exists
How to diagnose
- Condition — Expression and values
- Item — Current item state
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in AWS
Other ways to find it
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026