Skip to content

When using slim, .so files are being broken #318

Open
@ysgit

Description

@ysgit

Issue was mentioned on thread for another issue - #216 (comment)

Trying to deploy python lambda app using circleci. Build and deploy is successful but then when lambda runs we get the following error

Runtime.ImportModuleError: Unable to import module 'src.aws_lambda.handlers': /tmp/sls-py-req/PIL/_imaging.cpython-37m-x86_64-linux-gnu.so: ELF load command address/offset not properly aligned

Plugin configuration:

custom:
  pythonRequirements:
    fileName: requirements-prod.txt
    dockerizePip: true
    zip: true
    slim: true
    useStaticCache: true
    useDownloadCache: true
    cacheLocation: './.serverless-python-cache'

Same serverless.yml configuration works when I run it from my own mac OS computer.

On circleci I've tried using dockerizePip: true with the circleci/classic:201808-01 machine and using dockerizePip: non-linux using the circleci/python:3.7-node docker image. In the latter case the whole build takes place in the circleci docker container - originally I thought this was the cause of the issue.

I don't think I can stop using slim because the file not meet the aws lambda requirements.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions