Issue with `cffi` package in aws/codebuild/amazonlinux2-x86_64-standard:3.0
Describe the bug
We used to build an SAM app using the aws/codebuild/amazonlinux2-x86_64-standard:2.0, and all were running perfectly. The build stages includes the pip install of a requirements.txt set of packages, as well as a sam package. The requirements.txt doesn't include the cffi package, so it must be included within the image somewhere.
Due to that version being decommissioned, we changed the build image to aws/codebuild/amazonlinux2-x86_64-standard:3.0. Since changing to that, the builds succeed but we get the following error when invoking that lambda:
[ERROR] Runtime.ImportModuleError: Unable to import module 'operations.executor': No module named '_cffi_backend'
We tried many different fixes, but all of them failed:
- Installing the package through the requirements.
- Installing the package after the requirements, separately (pip install cffi).
- Force reinstalling it (pip -vvv install --upgrade --force-reinstall cffi).
- Changing the image to Ubuntu:5.0
To Reproduce Not sure how to reproduce the error, as I can't trace where that package is located.
Expected behavior I expect that the AL2-standard:3.0 image to have the same behaviour as the 2.0.
Logs
[ERROR] Runtime.ImportModuleError: Unable to import module 'operations.executor': No module named '_cffi_backend'
Platform (please complete the following information):
- Codebuild using the aws/codebuild/amazonlinux2-x86_64-standard:3.0
- Lambda running on python 3.8, x86_64
Additional context Add any other context about the problem here.
I am having exact same situation, tried using docker image but still no luck. let me know if you find any solution regarding it