question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AWS Lambda Python 3.9 support

See original GitHub issue

Environment

AWS Lambda with Python 3.9 runtime. Sentry sdk version sentry-sdk==1.3.1

Steps to Reproduce

  1. Change lambda runtime to Python 3.9
  2. Raise exception

Expected Result

Error should appear in the sentry dashboard.

Actual Result

Nothing happens.

I found that in Python 3.9 runtime, AWS has changed bootstrap location, so return sys.modules["__main__"].bootstrap this is not working anymore. I fixed it with this sys.modules["__main__"].awslambdaricmain.bootstrap

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
aahungcommented, Nov 11, 2021

I was able to trick sentry in finding it by doing this:

import sys
from sentry_sdk.integrations.aws_lambda import get_lambda_bootstrap

sys.modules['bootstrap'] = get_lambda_bootstrap().awslambdaricmain.bootstrap
sentry_sdk.init()

@jonapich this is very helpful. Just tested and it works like a charm. The transactions are coming back.

3reactions
jonapichcommented, Nov 10, 2021

I was able to trick sentry in finding it by doing this:

import sys
from sentry_sdk.integrations.aws_lambda import get_lambda_bootstrap

sys.modules['bootstrap'] = get_lambda_bootstrap().awslambdaricmain.bootstrap
sentry_sdk.init()
Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS Lambda adds support for Python 3.9
AWS Lambda now supports Python 3.9 as both a managed runtime and a container base image. You can now author AWS Lambda functions...
Read more >
AWS Lambda with Python 3.9 not supported · Issue #1407
I create a AWS Lambda function based on Python 3.9 in the AWS Console. I create a new project in sentry.io and in...
Read more >
AWS Announces Python 3.9 Runtime Support for Lambda ...
Recently AWS announced the support for Python 3.9 as both a managed runtime and a container base image for its Function as a...
Read more >
When will AWS lambda support python 3.9?
AWS Lambda now supports Python 3.9 as both a managed runtime and a container base image. You can now author AWS Lambda functions...
Read more >
Python Version Support — AWS Chalice
Chalice supports all versions of python supported by AWS Lambda, ... If we were using python 3.9.6, chalice would automatically select python3.9 as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found