-
Notifications
You must be signed in to change notification settings - Fork 632
Closed
Labels
bugThis issue is a bug.This issue is a bug.p1This is a high priority issueThis is a high priority issue
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
If I'm not mistaken, it appears that the latest version of @aws-sdk/middleware-logger (released today) has caused the bug described in the following previously closed issues to resurface:
It's causing this error again when fetching items with null attributes using @aws-sdk/lib-dynamodb:
TypeError: Cannot read properties of null (reading 'S')
SDK version number
@aws-sdk/middleware-logger@3.287.0
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
Lambda nodejs16.x
Reproduction Steps
const { DynamoDBClient } = require('@aws-sdk/client-dynamodb');
const { DynamoDBDocumentClient, GetCommand } = require('@aws-sdk/lib-dynamodb');
const ddbClient = new DynamoDBClient();
const ddbDocClient = DynamoDBDocumentClient.from(ddbClient);
const response = await ddbDocClient.send(new GetCommand({
TableName: 'table',
Key: {
pk: 'pk',
sk: 'sk',
},
}));
Observed Behavior
TypeError: Cannot read properties of null (reading 'S')
{
"errorType": "TypeError",
"errorMessage": "Cannot read properties of null (reading 'S')",
"stack": [
"TypeError: Cannot read properties of null (reading 'S')",
" at AttributeValueFilterSensitiveLog (/var/task/test/node_modules/@aws-sdk/client-dynamodb/dist-cjs/models/models_0.js:1328:13)",
" at /var/task/test/node_modules/@aws-sdk/client-dynamodb/dist-cjs/models/models_0.js:1414:128",
" at Array.reduce (<anonymous>)",
" at GetItemOutputFilterSensitiveLog (/var/task/test/node_modules/@aws-sdk/client-dynamodb/dist-cjs/models/models_0.js:1414:40)",
" at /var/task/test/node_modules/@aws-sdk/middleware-logger/dist-cjs/loggerMiddleware.js:17:21",
" at processTicksAndRejections (node:internal/process/task_queues:96:5)",
...
]
}
Expected Behavior
Successful retrieval of item with a null attribute without an error being thrown.
Possible Solution
No response
Additional Information/Context
Seeing this with the latest version of @aws-sdk/client-dynamodb and @aws-sdk/lib-dynamodb being used. It appears to be the dependencies they have on @aws-sdk/middleware-logger.
green2995
Metadata
Metadata
Assignees
Labels
bugThis issue is a bug.This issue is a bug.p1This is a high priority issueThis is a high priority issue