Supplied AttributeValue is empty, must contain exactly one of the supported datatypes
TL;DR — One of the attributes in your Item (or key) has an AttributeValue with no value inside it — an empty string/set/list, a null/undefined field, or a wrapper with no S/N/BOOL/… member. DynamoDB requires every AttributeValue to hold exactly one supported type. Remove the empty attribute or give it a real value.
What it means
ValidationException: Supplied AttributeValue is empty, must contain exactly one of the supported datatypesDynamoDB rejected the request while validating the shape of an item: an AttributeValue was present but carried nothing DynamoDB can store. Every AttributeValue must contain exactly one typed value (S, N, B, SS, NS, BS, M, L, NULL, or BOOL). It's an HTTP 400, not retryable — the same item fails again until you fix the attribute.
This is distinct from ExpressionAttributeValues contains invalid value: that one is about a :placeholder in an expression; this one is about an attribute in the item body itself (PutItem, BatchWriteItem, TransactWriteItems).
Why it happens
- An
undefined/nullfield in the object you're writing — the marshaller emits an empty AttributeValue instead of skipping orNULL-typing it. - An empty Set —
SS,NS, orBSmust have at least one member. An empty set is invalid. - An empty string in a key attribute — non-key string attributes may be
"", but a key attribute may not. - An empty binary value —
B/BSmembers must be non-empty. - A nested empty value — an empty string/set buried inside a
MaporListyou're persisting.
How to fix it
- Strip empty/
undefinedattributes before writing. Build theItemfrom only the fields that actually have values; drop the rest instead of sending an empty wrapper. - For the Document Client, enable empty-value handling.
@aws-sdk/lib-dynamodb'sremoveUndefinedValues: truemarshalling option dropsundefinedfields so they never reach the wire. (Empty strings for non-key attributes are allowed by DynamoDB directly.) - Never send an empty Set — omit the attribute entirely when the set has no members, or store a
NULL. - Give key attributes real values — a partition/sort key can never be an empty string or empty binary.
- Walk nested Maps/Lists for stray empty strings or sets if the offending attribute isn't top-level.
FAQ
What does "Supplied AttributeValue is empty" mean in DynamoDB? An attribute in your item has an AttributeValue that contains no stored value — an empty string in a key, an empty Set, an empty binary, or a null/undefined field. Every AttributeValue must contain exactly one supported datatype, so DynamoDB rejects the write.
How do I stop DynamoDB rejecting empty values? Remove empty and undefined attributes before writing (or use the Document Client's removeUndefinedValues option). Never send an empty Set — omit the attribute or store a NULL. Key attributes must always carry a real, non-empty value.
Related errors
- ExpressionAttributeValues contains invalid value — the same class of problem in an expression placeholder.
- ValidationException (overview)
- Learn: DynamoDB data types · JSON marshalling