DynamoDB code EBUSY?

0

I'm getting this error when doing biggish DynamoDB queries

{
    "errno": -16,
    "code": "EBUSY",
    "syscall": "getaddrinfo",
    "hostname": "dynamodb.us-east-1.amazonaws.com",
    "$metadata": {
        "attempts": 1,
        "totalRetryDelay": 0
    }
}

I am using NodeJS AWS SDK for JavaScript v3. I don't recall seeing this when I was using v2. I've searched for possible fixes for this but am coming up empty. Has anybody seen and resolved this issue?

mreed
asked 3 months ago378 views
2 Answers
0

Hi,

From https://www.gnu.org/software/libc/manual/html_node/Error-Codes.html

EBUSY: “Device or resource busy.” A system resource that can’t be shared is already in use. For example, if you try to delete a file that is the root of a currently mounted filesystem, you get this error.

If you google it, you'll see that many kinds of low-level system errors produce produce this kind of message. Did you look at ClouWatch to see if you get more details there ?

Best,

Didier

profile pictureAWS
EXPERT
answered 3 months ago
0

Thank you @Didier for your response. I am aware of the meaning of the error but unclear how to resolve it. Regarding CloudWatch, there is nothing but I think that's because this is a response to a query rather than an error. I am using Node20 (not mentioned initially) and my function is a pretty standard query (below). It doesn't service high volumes of traffic and the EBUSY error tends to surface randomly when the query returns 15k+ rows or so.

const dynamoClient = new DynamoDBClient({});

	async getAllTableItems(tableName, pkId, pkValue) {

		let queryParams = {
			TableName: tableName,
				KeyConditionExpression: "#pkid = :pkValue",
			ExpressionAttributeNames: {
				"#pkid": pkId
		  },
			ExpressionAttributeValues: {
				":pkValue": {"S": pkValue},
			},
			Limit: 100
		};
		let result = [];
		let items;
		do {
			let command = new QueryCommand(queryParams);
			items = await dynamoClient.send(command);
			items.Items.forEach((item) => result.push(unmarshall(item)));
			queryParams.ExclusiveStartKey = items.LastEvaluatedKey;
		} while (typeof items.LastEvaluatedKey != "undefined");
			return result;
	}
mreed
answered 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions