Envelopes get lost when Lambda Extension is shut down
How do you use Sentry?
Sentry Saas (sentry.io)
Version
1.7.2
Steps to Reproduce
I you have the AWS Lambda integration sometimes in the Cloudwatch logs (and on Sentry.io) the following error is shown: error processing envelope: envelope exceeded its configured lifetime.
Looking into the surrounding log statements we saw that this error is always appearing right when a SIGTERM is received.
2022-07-20T10:44:02Z [relay_server::actors::envelopes] ERROR: error processing envelope: envelope exceeded its configured lifetime
--
2022-07-20T10:44:02Z [relay_server::actors::envelopes] ERROR: error processing envelope: envelope exceeded its configured lifetime
2022-07-20T10:44:02Z [relay_aws_extension::aws_extension] INFO: AWS extension stopped
2022-07-20T10:44:02Z [relay_system::controller] INFO: SIGTERM received, stopping in 2s
2022-07-20T10:44:02Z [actix_net::server::worker] INFO: Shutting down worker, 0 connections
2022-07-20T10:44:02Z [actix_net::server::worker] INFO: Shutting down worker, 0 connections
Expected Result
The relay in the Lambda extension should process envelopes correctly even when a SIGTERM is received.
Actual Result
The error error processing envelope: envelope exceeded its configured lifetime showing up in Sentry and the CloudWatch logs.
seeing this with SentryPythonServerlessSDK:30 (sentry-sdk==1.9.0) as well
Also seeing it in our lambda integration errors. Is there a fix forthcoming or some workaround?
+1
We removed relay from the Lambda layer, so this issue is now not relevant anymore.
You can go to Sentry.io > Settings > Integrations > AWS Lambda where you can update the Lambda layer of your functions to the latest. This will get rid of the error. See https://docs.sentry.io/product/integrations/cloud-monitoring/aws-lambda/#configure