Error occur when invoking Lambda function

0

When I invoke the lambda function the test succeeds, but get the following error. There seems to be no significant error according to the logs too.

The execution log: { "statusCode": 500, "body": ""An error occurred"" }

Log Output: START RequestId: a1a2fe4b-8a44-49fc-ba39-c5f76efd159e Version: $LATEST END RequestId: a1a2fe4b-8a44-49fc-ba39-c5f76efd159e REPORT RequestId: a1a2fe4b-8a44-49fc-ba39-c5f76efd159e Duration: 108.42 ms Billed Duration: 109 ms Memory Size: 128 MB Max Memory Used: 84 MB Init Duration: 470.16 ms

Lambda function: index.js

Test deployed: { "body": "{"input_text": "Example text", "input_file_path": "s3://bucket-name/file-path"}" }

  • Can you add some logs to your catch block to understand your exception, its likely DynamoDB is throwing an exception.

2 Answers
-1

I would like to see the details of the error.
Can you confirm this by adding the following statement under line 34?

console.error(error);

Also, the item to put is not in the form of a key value, is this a problem?
https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html#put-property

profile picture
EXPERT
answered 10 months ago
-1

In another question you have troubles with nano id import, was that solved?

profile picture
EXPERT
answered 10 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