Skip to content
This repository has been archived by the owner on Jun 13, 2019. It is now read-only.

[builder] Unable to import module 'liblambda': /lib64/libcrypto.so.10: version `OPENSSL_1.0.2' not found (required by /var/task/liblambda.so) #20

Closed
iliana opened this issue Oct 27, 2017 · 12 comments

Comments

@iliana
Copy link
Owner

iliana commented Oct 27, 2017

Amazon Linux 2017.09 ships with OpenSSL 1.0.2; Lambda is still on 1.0.1.

Making things more difficult, Python 3.6 was first released in Amazon Linux 2017.09, so there's not a build against OpenSSL 1.0.1, so we can't even downgrade openssl-devel.

Including libcrypto.so.10 in the zip doesn't seem to help either; I think /var/task is lower precedence than system library paths in Lambda.

@ramn
Copy link

ramn commented Oct 30, 2017

Any progress on this or any ideas?

@iliana
Copy link
Owner Author

iliana commented Oct 30, 2017

Not currently.

If you're interested in spending some time to try and figure things out, the lambci docker-lambda images might work okay (apparently aws-sam-local uses them).

@ramn
Copy link

ramn commented Oct 31, 2017

It works! Thanks. I just tried manually, perhaps that image can be used by crowbar.

@ramn
Copy link

ramn commented Oct 31, 2017

In the crowbar builder Dockerfile, I updated the FROM line to this:

FROM lambci/lambda:build-python3.6

And in my project, in Cargo.toml I added this:

python3-sys = { version = "0.1.3", features = ["python-3-4"] }

Where the feature "python-3-4" is the important part. However, with that feature enabled I can't build locally (on my mac, that is, not using the docker container). Perhaps that can be solved? Can we enable this feature only in the docker run?

@ramn
Copy link

ramn commented Oct 31, 2017

It also works if I set python3-sys = { version = "0.1.3", features = ["python-3-4"] } in rust-crowbar/Cargo.toml. Just need to be able to toggle this as a feature when running cargo build.

@ramn
Copy link

ramn commented Oct 31, 2017

So I found a way of building locally with default python binding but override to the python3.4 when building in the crowbar builder docker container. I'll do a PR.

@iliana
Copy link
Owner Author

iliana commented Oct 31, 2017

python3-sys = { version = "0.1.3", features = ["python-3-4"] }

That is... super weird. Why is there even a python3.4 in that image...

ramn added a commit to ramn/rust-crowbar that referenced this issue Oct 31, 2017
@ramn
Copy link

ramn commented Oct 31, 2017

Yes and I tried with python-3-5 which didn't work.

@softprops
Copy link
Contributor

softprops commented Dec 3, 2017

this is still an open issue. what is the recommended workaround? I'm getting the same error. not being able to make https requests is a bit debilitating

Unable to import module 'liblambda': /lib64/libcrypto.so.10: version `OPENSSL_1.0.2' not found (required by /var/task/liblambda.so)

END RequestId: 420f016d-d7ed-11e7-bcec-c986dbdea94e
REPORT RequestId: 420f016d-d7ed-11e7-bcec-c986dbdea94e	Duration: 15.37 ms	Billed Duration: 100 ms 	Memory Size: 1024 MB	Max Memory Used: 22 MB

@softprops
Copy link
Contributor

the work around @ramn mentioned worked for me.

@nbigaouette-eai
Copy link

The Docker image from lambci should be an (almost) identical environment than the official one. The reason is that they created the image by saving the whole filesystem to S3 using tar from inside a lambda! See https://github.com/lambci/docker-lambda#questions , specially the Wut, how? bullet point.

You can thus inspect the environment locally with docker run -it --rm lambci/lambda:build-python3.6 bash.

Python 3.6 is installed in /var/lang/bin/:

> which python3.6
/var/lang/bin/python3.6

but the one in /usr/bin is Python 3.4!

> ls -l /usr/bin/python3*
lrwxrwxrwx 1 root root   25 Sep 20 19:05 /usr/bin/python3 -> /etc/alternatives/python3
-rwxr-xr-x 3 root root 6864 Sep  1  2016 /usr/bin/python34
-rwxr-xr-x 3 root root 6864 Sep  1  2016 /usr/bin/python3.4
lrwxrwxrwx 1 root root   17 Sep 20 19:05 /usr/bin/python3.4-config -> python3.4m-config
-rwxr-xr-x 3 root root 6864 Sep  1  2016 /usr/bin/python3.4m
-rwxr-xr-x 1 root root  173 Sep  1  2016 /usr/bin/python3.4m-config
-rwxr-xr-x 1 root root 3288 Sep  1  2016 /usr/bin/python3.4m-x86_64-config
lrwxrwxrwx 1 root root   32 Sep 20 19:05 /usr/bin/python3-config -> /etc/alternatives/python3-config

This means that if one wants to use the python interpreter that is linked to the OS provided openssl (/lib64/libcrypto.so.1.0.1k), one has to use the OS python interpreter /usr/bin/python3 which is... Python 3.4.

That explains the python-3-4 feature required for the python3-sys crate.

@iliana
Copy link
Owner Author

iliana commented Oct 2, 2018

I think this is fixed now that we refer people to https://github.com/naftulikay/docker-crowbar?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants