Skip to content

"EndpointError: Credentials-sourced account ID parameter is invalid" on DynamoDB command #6977

@atresca-growie

Description

@atresca-growie

Checkboxes for prior research

Describe the bug

When sending Get/Post commands to Dynamo we are getting "EndpointError: Credentials-sourced account ID parameter is invalid".

Dynamo client is initialized without credentials since we are using IAM roles.

this.db = new DynamoDBClient({
        apiVersion: '2012-08-10',
        region: 'us-east-1',
      });

We do not know the exact version in which fails since this Lambdas don't have the sdk on the bundle, we are using "Lambda Provided JS SDK v3" due to a Lambda size limit problem we were facing on that repository.

HOW DO WE SOLVE IT: We were able to add only the "client-dynamodb" lib and the "lib-dynamodb" (just in case...) on our bundle with a prior version (v3.489) and it worked again. We check that there was a related/similar issue and tried v3.662 and v3.775 versions which should be stable but wasn't the case.

Error started occurring on Friday 03/21 on "Lambda Provided JS SDK v3"

Regression Issue

  • Select this option if this issue appears to be a regression.

SDK version number

@aws-sdk/client-dynamodb

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

v20.18.2

Reproduction Steps

import { DynamoDBClient, GetItemCommand } from "@aws-sdk/client-dynamodb";

const client = new DynamoDBClient({ apiVersion: '2012-08-10', region: "us-east-1" }); // Change region if needed

const getItem = async () => {
    const params = {
        TableName: "YourTableName", // Replace with your actual table name
        Key: {
            userId: { S: "12345" }, // Replace with the actual partition key value
        },
    };

    try {
        const command = new GetItemCommand(params);
        const response = await client.send(command);
        console.log("Item:", response.Item);
    } catch (error) {
        console.error("Error:", error);
    }
};

getItem();

Observed Behavior

Error started happening on a repository using aws-sdk directly from the Lambda runtime, it wasn't happening on repos with bundled sdk (tough we are using package-lock, so we have old versions of the sdk and wouldn't have detected the issue).

We did a test with a working repo in which we changed the bundled version in our package-lock from v3.489 to v3.705 and it broke.

Expected Behavior

We expect for the get command to execute without failure

Possible Solution

Reverting to a prior version (v3.489 worked for us)

Additional Information/Context

No response

Metadata

Metadata

Assignees

Labels

closed-for-stalenessguidanceGeneral information and guidance, answers to FAQs, or recommended best practices/resources.p2This is a standard priority issueresponse-requestedWaiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions