My Lambda function is not getting invoked all of a sudden.

2

Hi,I had written a lambda function, and it was working as per the requirement. But suddenly past 2 days the lambda function is not getting invoked. I'm invoking the lambda function from java end using the "invokeAsync(req)" method. But same function if run on the AWS console,it works fine. I am using US-EAST-1 region. It was working fine for the past 25 days but stopped working for the past 2 days. ie the lambda function is not getting invoked by the "invokeAsync (req)" method from Java end. I am stuck in this for the past 2 days and not getting where I am going wrong. Please can anyone help? I tried asking it on stack overflow.But my question is getting downvoted and deleted though I had uploaded my code and all the dependencies I am using. Any help appreciated. Thanks!

已提問 2 年前檢視次數 3533 次
3 個答案
1

Debug issue :

  1. First make sure that the IAM Role attached to your Lambda function has CloudWatch log write access.
  2. Now try to invoke the lambda function and switch to monitor tab in lambda console and click the CloudWatch log button.
  3. You will be redirected to the logs, open the latest log and see if there are some error logged.
  4. Make sure that the service that invokes the lambda function has sufficient permission.

**Maybe its region issue : **

If you are experiencing issues for Lambda service in us-east-1 region.

You can check the health status here.

**Still facing issue : **

Please contact the AWS Support team. They might be able to look into your lambda function and account to find the cause.

已回答 2 年前
  • How do I contact AWS support? is there any email? I was redirected back to ask the question here. Please can you send their email id?

0

Start with the CloudWatch logs (check under the monitor tab in the console for a link to the logs if you don't know where they are) and check if the lambda is being triggered at all. If it is then there is an issue with the lambda and add some debug output to check in cloudwatch, if it's not then it could be a policy issue. Maybe invoke it synchronously from java and see if you have any error messages you can work with.

已回答 2 年前
  • Hi , Sorry I forgot to mention about the cloud watch logs, the cloud watch logs are empty, meaning the most recent logs are the logs, from 2 days prior(as I have mentioned in the question.) After that I havent got any logs. I can post a pic here of them, but I dont think theres an option to post a pic here.

  • Then your lambda isn't being triggered, or doesn't have permission to log to cloudwatch (that doesn't make sense if you can run it from the console and it logs).

    Something changed in the last 2 days, probably some configuration/permission..

    I would start by eliminating the obvious:

    • test that it is still working via the console
    • call it asynchronously in the code you have
    • add a DLQ maybe?
    • call it in the same way you are in java, but from a different environment
    • check your environment that you are calling the lambda from
0

What calls the Lambda function? Is it tied to an API gateway? An S3 event? An EventBridge rule? Directly from a client application?

The first place I'd check is in the CloudWatch logs to see if any errors are being reported.

The second place I'd check is CloudTrail to see what happened around the time that the Lambda function stopped working. Is it possible that someone updated an IAM role or policy? Maybe a new SCP was enabled? Perhaps a NACL or security group is preventing a call from getting to your Lambda?

profile pictureAWS
專家
已回答 2 年前
  • Hi , Sorry I forgot to mention about the cloud watch logs, the cloud watch logs are empty, meaning the most recent logs are the logs, from 2 days prior(as I have mentioned in the question.) After that I havent got any logs. I can post a pic here of them, but I dont think theres an option to post a pic here.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南