-
Notifications
You must be signed in to change notification settings - Fork 477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AwsLambdaIntegration crashes when lambda is triggered by EventBridge Pipe source #2545
Labels
Comments
davidcroda
added a commit
to davidcroda/sentry-python
that referenced
this issue
Nov 29, 2023
When a lambda is triggered by an AWS EventBridge pipe the record contains an explicit "header" key with an empty list. This breaks the assumption that headers is always a dict or None. Update the AwsLambdaIntegration to explicitly verify that header is a dict before passing it on to the `continue_trace` function. Fixes getsentryGH-2545
davidcroda
added a commit
to davidcroda/sentry-python
that referenced
this issue
Nov 29, 2023
…ders When a lambda is triggered by an AWS EventBridge pipe the record contains an explicit "header" key with an empty list. This breaks the assumption that headers is always a dict or None. Update the AwsLambdaIntegration to explicitly verify that header is a dict before passing it on to the `continue_trace` function. Fixes getsentryGH-2545
davidcroda
added a commit
to davidcroda/sentry-python
that referenced
this issue
Nov 29, 2023
When a lambda is triggered by an AWS EventBridge pipe the record contains an explicit "header" key with an empty list. This breaks the assumption that headers is always a dict or None. Update the AwsLambdaIntegration to explicitly verify that header is a dict before passing it on to the `continue_trace` function. Fixes getsentryGH-2545
davidcroda
added a commit
to davidcroda/sentry-python
that referenced
this issue
Nov 30, 2023
When a lambda is triggered by an AWS EventBridge pipe the record contains an explicit "header" key with an empty list. This breaks the assumption that headers is always a dict or None. Update the AwsLambdaIntegration to explicitly verify that header is a dict before passing it on to the `continue_trace` function. Fixes getsentryGH-2545
sentrivana
added a commit
that referenced
this issue
Dec 1, 2023
) When a lambda is triggered by an AWS EventBridge pipe the record contains an explicit "headers" key with an empty list. This breaks the assumption that headers is always a dict or None. Update the AwsLambdaIntegration to explicitly verify that header is a dict before passing it on to the `continue_trace` function. Fixes GH-2545 --------- Co-authored-by: Ivana Kellyerova <ivana.kellyerova@sentry.io>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How do you use Sentry?
Sentry Saas (sentry.io)
Version
1.38.0
Steps to Reproduce
The following is the stack trace that is printed out in the logs
Expected Result
Sentry is able to trace the function invocation
Actual Result
Sentry crashes and ends execution of the function.
The root of the issue seems to be that the
AwsLambdaIntegration
expects that if theheaders
key exists in the request, that it will be a dictionary. However when EventBridge triggers the lambda with data, it sends headers as an empty list. Sample payload below.This is where the error is caused in the lambda integration. https://github.com/getsentry/sentry-python/blob/master/sentry_sdk/integrations/aws_lambda.py#L140-L143
This should probably be inverted to set headers to an empty dict if it is not a dict, instead of checking only if it is None.
The text was updated successfully, but these errors were encountered: