We need to do file transfer from AWS lambda to remote machine. We are using fabric for this. Till last week, AWS lambda is working fine. Today we created new zip file and uploaded to AWS lambda and it is throwing below error.
[ERROR] Runtime.ImportModuleError: Unable to import module 'lambda_function': /lib64/libc.so.6: version `GLIBC_2.18' not found (required by /var/task/cryptography/hazmat/bindings/_rust.abi3.so)
But if we upload old zip file (last week zip file) to AWS lambda, it is working fine. Not sure why this is happening as we haven't done any changes.
The only difference I observed with both zip files is old zip file contains 'pip-20.1.1.dist-info' and new zip file contains 'pip-22.0.4.dist-info'.
I went through lot of stack overflow questions and did some research online as below.
Above links are suggesting that
cryptography>=35.0, plus pip>=20.3 - downloads wrong cryptography anywheel package (GLIBC_2.18 error) #1063
and suggesting to downgrade cryptography to 3.4.8 to fix the issue. I downgraded as suggested but it didn't fix the issue.
I also downgraded pip version. Now new zip file also contains same 'pip-20.1.1.dist-info' but still I am facing the same issue with the new zip file.
More details :
I am using virtualenv. My requirements.txt only contains one line fabric==2.7.1
. I am installing the packages locally on aws ec2 instance under virtualenv using pip install -r requirements.txt
.
Can anyone please let me know how to fix the issue.