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 datatypes

DynamoDB 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/null field in the object you're writing — the marshaller emits an empty AttributeValue instead of skipping or NULL-typing it.
  • An empty SetSS, NS, or BS must 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 valueB/BS members must be non-empty.
  • A nested empty value — an empty string/set buried inside a Map or List you're persisting.

How to fix it

  1. Strip empty/undefined attributes before writing. Build the Item from only the fields that actually have values; drop the rest instead of sending an empty wrapper.
  2. For the Document Client, enable empty-value handling. @aws-sdk/lib-dynamodb's removeUndefinedValues: true marshalling option drops undefined fields so they never reach the wire. (Empty strings for non-key attributes are allowed by DynamoDB directly.)
  3. Never send an empty Set — omit the attribute entirely when the set has no members, or store a NULL.
  4. Give key attributes real values — a partition/sort key can never be an empty string or empty binary.
  5. 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.

Console なしで DynamoDB を扱う

DynoTable は DynamoDB 向けの高速なデスクトップクライアントです — テーブルを閲覧し、SQL スタイルのクエリを実行し、アイテムをローカルで編集できます。