Skip to content
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

Latest version of cryptography 2.2.1 fails on module import #764

Closed
dmulter opened this issue Mar 24, 2018 · 3 comments · Fixed by #785
Closed

Latest version of cryptography 2.2.1 fails on module import #764

dmulter opened this issue Mar 24, 2018 · 3 comments · Fixed by #785
Labels

Comments

@dmulter
Copy link
Contributor

dmulter commented Mar 24, 2018

I've been using a 2.x version of the cryptography package with no problem for some time. I had version 2.1.4 as the latest until today, when I upgraded to 2.2.1. This new version reports no problem during chalice deploy, but I get errors in my CloudWatch logs when I make requests into the app:

Unable to import module 'app': No module named 'cryptography'

@dmulter dmulter changed the title Latest version of cryptography 2.2.1 fails to work Latest version of cryptography 2.2.1 fails on module import Mar 24, 2018
@stealthycoin
Copy link
Contributor

Interesting for me I do get an error:

(chalice) ➜  test-crypto chalice deploy
Creating deployment package.

Could not install dependencies:
cryptography==2.2.1
You will have to build these yourself and vendor them in
the chalice vendor folder.

Your deployment will continue but may not work correctly
if missing dependencies are not present. For more information:
http://chalice.readthedocs.io/en/latest/topics/packaging.html

I will have to dig into this as its not readily apparent to me why this is the case. Checking the deployment packages it looks like the entire cryptography/ subdirectory tree is missing from the 2.2.1 whereas it is in 2.1.4. I did check to see that 2.2.2 did not resolve the issue and it does not.

Also looking at their changelog

BACKWARDS INCOMPATIBLE: Support for Python 2.6 has been dropped.

is the only big thing I see in there but that shouldn't be relevant.

@stealthycoin
Copy link
Contributor

@dmulter I dug into this a little more and it looks like cryptography switched their python 3 wheels to use the stable ABI abi3 which works for any version of cpython 3. So they no longer upload wheels with specific ABIs like cp36m which is what Lambda uses. Which means the packager that Chalice uses fails to find the compatible one since it is looking for an explicit python 36 one.

So this will need to be updated in the Chalice packager to fallback on the abi3 if it cannot find it. I will mark this as a bug since cryptography used to work and now doesn't for new versions. To unblock yourself you can either use python 2 which doesn't have a general abi. Or you can lock to 2.1.4 of cryptography which still has all the extra wheel files.

@dmulter
Copy link
Contributor Author

dmulter commented Apr 4, 2018

Thanks for the investigative work, nice job. I'll keep crypto locked till the bug is resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants