I'm trying to use the JavaScript v3 api to retrieve a single item from DynamoDB in a nodejs lambda. I'm getting UnknownOperationException. Here's the parameter object I'm passing into GetItemCommand:
{
"TableName": "test_biblestudy_tools_user",
"Key": {
"userid": {
"S": "06f4dc4b-3368-4277-9dbe-892edec668c6"
}
},
"ProjectionExpression": "email"
}
The lambda's execution role has GetItem on the table.
One thing I wanted to do was turn on HTTP wire tracing for this, but I didn't see any example of how to do that when using the JavaScript v3 api. Right now all I'm configuring is the region, and I don't know how to configure anything else:
import { DynamoDBClient, GetItemCommand, TransactWriteItemsCommand } from '@aws-sdk/client-dynamodb';
const db_client = new DynamoDBClient({ region: 'us-east-1' });
How can I configure this client for http wire trace? Would that likely show me something useful here? I tried CloudTrail Data Plane Event Logging, but the failed call doesn't create a log.
Here's the full error from the CloudWatch log:
UnknownOperationException: UnknownError
at throwDefaultError (/var/task/node_modules/@aws-sdk/client-dynamodb/node_modules/@aws-sdk/smithy-client/dist-cjs/default-error-handler.js:8:22)
at deserializeAws_json1_0GetItemCommandError (/var/task/node_modules/@aws-sdk/client-dynamodb/dist-cjs/protocols/Aws_json1_0.js:1740:51)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async /var/task/node_modules/@aws-sdk/client-dynamodb/node_modules/@aws-sdk/middleware-serde/dist-cjs/deserializerMiddleware.js:7:24
at async StandardRetryStrategy.retry (/var/task/node_modules/@aws-sdk/middleware-retry/dist-cjs/StandardRetryStrategy.js:51:46)
at async /var/task/node_modules/@aws-sdk/middleware-logger/dist-cjs/loggerMiddleware.js:6:22
at async Runtime.handler (file:///var/task/index.js:139:23) {
'$fault': 'client',
'$metadata': {
httpStatusCode: 400,
requestId: 'c688c34f-7c64-4d9a-9eb4-3258ee5aecf6',
extendedRequestId: undefined,
cfId: undefined,
attempts: 1,
totalRetryDelay: 0
},
__type: 'com.amazon.coral.service#UnknownOperationException'
}
Please share the full code snippet you are trying to execute.