Open butla opened 6 years ago
I'm having the same issue here, did you find a fix for it?
Looks like an issue with compiled shared libraries trying to run on a different target system. This doesn't appear to be an issue with the lambda-uploader as much as an issue with not building the virtualenv in an Amazon Linux based system.
There are a few workarounds, the easiest is to build the project in a local Amazon Linux container. If I have some time I'll try and write up a little example of how to go about this.
@Julio-Assis I've dropped my ideas to use lambda-uploader because of this problem and because it didn't seem to fit our workflow.
We are using our own script that builds the Lambda package as a layer in a docker image extending lambci/lambda:build-python3.6 We then copy that package, from a started container, upload it to S3, and then set it up with Terraform.
We may publish details in a blog post at one point :-)
@jarosser06 Oh, I didn't know that you need to use it from Amazon Linux. Guess it'd be good to put it in the readme.
One possible workaround that I have in mind is to change my database to mysql and then I would use pymysql rather than psycopg2. Do you think this will work?
@Julio-Assis I think that building on Amazon Linux, or in lambci/lambda:build-python3.6
container would be a better idea. I don't think you'll be able to escape using any C extensions for long. Also, I'm a Postgres fan :)
The function I've built and uploaded with lambda-uploader crashed with this error:
Unable to import module 'kinesis_worker': /var/task/psycopg2/_psycopg.so: undefined symbol: PyUnicodeUCS4_DecodeUTF8
My requirements.txt:
My lambda.json:
The function works with AWS when I'm building with my own scripts (created them because of #151):
My OS is Kubuntu 17.10