- Newest
- Most votes
- Most comments
It is unclear why there is a problem with Lambda execution but no output is output to CloudWatch Logs, but are logs output when running with the Lambda test button?
Is API Gateway created using HTTP API?
For HTTP API, the following settings may be required.
I think you can get the error by using the "$context.integrationErrorMessage" log variable.
https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-troubleshooting-lambda.html
Hello.
If EFS mounting fails from Lambda, I think something will be output to CloudWatch Logs.
Was there a policy set for Lambda's IAM role to output logs to CloudWatch Logs?
https://repost.aws/knowledge-center/lambda-invoke-efs
Basically, I think you can identify the problem by looking at the logs, but if the service runs on a VPC, you also need to check the settings around the network, so in that case, use "Reachability Analyzer" to check communication.
https://repost.aws/knowledge-center/vpc-connectivity-reachability-analyzer
According to @Riku_Kobayahi's insight, the ability to detect it faster may have been the "$context.integrationErrorMessage" logging variable on the Api gateway sitting in front of my Lambda. https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-troubleshooting-lambda.html
I can't test it now, but appears that that variable should output some more informative messaging about the cause of the Lambda integration error.
Relevant content
- Accepted Answerasked 6 months ago
- asked a year ago
- asked 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
Yes, my Lambda was correctly configured to write to logs. Once the connectivity issue was resolved, it started writing log messages again. But while the connectivity issue persisted, no log messages were written, making it very difficult to determine the cause. I have an Api Gateway in front of the Lambda, so I turned on logging there, and could see the Api Gateway sending Lambda integration requests, but receiving the 500 error. But past that, there were no log messages available anywhere.
Reachability Analyzer is a useful tool, but I would not have thought of it until I suspected a network issue with EFS. Suspecting an issue with the EFS connection is what took most of the time.
It is unclear why there is a problem with Lambda execution but no output is output to CloudWatch Logs, but are logs output when running with the Lambda test button? Is API Gateway created using HTTP API? For HTTP API, the following settings may be required. https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-troubleshooting-lambda.html
Good eye on noticing the logging variable for the HTTP api gateway. I believe that would give more information about the issue. I'd like to mark a comment of yours as the solution, so if you want the points, go ahead and repost your comment as a top level answer, and I'll accept it. Cheers.