Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

libexpat.so.1: cannot open shared object file: No such file or director #11

Closed
meyer1994 opened this issue Apr 14, 2020 · 4 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@meyer1994
Copy link

Hi.
This error has appearead again in this new layer. And I can reproduce it, finally.

I've cloned this repo and created a makefile with the commands described in the README. However, when trying to run a simple python function, it gives the error from the title.

Makefile:

.PHONY: layer test

layer:
	docker build --tag package:latest . --build-arg GDAL_VERSION=3.0 --build-arg PYTHON_VERSION=3.8
	docker run --name lambda -w /var/task -itd package:latest bash
	docker cp scripts/create-lambda-layer.sh lambda:/create-lambda-layer.sh
	docker exec -it lambda bash /create-lambda-layer.sh
	docker cp lambda:/tmp/package.zip package.zip
	docker stop lambda
	docker rm lambda

test:
	unzip package.zip -d layer
	docker run \
		--rm \
		-v $(shell pwd):/var/task:ro,delegated \
		-v $(shell pwd)/layer:/opt:ro,delegated \
    	-e GDAL_DATA="/opt/share/gdal" \
    	-e PROJ_LIB="/opt/share/proj" \
		lambci/lambda:python3.8 handler.handler '{"some": "data"}'

Python function:

import numpy
import rasterio

def handler(event, context):
    print(numpy.__version__)
    print(rasterio.__version__)

I've already checked the linking using ldd and it seems to be linked correctly. But when executing the function, it does not work.

$ docker run --rm -it lambgeo/lambda:gdal3.0-py3.8 bash -c "ldd /opt/lib/libgdal.so | grep expat"
	libexpat.so.1 => /lib64/libexpat.so.1 (0x00007fb514a28000)

Am I missing something?

Again, thanks for your work with these layers. They help A LOT. And sorry for pestering you with my issues 😝

@vincentsarago
Copy link
Contributor

😭 thanks @meyer1994 and sorry for the bug, It seems we are starting from scratch again .... while I was pretty sure we copied everything from the old layer.

@vincentsarago vincentsarago self-assigned this Apr 15, 2020
@vincentsarago vincentsarago added the bug Something isn't working label Apr 15, 2020
@vincentsarago
Copy link
Contributor

@meyer1994 is this only with python 3.8 ?

@vincentsarago
Copy link
Contributor

🤦
https://github.com/lambci/docker-lambda/blob/master/python3.7/build/Dockerfile#L1

https://github.com/lambci/docker-lambda/blob/master/python3.8/build/Dockerfile#L1

both python 3.7 and python 3.8 are not based on the same image. Sadly the fix should be upstream in /docker-lambda (and it won't be an easy one 😭)

@vincentsarago
Copy link
Contributor

@meyer1994 I'm going to remove any mention to python 3.8 layers for now and add them back when this will be fixed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants