6

I enabled streams on my dynamoDB table. As items are modified, a lambda function is triggered. I think I set up everything correctly both on the lambda trigger side, permissions, and dynamodb side. I also ran my lambda function with test data and it succeeded. However, when items are modified in the table, the trigger did not start my lambda function. Instead, I got the following error:

Batch size: 100 Last processing result: PROBLEM: Function call failed

Any idea what's the best way to debug this? I went on CloudWatch logs but there were no logs associated with the trigger/stream.

Thanks.

Edit: Logs for the lambda function (not its dynamodb trigger). The trigger didn't generate any log statements.

START RequestId: 3a08eedc-f0de-11e8-9008-033b48d2cb67 Version: $LATEST  18:16:28 END RequestId: 3a08eedc-f0de-11e8-9008-033b48d2cb67  18:16:28 REPORT RequestId: 3a08eedc-f0de-11e8-9008-033b48d2cb67 Duration: 81.85 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 30 MB

10
  • 1
    Q1: where did you see the "Batch size: 100 Last processing result: PROBLEM: Function call failed" ? Q2: what does "no logs associated with the trigger/stream." mean? where there any logs at all for the lambda (even though not related to the trigger/stream)? If there were, can you post them? Q3: Is this lambda invoked by a different event source? Q4 :How much RAM is allocated for that lambda? Commented Nov 24, 2018 at 20:03
  • Q1: I saw this msg when I click on the dynamodb trigger in the lambda console. Q2: Actually I don't think I set up logs with the trigger. How do you set up logs for the trigger? Thanks. Commented Nov 25, 2018 at 17:57
  • @ItayMaman, I updated the post with the log statements. The ram is 128 MB. Commented Nov 26, 2018 at 2:01
  • can you share the code of the lambda? Commented Nov 27, 2018 at 3:00
  • 1
    I think the issue has to do with the while loops and the batchgetitems and scans. I considered either doing recursion like you said or using async/await. But for the former I don't know if recursion stack will trigger other problems. And for the latter, it feels really unintuitive. Another issue is aws.documentClient in node.js uses callbacks instead of promises. So for the sake of simplicity I am switching to Java. Java and Python don't have the async issues that's in javascript/node.js. Commented Nov 27, 2018 at 23:05

5 Answers 5

2

I ran into this issue today.

  1. I debugged it by manually triggering the lambda with the Test button on the top of the main lambda page. It showed the error output trying to run my lambda.
  2. The reason I had an error was the handler parameter as I had a non-standard javascript function name and I forgot to configure that in my lambda.
Sign up to request clarification or add additional context in comments.

Comments

0

In my case, my lambda role did not have permissions to write to the SNS and the lambda code was writing to a SNS. So i added a policy to the lambda role giving it permissions to write to any SNS topic.

Comments

0

In my case, the problem came from the stream batch size 100. In the lambda code I was checking the event and I exit if the event doesn't meet the requirement.

Comments

0

In my case, the handler method was not configured correctly for the Lambda function written in Java. The format that I used for setting the handler is as follows

packageName.className::handlerMethod

For example, for my handler class

package com.example;

public class App implements
        RequestHandler<DynamodbEvent, String> {

    public String handleRequest(DynamodbEvent ddbEvent, Context context) {

the handler should be defined as

com.example.App::handleRequest

Comments

-2

This sounds like a possible use-case for Rookout if you need to follow variable values in your live Lambda in a situation where you're not able to generate logs and running it locally isn't going to give you real-world event trigger data.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.