-
Notifications
You must be signed in to change notification settings - Fork 494
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
Cannot import appengine #2051
Comments
Hey @firaskafri ! Thanks for reporting this. Can you post the error with stacktrace you get in your project when you try to import appengine? |
|
Hello! As one of the urllib3 maintainers, I'd be happy to help, but so far we have no idea what the issue is, which is why an actual error with a traceback would be nice, as it would help understand where the issue is. (I don't think sentry-python imports |
Thanks @pquentin, I came here because in AWS Lamdba I got:
It might or might not be related. But I notice that the link in the error is sending directly to you ;) |
Thanks! Note that this is different from the App Engine issue above. (And it has nothing to do with sentry-python.) It is a known issue with Amazon Linux 2 (the default AWS Lambda distribution) that is using OpenSSL 1.0.2, a version that has not been supported by the OpenSSL project for 3+ years now. My understanding is that Amazon Linux 2 is applying RHEL 7 patches to keep this version secure. Anyway, I believe you have the following options:
|
urllib3 contributor @illia-v was surprised by the above statement, since Python 3.10 requires OpenSSL 1.1.1. They kindly checked the OpenSSL versions in AWS Lambda, with the following results:
Good news! The best fix here is actually to upgrade your runtime to Python 3.9+. I've edited my comment above. |
hey I'm gonna pin to < 2.0.0 for now, and investigate if we need any other changes separately and also wait for the ecosystem to stabilize |
@pquentin with 3.9 and 3.10 I still get
The simplest solution is indeed |
@mattiamatrix This is a different issue though: botocore (and by extension boto3) does not support urllib3 2.0 yet: boto/botocore#2926. Make sure to use a recent enough pip when installing your dependencies! botocore pins urllib3<1.27 so you should never have seen urllib3 2.0 in the first place. But at least if you're using 3.9 or 3.10 you'll be ready when boto3 starts supporting urllib3 2.0. I would recommend this long read on the best approach to handle Python dependencies: https://hynek.me/articles/semver-will-not-save-you/ |
Thank you @pquentin, you are great! |
I'm starting to see users that cannot use urllib3 2.0 because they use sentry-sdk: uktrade/enquiry-mgmt-tool#589. Unless there's an actual compatibility issue, I don't think pinning to urllib3<2 should be your decision. https://hynek.me/articles/semver-will-not-save-you/ explains it well, here's the relevant excerpt.
(And, yes, this was written before urllib3 released 2.0., but this is no longer hypothetical now.) |
How do you use Sentry?
Sentry Saas (sentry.io)
Version
1.18.0
Steps to Reproduce
Install the SDK within any project that is not pinning urllib3 < 2.0.0
Expected Result
ability to import appengine
Actual Result
Cannot import appengine as gaecontrib.
As per urllib 2.0.0 release: https://github.com/urllib3/urllib3/tree/2.0.0
Removed urllib3.contrib.appengine.AppEngineManager and support for Google App Engine Standard Environment (urllib3/urllib3#2044).
The text was updated successfully, but these errors were encountered: