Description
Checkboxes for prior research
- I've gone through Developer Guide and API reference
- I've checked AWS Forums and StackOverflow.
- I've searched for previous similar issues and didn't find any solution.
Describe the bug
I have a scenario where I'm using a retry mechanism to update a DynamoDB item. The update fails with an Invalid UpdateExpression error, specifically: "Incorrect operand type for operator or function; operator or function: list_append, operand type: M."
I'm sharing a sample of what I’ve tried, but the result remains the same.
Regression Issue
- Select this option if this issue appears to be a regression.
SDK version number
@aws-sdk/lib-dynamodb@latest @aws-sdk/client-dynamodb@latest, @aws-sdk/utils-dynamodb@latest,
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
v22.16.0
Reproduction Steps
To reproduce this issue, I’ve attached a sample code snippet. Before running it locally, make sure the following prerequisites are met:
- Node.js version: v22.16.0
- AWS CLI profile: You must have an AWS profile configured with the role name 'test-admin'
- Create 'TestTable' in the Dynamodb.
- Dependencies: Ensure @aws-sdk/lib-dynamodb@latest is installed Once these are set up, you can execute the code locally via node index.mjs and it would create the item in the dynamodb.
- Goto the table 'TestTable' and remove the ConcurrentWorkflows attribute from the item and TranscodingStatus as COMPLETE.
- Again execute the code via node index.mjs and observe the issue.
Observed Behavior
After running npm install @aws-sdk/lib-dynamodb@latest and executing the code locally using the command node index.mjs, I encountered a ValidationException.
Error:::: ConditionalCheckFailedException: The conditional request failed
at de_ConditionalCheckFailedExceptionRes (C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@aws-sdk\client-dynamodb\dist-cjs\index.js:2336:21)
at de_CommandError (C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@aws-sdk\client-dynamodb\dist-cjs\index.js:2251:19)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@smithy\middleware-serde\dist-cjs\index.js:36:20
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@aws-sdk\lib-dynamodb\dist-cjs\index.js:163:30
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@smithy\core\dist-cjs\index.js:193:18
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@smithy\middleware-retry\dist-cjs\index.js:320:38
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@aws-sdk\middleware-logger\dist-cjs\index.js:33:22
at async executeWithRetry.delayedStart (file:///C:/Users/bhoopesh.tyagi/Desktop/Media%20Services/avs-vod-workflow/test-data/ddb.mjs:32:20)
at async executeFunctionWithRetry (file:///C:/Users/bhoopesh.tyagi/Desktop/Media%20Services/avs-vod-workflow/test-data/shared.mjs:69:28) {
'$fault': 'client',
'$metadata': {
httpStatusCode: 400,
requestId: 'B2RS6PD5FM7PPABTDT28B9T0C7VV4KQNSO5AEMVJF66Q9ASUAAJG',
extendedRequestId: undefined,
cfId: undefined,
attempts: 1,
totalRetryDelay: 0
},
Item: undefined,
__type: 'com.amazonaws.dynamodb.v20120810#ConditionalCheckFailedException'
}
Attempt 1: Error - The conditional request failed
Error does not meet retry conditions. Operation failed.
Error:::: ValidationException: Invalid UpdateExpression: Incorrect operand type for operator or function; operator or function: list_append, operand type: M
at throwDefaultError (C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@smithy\smithy-client\dist-cjs\index.js:388:20)
at C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@smithy\smithy-client\dist-cjs\index.js:397:5
at de_CommandError (C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@aws-sdk\client-dynamodb\dist-cjs\index.js:2308:14)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@smithy\middleware-serde\dist-cjs\index.js:36:20
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@aws-sdk\lib-dynamodb\dist-cjs\index.js:163:30
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@smithy\core\dist-cjs\index.js:193:18
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@smithy\middleware-retry\dist-cjs\index.js:320:38
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@aws-sdk\middleware-logger\dist-cjs\index.js:33:22
at async executeWithRetry.delayedStart (file:///C:/Users/bhoopesh.tyagi/Desktop/Media%20Services/avs-vod-workflow/test-data/ddb.mjs:32:20) {
'$fault': 'client',
'$metadata': {
httpStatusCode: 400,
requestId: 'CQU2JJUTC61KG3MRC6FNPSU5CJVV4KQNSO5AEMVJF66Q9ASUAAJG',
extendedRequestId: undefined,
cfId: undefined,
attempts: 1,
totalRetryDelay: 0
},
__type: 'com.amazon.coral.validate#ValidationException'
}
Attempt 1: Error - Invalid UpdateExpression: Incorrect operand type for operator or function; operator or function: list_append, operand type: M
Error does not meet retry conditions. Operation failed.
ValidationException: Invalid UpdateExpression: Incorrect operand type for operator or function; operator or function: list_append, operand type: M
at throwDefaultError (C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@smithy\smithy-client\dist-cjs\index.js:388:20)
at C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@smithy\smithy-client\dist-cjs\index.js:397:5
at de_CommandError (C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@aws-sdk\client-dynamodb\dist-cjs\index.js:2308:14)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@smithy\middleware-serde\dist-cjs\index.js:36:20
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@aws-sdk\lib-dynamodb\dist-cjs\index.js:163:30
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@smithy\core\dist-cjs\index.js:193:18
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@smithy\middleware-retry\dist-cjs\index.js:320:38
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@aws-sdk\middleware-logger\dist-cjs\index.js:33:22
at async executeWithRetry.delayedStart (file:///C:/Users/bhoopesh.tyagi/Desktop/Media%20Services/avs-vod-workflow/test-data/ddb.mjs:32:20) {
'$fault': 'client',
'$metadata': {
httpStatusCode: 400,
requestId: 'CQU2JJUTC61KG3MRC6FNPSU5CJVV4KQNSO5AEMVJF66Q9ASUAAJG',
extendedRequestId: undefined,
cfId: undefined,
attempts: 1,
totalRetryDelay: 0
},
__type: 'com.amazon.coral.validate#ValidationException'
}
node:internal/modules/run_main:123
triggerUncaughtException(
^
ValidationException: Invalid UpdateExpression: Incorrect operand type for operator or function; operator or function: list_append, operand type: M
at throwDefaultError (C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@smithy\smithy-client\dist-cjs\index.js:388:20)
at C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@smithy\smithy-client\dist-cjs\index.js:397:5
at de_CommandError (C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@aws-sdk\client-dynamodb\dist-cjs\index.js:2308:14)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@smithy\middleware-serde\dist-cjs\index.js:36:20
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@aws-sdk\lib-dynamodb\dist-cjs\index.js:163:30
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@smithy\core\dist-cjs\index.js:193:18
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@smithy\middleware-retry\dist-cjs\index.js:320:38
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@aws-sdk\middleware-logger\dist-cjs\index.js:33:22
at async executeWithRetry.delayedStart (file:///C:/Users/bhoopesh.tyagi/Desktop/Media%20Services/avs-vod-workflow/test-data/ddb.mjs:32:20) {
'$fault': 'client',
'$metadata': {
httpStatusCode: 400,
requestId: 'CQU2JJUTC61KG3MRC6FNPSU5CJVV4KQNSO5AEMVJF66Q9ASUAAJG',
extendedRequestId: undefined,
cfId: undefined,
attempts: 1,
totalRetryDelay: 0
},
__type: 'com.amazon.coral.validate#ValidationException'
}
Node.js v22.16.0
Expected Behavior
The expected behavior when using the retry function with this command is that only ConditionalCheckFailedException should be thrown.
We do not want any other errors to be returned—only this specific exception should be surfaced during the retry scenario.
To achieve this expected result, make sure to install the specific version of the DynamoDB library:
npm install @aws-sdk/[email protected]
Error:::: ConditionalCheckFailedException: The conditional request failed
at de_ConditionalCheckFailedExceptionRes (C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@aws-sdk\client-dynamodb\dist-cjs\index.js:2336:21)
at de_CommandError (C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@aws-sdk\client-dynamodb\dist-cjs\index.js:2251:19)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@smithy\middleware-serde\dist-cjs\index.js:36:20
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@aws-sdk\lib-dynamodb\dist-cjs\index.js:174:30
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@smithy\core\dist-cjs\index.js:193:18
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@smithy\middleware-retry\dist-cjs\index.js:320:38
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@aws-sdk\middleware-logger\dist-cjs\index.js:33:22
at async executeWithRetry.delayedStart (file:///C:/Users/bhoopesh.tyagi/Desktop/Media%20Services/avs-vod-workflow/test-data/ddb.mjs:32:20)
at async executeFunctionWithRetry (file:///C:/Users/bhoopesh.tyagi/Desktop/Media%20Services/avs-vod-workflow/test-data/shared.mjs:69:28) {
'$fault': 'client',
'$metadata': {
httpStatusCode: 400,
requestId: 'R1B6OON7CUP5VAD7OE7QEHGSUJVV4KQNSO5AEMVJF66Q9ASUAAJG',
extendedRequestId: undefined,
cfId: undefined,
attempts: 1,
totalRetryDelay: 0
},
Item: undefined,
__type: 'com.amazonaws.dynamodb.v20120810#ConditionalCheckFailedException'
}
Attempt 1: Error - The conditional request failed
Error does not meet retry conditions. Operation failed.
Error:::: ConditionalCheckFailedException: The conditional request failed
at de_ConditionalCheckFailedExceptionRes (C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@aws-sdk\client-dynamodb\dist-cjs\index.js:2336:21)
at de_CommandError (C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@aws-sdk\client-dynamodb\dist-cjs\index.js:2251:19)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@smithy\middleware-serde\dist-cjs\index.js:36:20
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@aws-sdk\lib-dynamodb\dist-cjs\index.js:174:30
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@smithy\core\dist-cjs\index.js:193:18
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@smithy\middleware-retry\dist-cjs\index.js:320:38
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@aws-sdk\middleware-logger\dist-cjs\index.js:33:22
at async executeWithRetry.delayedStart (file:///C:/Users/bhoopesh.tyagi/Desktop/Media%20Services/avs-vod-workflow/test-data/ddb.mjs:32:20)
at async executeFunctionWithRetry (file:///C:/Users/bhoopesh.tyagi/Desktop/Media%20Services/avs-vod-workflow/test-data/shared.mjs:69:28) {
'$fault': 'client',
'$metadata': {
httpStatusCode: 400,
requestId: 'HBHB49NPOHQMFIFS6IUMQHP4PVVV4KQNSO5AEMVJF66Q9ASUAAJG',
extendedRequestId: undefined,
cfId: undefined,
attempts: 1,
totalRetryDelay: 0
},
Item: undefined,
__type: 'com.amazonaws.dynamodb.v20120810#ConditionalCheckFailedException'
}
Attempt 1: Error - The conditional request failed
Error does not meet retry conditions. Operation failed.
ConditionalCheckFailedException: The conditional request failed
at de_ConditionalCheckFailedExceptionRes (C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@aws-sdk\client-dynamodb\dist-cjs\index.js:2336:21)
at de_CommandError (C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@aws-sdk\client-dynamodb\dist-cjs\index.js:2251:19)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@smithy\middleware-serde\dist-cjs\index.js:36:20
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@aws-sdk\lib-dynamodb\dist-cjs\index.js:174:30
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@smithy\core\dist-cjs\index.js:193:18
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@smithy\middleware-retry\dist-cjs\index.js:320:38
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@aws-sdk\middleware-logger\dist-cjs\index.js:33:22
at async executeWithRetry.delayedStart (file:///C:/Users/bhoopesh.tyagi/Desktop/Media%20Services/avs-vod-workflow/test-data/ddb.mjs:32:20)
at async executeFunctionWithRetry (file:///C:/Users/bhoopesh.tyagi/Desktop/Media%20Services/avs-vod-workflow/test-data/shared.mjs:69:28) {
'$fault': 'client',
'$metadata': {
httpStatusCode: 400,
requestId: 'HBHB49NPOHQMFIFS6IUMQHP4PVVV4KQNSO5AEMVJF66Q9ASUAAJG',
extendedRequestId: undefined,
cfId: undefined,
attempts: 1,
totalRetryDelay: 0
},
Item: undefined,
__type: 'com.amazonaws.dynamodb.v20120810#ConditionalCheckFailedException'
}
node:internal/modules/run_main:123
triggerUncaughtException(
^
ConditionalCheckFailedException: The conditional request failed
at de_ConditionalCheckFailedExceptionRes (C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@aws-sdk\client-dynamodb\dist-cjs\index.js:2336:21)
at de_CommandError (C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@aws-sdk\client-dynamodb\dist-cjs\index.js:2251:19)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@smithy\middleware-serde\dist-cjs\index.js:36:20
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@aws-sdk\lib-dynamodb\dist-cjs\index.js:174:30
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@smithy\core\dist-cjs\index.js:193:18
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@smithy\middleware-retry\dist-cjs\index.js:320:38
at async C:\Users\bhoopesh.tyagi\Desktop\Media Services\avs-vod-workflow\test-data\node_modules@aws-sdk\middleware-logger\dist-cjs\index.js:33:22
at async executeWithRetry.delayedStart (file:///C:/Users/bhoopesh.tyagi/Desktop/Media%20Services/avs-vod-workflow/test-data/ddb.mjs:32:20)
at async executeFunctionWithRetry (file:///C:/Users/bhoopesh.tyagi/Desktop/Media%20Services/avs-vod-workflow/test-data/shared.mjs:69:28) {
'$fault': 'client',
'$metadata': {
httpStatusCode: 400,
requestId: 'HBHB49NPOHQMFIFS6IUMQHP4PVVV4KQNSO5AEMVJF66Q9ASUAAJG',
extendedRequestId: undefined,
cfId: undefined,
attempts: 1,
totalRetryDelay: 0
},
Item: undefined,
__type: 'com.amazonaws.dynamodb.v20120810#ConditionalCheckFailedException'
}
Node.js v22.16.0
Possible Solution
No response
Additional Information/Context
No response