ConditionalCheckFailedException AWS Origin: Platform & cloud Last updated 13 Oct 2026

ConditionalCheckFailedException: The conditional request failed

A write’s ConditionExpression evaluated to false, so DynamoDB didn’t perform it — often exactly as designed.

Exact message you may see The conditional request failedTransactionCanceledException ConditionalCheckFailed
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

  1. Catch the exception and handle duplicate/conflict
  2. Re-read and retry with the new version
  3. Use ReturnValuesOnConditionCheckFailure to see the current item

Detailed fix by platform

Python

  1. python
    try:
        table.put_item(Item=item, ConditionExpression="attribute_not_exists(pk)")
    except table.meta.client.exceptions.ConditionalCheckFailedException:
        pass  # already exists

How to diagnose

  1. Condition — Expression and values
  2. 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:

Where this error sits

Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):

40001 — ERROR: could not serialize access due to concurrent update (PostgreSQL)40001409 — HTTP 409 Conflict (HTTP)409412 — HTTP 412 Precondition Failed (HTTP)412A second operation was started on this context — EF Core: A second operation was started on this context instance before a previous operation completed (.NET)A second operation wa…all goroutines are asleep - deadlock — Go: fatal error: all goroutines are asleep - deadlock! (Go)all goroutines are as…ALREADY_EXISTS — API Error: Resource already exists (ALREADY_EXISTS / resource_already_exists / 409) (API)ALREADY_EXISTSAnotherOperationInProgress — Conflict: AnotherOperationInProgress — Another operation is in progress on the resource (Azure)AnotherOperationInPro…Collection was modified — InvalidOperationException: Collection was modified; enumeration operation may not execute (.NET)Collection was modifi…Condition…

Explore the map of this error Full error map →

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

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.