我正在通过 Chalice 部署一个 Python 3.7 Lambda 函数。由于代码及其环境要求大于 50 MB 限制,因此我使用 Chalice 的“自动层”功能生成具有要求的层,即awswrangler
.
因为生成的层大于 50 MB,所以我将managed-layer-...-python3.7.zip
手动上传到 s3 并创建一个 Lambda 层。然后我使用 chalice 重新部署,删除该automatic_layer
选项并将其设置为layers
我手动创建的层的生成 ARN。
以这种方式部署的功能运行正常几次,然后开始偶尔出现“Segmentation Fault”失败。错误率很快就增加了,现在它失败了 100%。
Traceback:
> OpenBLAS WARNING - could not determine the L2 cache size on this system, assuming 256k
> START RequestId: 3b98bd4b-6cda-4d21-8090-1a49b17c06fc Version: $LATEST
> OpenBLAS WARNING - could not determine the L2 cache size on this system, assuming 256k
> END RequestId: 3b98bd4b-6cda-4d21-8090-1a49b17c06fc
> REPORT RequestId: 3b98bd4b-6cda-4d21-8090-1a49b17c06fc Duration: 7165.04 ms Billed Duration: 7166 ms Memory Size: 128 MB Max Memory Used: 41 MB
> RequestId: 3b98bd4b-6cda-4d21-8090-1a49b17c06fc Error: Runtime exited with error: signal: segmentation fault (core dumped)
> Runtime.ExitError
由于awswrangler
本身需要boto3&botocore,而且它们已经在Lambda环境中,所以我怀疑不同版本的boto可能存在冲突。我通过在需求中明确包含 boto3 和 botocore 来尝试相同的流程,但我仍然收到相同的分段错误错误。
任何帮助深表感谢。