Tal Perry
Tal Perry

Reputation: 161

DynamoDB not triggering lambda

I'm experimenting with dynamo db and lambda and am having trouble with the following flow:

Lambda A is triggered by a put to S3 event. It takes the object, an audio file, calculates its duration and writes a record in dynamoDB for each 30 second segment.

Lambda B is triggered by dynamoDB, downloads the file from S3 and operates on the 30 second record defined in the dynamo row.

My trouble is that when I run this flow, function A writes all of the rows required to dynamo, by function B

Configuration

Things I've confirmed

Has anyone had similar issues? Any idea what to check next? Thanks

Upvotes: 5

Views: 9513

Answers (3)

jd11
jd11

Reputation: 129

I was also encountering similar problem where dynamoDB trigger is either not triggered or it was triggered with OLD image.

Go to lambda console configuration tab > Triggers enter image description here I found it says "Last processing result: PROBLEM: Function call failed". I then realized it is because the prior lambda trigger execution was NOT successful, which leads it keeps using OLD image to retry and retry but it just keeps failing.

In the end I found the failing reason is because, the lambda timeout time is set to 25 second, so it keeps failing due to timeout (my lambda contains lots of long-waiting async logic, so it takes long time to execute)

Go to Lambda console > General configuration Info tab > change the timeout period to 5min, it solves the problem :)

Upvotes: 0

Zolcsi
Zolcsi

Reputation: 2046

I had the same problem, the solution was to create a VERSION from the Lambda and NOT to use the $LATEST Version, but a 'fixed' one.

It is not possible to use the latest ever-changing version to build a trigger upon.

Place to do that: Lambda / Functions / YourLambdaName / Qualifiers Dropdown on the page / Switch versions/aliases / Version Tab -> check that you have a version

If not -> Actions / Publish new version

Upvotes: 5

Ankur
Ankur

Reputation: 11

Check for DynamoDB "Stream" is it is enabled on the table.

Checkout this

5 min timeout is default for lambda, you can find this mentioned in forums.

Upvotes: 1

Related Questions