aws-codebuild-docker-images icon indicating copy to clipboard operation
aws-codebuild-docker-images copied to clipboard

Issue with `cffi` package in aws/codebuild/amazonlinux2-x86_64-standard:3.0

Open purplexed opened this issue 3 years ago • 1 comments

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:

  1. Installing the package through the requirements.
  2. Installing the package after the requirements, separately (pip install cffi).
  3. Force reinstalling it (pip -vvv install --upgrade --force-reinstall cffi).
  4. 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.

purplexed avatar Jun 07 '22 16:06 purplexed

I am having exact same situation, tried using docker image but still no luck. let me know if you find any solution regarding it

thakoreh avatar Sep 12 '22 20:09 thakoreh