Error: ExpressionAttributeValues contains invalid value: One or more parameter values were invalid: An AttributeValue may not contain an empty string

Answered by Rafal Wilinski
Last updated: October 23rd, 2026
Solution
The message An AttributeValue may not contain an empty string often comes from old validation rules or an empty key value. Current DynamoDB accepts empty String and Binary values for non-key attributes; table and index key values cannot be empty, and sets cannot be empty.
- Identify which placeholder contains the empty value and whether it is used as a table or index key. Supply a real key value rather than converting it to null.
- If the empty string is an ordinary attribute, check for an outdated emulator, SDK wrapper or application validator. The service no longer rejects every empty string.
- Decide whether an empty string, a missing attribute and NULL mean different things in your data model before enabling conversion.
The v3 document client can preserve an empty non-key string:
import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
import { DynamoDBDocumentClient, PutCommand } from "@aws-sdk/lib-dynamodb";
const db = DynamoDBDocumentClient.from(new DynamoDBClient({}));
await db.send(new PutCommand({
TableName: "Notes",
Item: { pk: "NOTE#1", body: "" },
}));If your application deliberately stores empty values as NULL, configure marshallOptions: { convertEmptyValues: true } in DynamoDBDocumentClient.from(client, options). This changes the stored representation; it does not make a null primary key valid. For an optional GSI key, omit the attribute when the item should not appear in that index.
See attribute types and AWS documentation.
Other Common DynamoDB Errors (with Solutions)
- dynamodb botocore.exceptions.nocredentialserror unable to locate credentials
- dynamodb-admin is not recognized as an internal or external command
- DynamoDB aliasing is not supported
- AWS DynamoDB CredentialsError: Missing credentials in config
- DynamoDB Internal Server Error
- dynamodb could not connect to the endpoint url
- Error retrieving DynamoDB table item validation exception
- dynamodb cannot read property 'push' of undefined
- dynamodb atomic counter not working
- DynamoDB Local NoClassDefFoundError
- dynamodb list_append returns true but does not work
- dynamodb attribute does not exist
- dynamodb unable to parse base64 string
- DynamoDB error 400
- DynamoDB console unable to delete this item
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