Closed Luan10017 closed 4 days ago
Hi @Luan10017 - thanks for reaching out.
Furthermore, the same logic and data work perfectly with the dynamodb SDK V2 and nodejs 14 lambda runtime.
Node.js 14 runtime for Lambda was deprecated on Dec 4, 2023, and AWS SDK for Javascript v2 is entering Maintenance mode on Sept 8, 2025.
Can you confirm if you're running this on supported Lambda runtime?
Here are a few steps you can take to further investigate:
const client = new DynamoDBClient({ requestTimeout: 60000 }); // Increase timeout to 60 seconds
client.middlewareStack.add(
(next, context) => async (args) => {
console.log("AWS SDK context", context.clientName, context.commandName);
console.log("AWS SDK request input", args.input);
const result = await next(args);
console.log("AWS SDK request output:", result.output);
return result;
},
{
name: "MyMiddleware",
step: "build",
override: true,
}
);
Looking forward to hear back! Best, John
Hi @aBurmeseDev thanks for the support.
I performed the debug step with middlewareStack as you advised, but what really solved my problem was deleting the lambda and recreating it again. I think there was a problem with the provisioning of the resource (remembering that this was in lambda node 20 runtime).
Thanks again for helping! I'm closing the issue.
Checkboxes for prior research
Describe the bug
QueryCommand receiving timeout when trying to query index (GSI), however when observing the index reading data in the table console there is no reading processing. Furthermore, the same logic and data work perfectly with the dynamodb SDK V2 and nodejs 14 lambda runtime.
SDK version number
@aws-sdk/lib-dynamodb
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
Nodejs 20
Reproduction Steps
Observed Behavior
QueryCommad receives a timeout error after 30 seconds, but no read attempts are recorded in the table index reading metrics. Furthermore, using the AWS SDK V2, the query returns in 400 ms.
Expected Behavior
Data return in time compared to SDK V2 400 ms.
Possible Solution
No response
Additional Information/Context
No response