Error: DynamoDB string set may not be empty

Answered by Rafal Wilinski
Last updated: October 23rd, 2026
Solution
“String set may not be empty” means a set with no members reached the serializer or service. A String Set is different from an empty String or an empty List, both of which can be valid non-key values. Fix the collection representation before sending it.
To clear an existing set without replacing the item, remove the attribute:
import boto3
table = boto3.resource("dynamodb", region_name="us-east-1").Table("Orders")
table.update_item(
Key={"id": "123"},
UpdateExpression="REMOVE #tags",
ConditionExpression="attribute_exists(#id)",
ExpressionAttributeNames={"#tags": "tags", "#id": "id"},
)The condition prevents this cleanup from creating a new item at an absent key. If an explicit empty collection must remain present, store a List and update readers to expect it. For new items, omit optional empty sets. Check nested values too; neither adding a placeholder member nor changing IAM permissions addresses the data-model problem.
See collection types and AWS documentation.
Other Common DynamoDB Errors (with Solutions)
- ProvisionedThroughputExceededException DynamoDB
- DynamoDB is not showing all columns
- DynamoDB console unable to delete this item
- One or more parameter values were invalid: some AttributeDefinitions are not used
- DynamoDB aliasing is not supported
- dynamodb the table does not have the specified index
- DynamoDB Network Error: self signed certificate in chain
- dynamodb cannot read properties of undefined
- missing required key 'key' in params dynamodb
- moto dynamodb not working
- DynamoDB Internal Server Error
- DynamoDB GetItem no item
- CORS Error DynamoDB
- DynamoDB validation error
- Could not connect to the endpoint URL https:dynamodb.singapore.amazonaws.com
Dynobase is a Professional GUI Client for DynamoDB
Start your 7-day free trial today