Error: DynamoDB delete fails

Answered by Rafal Wilinski
Last updated: October 23rd, 2026
Solution
A failed DynamoDB delete usually means the request used an invalid key, failed a condition, lacked permission, or was throttled. DeleteItem without a condition succeeds even when the item is already absent. Read the exception before changing the request.
Match the error to the fix
ValidationException: supply exactly the base table’s key attributes, with the right names and types. A composite primary key requires both partition and sort key values.ConditionalCheckFailedException: compare the current item with the condition. A mapper’s version check can create this condition. A version attribute by itself does not make DynamoDB enforce optimistic locking.AccessDeniedException: grant the required delete action on the specific table and inspect explicit denies.ResourceNotFoundException: verify the table, Region, account, and endpoint.- Throttling or a transaction conflict: use bounded retries with backoff and inspect the throttling reason. Increasing table capacity helps only when that capacity is the bottleneck.
A delete with an explicit condition
import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
import { DynamoDBDocumentClient, DeleteCommand } from "@aws-sdk/lib-dynamodb";
const db = DynamoDBDocumentClient.from(new DynamoDBClient({ region: "us-east-1" }));
const result = await db.send(new DeleteCommand({
TableName: "Orders",
Key: { pk: "ORDER#123", sk: "DETAIL" },
ConditionExpression: "#status = :status",
ExpressionAttributeNames: { "#status": "status" },
ExpressionAttributeValues: { ":status": "CANCELLED" },
ReturnValues: "ALL_OLD"
}));
console.log(result.Attributes);This example deliberately refuses to delete an item whose current status is not CANCELLED, including an absent item. Handle that as a business decision rather than blindly retrying or removing the condition.
Backups and enabled Streams do not block ordinary deletes. An UPDATING table can still serve data operations; diagnose the actual response instead of assuming all updates require downtime. Awaiting an asynchronous SDK call is necessary to observe success or failure, but it does not bypass server-side validation.
See delete examples and AWS documentation.
Other Common DynamoDB Errors (with Solutions)
- dynamodb consistent reads are not supported on global secondary indexes
- DynamoDB Scan Not Working
- DynamoDB Internal Server Error
- DynamoDB string set may not be empty
- dynamodb cannot create preexisting table
- DynamoDB could not invoke null on class
- localstack dynamodb not working
- an expression attribute name used in the document path is not defined
- boto3 dynamodb unable to locate credentials
- dynamodb could not instantiate class
- Unable to start DynamoDB Local process
- DynamoDB Item Does Not Exist
- name key is not defined dynamodb
- dynamodb update fail if not exists
- DynamoDB ConditionExpression not working
Dynobase is a Professional GUI Client for DynamoDB
Start your 7-day free trial today
Product Features
DynamoDB Tools
- SSH GUI Client
- Chat With Cloud
- MongoDB GUI Client
- AWS Cost Monitoring
- DynamoDB Query Builder
- DynamoDB Code Examples
- DynamoDB Node.js Queries
- DynamoDB JSON Converter
- DynamoDB UUID Generator
- DynamoDB Local Admin GUI
- DynamoDB Pricing Calculator
- DynamoDB Single-Table Design
- Best DynamoDB GUI Clients
- Dynobase vs DynoTable