-
Notifications
You must be signed in to change notification settings - Fork 578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3.209.0 introduces marshalling issue #4222
Comments
Experiencing this issue as well. We are getting frustrated by the continuing cadence of serious bugs in v3... almost to the point of going back to v2. |
fyi: changing this line seems to fix it
- [key]: AttributeValueFilterSensitiveLog(value),
+ [key]: value ? AttributeValueFilterSensitiveLog(value) : undefined, seems |
facing the same issue in the latest "3.216.0". |
I can confirm that latest version 3.216.0 is still broken and with 3.208 works as expected |
Hi @adrai, thanks for opening this issue. I can confirm this is a bug and seems to be happening due to the loggerMiddleware, we need to do a deeper investigation to understand what the problem is, however, as workaround we could either turn off the info logger by doing the following: logger: {
info: undefined
} Example: const ddbClient = DynamoDBDocumentClient.from(
new DynamoDBClient({
region: 'us-east-2',
logger: {
info: undefined
}
}), {
marshallOptions: {
removeUndefinedValues: true
}
}); Or you could also use the DynamoDBClient without DynamoDBDocumentClient. I will provide more updates as soon as get them. Thanks! |
Repro Steps:
import {DynamoDBClient, PutItemCommand} from '@aws-sdk/client-dynamodb'
import { DynamoDBDocumentClient, GetCommand } from '@aws-sdk/lib-dynamodb'
const ddbClient = DynamoDBDocumentClient.from(
new DynamoDBClient({
region: 'us-east-2'
}), {}
);
const response = await ddbClient.send(new PutItemCommand({
TableName: 'test-table',
Item: {
name: {
NULL: true
},
id: {
S: 'UID-10202020202021'
}
}
}))
console.log(response);
import {DynamoDBClient, PutItemCommand} from '@aws-sdk/client-dynamodb'
import { DynamoDBDocumentClient, GetCommand } from '@aws-sdk/lib-dynamodb'
const ddbClient = DynamoDBDocumentClient.from(
new DynamoDBClient({
region: 'us-east-2',
}), {
marshallOptions: {
removeUndefinedValues: true
}
});
const response = await ddbClient.send(new GetCommand({
TableName: 'test-table',
Key: {
id: 'UID-10202020202021'
}
}))
console.log(response);
PROJECT_DIR/node_modules/@aws-sdk/client-dynamodb/dist-cjs/models/models_0.js:1328
if (obj.S !== undefined)
^
TypeError: Cannot read properties of null (reading 'S')
at AttributeValueFilterSensitiveLog (PROJECT_DIR/node_modules/@aws-sdk/client-dynamodb/dist-cjs/models/models_0.js:1328:13)
at PROJECT_DIR/node_modules/@aws-sdk/client-dynamodb/dist-cjs/models/models_0.js:1414:128
at Array.reduce (<anonymous>)
at GetItemOutputFilterSensitiveLog (PROJECT_DIR/node_modules/@aws-sdk/client-dynamodb/dist-cjs/models/models_0.js:1414:40)
at PROJECT_DIR/node_modules/@aws-sdk/middleware-logger/dist-cjs/loggerMiddleware.js:16:21
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async file://PROJECT_DIR/src/getItem.js:12:18
Node.js v18.3.0
|
@yenfryherrerafeliz any update on this? Isn't my proposed solution good enough? #4222 (comment) |
Hello @adrai, I have not updates yet. I have reviewed your proposed solution and I agree it could fix the problem, however, this still needs to be reviewed by the team. I will provide updates as soon as possible. Thanks! |
This was brought up here and it is a known issue and assigned a @avegao @adrai @bluepeter @tushar-sg Please comment on issue as well so it will be clear that this is impacting more people. Thank you, |
@RanVaknin since the used SDK version is different, I don't thing the root cause of that issue is the same... |
Facing this issue as well. A temporary solution while the cause has been found might as well be changing
and its siblings to if (obj?.S !== undefined) return { S: obj.S }; |
opened a PR with a fix: #4249 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
Checkboxes for prior research
Describe the bug
Updating from 3.208.0 to 3.209.0 has issues when the retrieved object in dynamodb contain null values.
generates:
SDK version number
@aws-sdk/client-dynamodb@3.209.0
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
v16.13.1
Reproduction Steps
Observed Behavior
generates:
Expected Behavior
should marshall without errors
Possible Solution
downgrade to 3.208.0
Additional Information/Context
see #4222 (comment)
maybe also related: #3846, #4237
The text was updated successfully, but these errors were encountered: