[英]Unable to import module 'lambda_function': /lib64/libc.so.6: version `GLIBC_2.18' not found
We need to do file transfer from AWS lambda to remote machine.我们需要将文件从 AWS lambda 传输到远程机器。 We are using fabric for this.
我们为此使用织物。 Till last week, AWS lambda is working fine.
直到上周,AWS lambda 运行良好。 Today we created new zip file and uploaded to AWS lambda and it is throwing below error.
今天我们创建了新的 zip 文件并上传到 AWS lambda,它抛出以下错误。
[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.但是,如果我们将旧的 zip 文件(上周 zip 文件)上传到 AWS lambda,它工作正常。 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'.我观察到的两个 zip 文件的唯一区别是旧的 zip 文件包含“pip-20.1.1.dist-info”,新的 zip 文件包含“pip-22.0.4.dist-info”。
I went through lot of stack overflow questions and did some research online as below.我经历了很多堆栈溢出问题,并在网上做了一些研究,如下所示。
Lambda function failing with /lib64/libc.so.6: version `GLIBC_2.18' not found Lambda function 因 /lib64/libc.so.6 失败:未找到版本“GLIBC_2.18”
https://github.com/pyca/cryptography/issues/6390 https://github.com/pyca/cryptography/issues/6390
https://github.com/pyca/cryptography/issues/6391 https://github.com/pyca/cryptography/issues/6391
https://github.com/zappa/Zappa/issues/1063 https://github.com/zappa/Zappa/issues/1063
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.并建议将加密降级到 3.4.8 以解决此问题。 I downgraded as suggested but it didn't fix the issue.
我按照建议降级,但没有解决问题。
I also downgraded pip version.我还降级了 pip 版本。 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.
现在新的 zip 文件也包含相同的“pip-20.1.1.dist-info”,但我仍然面临与新的 zip 文件相同的问题。
More details:更多细节:
I am using virtualenv.我正在使用虚拟环境。 My requirements.txt only contains one line
fabric==2.7.1
.我的 requirements.txt 只包含一行
fabric==2.7.1
。 I am installing the packages locally on aws ec2 instance under virtualenv using pip install -r requirements.txt
.我正在使用
pip install -r requirements.txt
在 virtualenv 下的 aws ec2 实例上本地安装软件包。
Can anyone please let me know how to fix the issue.谁能告诉我如何解决这个问题。
It looks mostly like a deployment issue.它看起来主要是部署问题。 Either of the two:
两者之一:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.