Invoking a python lambda via SAM results in timeout when Sentry lambda layer is referenced
How do you use Sentry?
Sentry Saas (sentry.io)
Version
1.9.3
Steps to Reproduce
- Add Sentry layer to the cloudformation within a python SAM application
- Invoke the lambda via
sam invoke local
I have created a sample repo that is purely just the output of the sam init generator with the Sentry lambda layer added to the cloudformation to easily reproduce.
https://github.com/neville1355/sam-app-with-sentry-example
Expected Result
Lambda should execute normally
Actual Result
The lambda always times out no matter what
Note that the lambda doesn't timeout in AWS. It only times out when running via sam local invoke which is used for development purposes only.
This is a blocker for us fully adopting Sentry as we can't locally run our lambda code while the lambda layer is being referenced.
Hey @neville1355 !
Better late than never. I just ran your repro function with sam locally and it did hang.
The thing is that the template references arn:aws:lambda:us-east-1:943013980633:layer:SentryPythonServerlessSDK:33 (Sentry layer version 33).
If I update the later to the latest one (arn:aws:lambda:us-east-1:943013980633:layer:SentryPythonServerlessSDK:80) everything works as excepted.
FYI (or anyone that finds this issue): You can update the the used Sentry layer version of you Lambda functions by going to Sentry.io > Settings > Integrations > AWS Lambda and hit the "Update" button in the UI. See https://docs.sentry.io/product/integrations/cloud-monitoring/aws-lambda/#configure how this looks like.
As this issue has been resolved, I am closing it.