dynamodbDocClient error
See original GitHub issueDescribe the bug
A clear and concise description of what the bug is. When i use the V3 DynamoDBClient code getting error
import { dbResult, DynamoCodeSystem } from './types'
import { DynamoDBClient, GetItemCommand, PutItemCommand } from '@aws-sdk/client-dynamodb'
import { marshall, unmarshall } from '@aws-sdk/util-dynamodb'
import { TsRequest, CsMetaLoad } from 'src/interfaces/tsRequest'
import { getDynamoConfig, getDynamoDbTableName } from '@libs/dynamoDb/config'
export const getCodeSystem = async (cs:string) : Promise<DynamoCodeSystem|null> => {
const dbclient = new DynamoDBClient(getDynamoConfig());
const { Item } = await dbclient.send(new GetItemCommand({
TableName: getDynamoDbTableName(),
Key: marshall({
key1: 'CodeSystem',
key2: cs,
}),
ProjectionExpression: 'deleted, meta'
}));
if (Item===undefined)
return null;
const item = unmarshall(Item);
if (item.deleted===1)
return null;
return item.meta;
};
2021-08-02T23:05:01.169Z be4582ab-8839-4ca5-8fd1-723ba28054b4 INFO New DBDOC Clinet Aug 01 Error CredentialsProviderError: Could not load credentials from any providers at providers (/var/task/node_modules/@aws-sdk/client-dynamodb/node_modules/@aws-sdk/credential-provider-node/src/index.ts:66:13) at /var/task/node_modules/@aws-sdk/client-dynamodb/node_modules/@aws-sdk/property-provider/src/chain.ts:20:18 at processTicksAndRejections (internal/process/task_queues.js:95:5) at SignatureV4.credentialProvider (/var/task/node_modules/@aws-sdk/client-dynamodb/node_modules/@aws-sdk/property-provider/src/memoize.ts:72:22) at SignatureV4.signRequest (/var/task/node_modules/@aws-sdk/client-dynamodb/node_modules/@aws-sdk/signature-v4/src/SignatureV4.ts:220:25) at /var/task/node_modules/@aws-sdk/client-dynamodb/node_modules/@aws-sdk/middleware-signing/src/middleware.ts:28:18 at StandardRetryStrategy.retry (/var/task/node_modules/@aws-sdk/client-dynamodb/node_modules/@aws-sdk/middleware-retry/src/StandardRetryStrategy.ts:83:38) at /var/task/node_modules/@aws-sdk/client-dynamodb/node_modules/@aws-sdk/middleware-logger/src/loggerMiddleware.ts:22:22 at data (/var/task/node_modules/@aws-sdk/lib-dynamodb/src/commands/GetCommand.ts:48:20) at /var/task/src/functions/csLoadReq/webpack:/ts-load/src/libs/dynamoDb/codeSystem.ts:61:11 { tryNextLink: false, ‘$metadata’: { attempts: 1, totalRetryDelay: 0 } }
Your environment
SDK version number
@aws-sdk/package-name@version
Is the issue in the browser/Node.js/ReactNative?
Browser/Node.js/ReactNative
Details of the browser/Node.js/ReactNative version
Paste output of npx envinfo --browsers
or node -v
or react-native -v
Steps to reproduce
Please share code or minimal repo, and steps to reproduce the behavior.
Observed behavior
A clear and concise description of what happens.
Expected behavior
A clear and concise description of what you were expecting to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7 (3 by maintainers)
@hectorgabucio Good to know it’s fixed!
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.