bug: DynamoDB Expected ComparisonOperator + Value rejects writes accepted by AWS (Pro dev105) #79
Closed
AndreKurait
started this conversation in
Bugs (AWS)
Replies: 1 comment
|
Hi @AndreKurait, this is now fixed in the |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
LocalStack rejects Expected conditions that combine
ComparisonOperatorwithValue, while live AWS evaluates the operator and operand. Using a one-element AttributeValueList instead produces equivalent outcomes on live AWS and works on LocalStack.Environment
localstack/localstack-pro:dev, version 2026.10.0.dev105, build 3a0ece14; Pro license activation verified.linux/amd64image:sha256:acec8be1241f45d56519b20746d0208041e331ad2913be1eb03fd8d582121a2d.linux/arm64:sha256:8f4da21eb967b43d53b3e2c66597979bc3bf58eaf6816295c3fa2b138f24b4e7.sha256:b38e4fcb56751f999637f3395fd9ef4a593a4b96b57887d9b62ce44c6f22b5aa, pulled 2026-10-12.EC2_VM_MANAGER=mock, no DynamoDB provider overrides, extensions, or source patches.us-east-1, boto31.43.111. ARM comparison: 2026-10-12 16:44:05–16:44:09 UTC; exact AMD64 comparison: 16:47:07–16:47:12 UTC. Same outcomes on both architectures.Observed versus expected
Old-form requests return HTTP 400 on LocalStack:
The live AWS baseline ran in
us-east-1on 2026-10-12 at 16:24:24–16:26:04 UTC, using a temporary table and synthetic data. Forty old/new pairs (80 conditional writes) were separately seeded and followed by consistent GetItem readback:On live AWS, 18 pairs succeeded and 22 pairs returned ConditionalCheckFailedException; all 40 pairs had identical stored items between representations. The old NE operator was enforced rather than ignored. Successful writes changed a marker from
beforetoafter; failed writes left the original item unchanged.On both tested LocalStack architectures, 40/40 old-form requests returned ValidationException, while 40/40 new-form requests matched AWS's outcomes and stored items. This changes accepted writes and the exception type for refused writes.
AWS ExpectedAttributeValue documentation describes these parameter families as incompatible. The real service nevertheless accepted and evaluated the tested EQ/NE + Value forms. This report requests parity with those observed cases; it does not imply every mixed condition representation is valid.
Minimal reproducer
Start a disposable container with your own auth token set in the environment:
After readiness, install boto3 and run the script below. This standalone reproducer was executed against the exact AMD64 image above. All AWS credentials are dummy values and the endpoint is loopback LocalStack. Fixtures are cleaned up.
The short reproducer covers successful and refused EQ/NE string conditions. The broader 40-pair comparison above additionally covered Boolean, numeric, missing/type-mismatched, compound, Exists=false, and PutItem cases.
On the affected image, every
*-oldcondition returns ValidationException. The*-newcontrols succeed or return ConditionalCheckFailedException according to the predicate. Marker readbacks verify actual writes and unchanged data on refusal.All reactions