Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Having Trouble Building Serverless execution #311

Open
NTC4818 opened this issue Jan 26, 2024 · 7 comments · May be fixed by #294
Open

Having Trouble Building Serverless execution #311

NTC4818 opened this issue Jan 26, 2024 · 7 comments · May be fixed by #294

Comments

@NTC4818
Copy link

NTC4818 commented Jan 26, 2024

Tried lots of internal remapping and building with libmagic, but no success. Seems it is looking for a fundamental part of the container that is not there, but I am not sure. I built the library with Ubuntu 22.04 and here is the main error I see when executing in AWS Lambda /lib64/libc.so.6: version `GLIBC_2.28' not found (required by /var/task/lib/libmagic.so.1). I have pulled the libmagic.so.1 as recommended on other forms from an ec2 to be part of the execution.

@ahupp
Copy link
Owner

ahupp commented Jan 29, 2024

I assume you are the person who mailed me about this? I suspect what is happening is that the python version you're using is linked against an older libc than libmagic is built with. Even if that libc exists on the machine, you can't have to different versions in one process. Where is your python binary coming from?

@NTC4818
Copy link
Author

NTC4818 commented Jan 29, 2024 via email

@ddelange ddelange linked a pull request Mar 6, 2024 that will close this issue
@ddelange
Copy link
Contributor

ddelange commented Mar 7, 2024

^ for now, can you try the following install command and report back if it works?

pip install python-magic --force-reinstall --find-links https://github.com/ddelange/python-magic/releases/expanded_assets/0.4.28

@NTC4818
Copy link
Author

NTC4818 commented Mar 7, 2024

Awesome, sorry I missed that note. I will spin up an ec2 with python 3.9 and run the following command, prepare it as a lambda layer and place where I currently have python 3.8 version and test run. Do you think there is anything else I would need to change for that to be functional?
Thanks a million

@NTC4818
Copy link
Author

NTC4818 commented Mar 7, 2024

Not quite the ticket. I built the layer as requested with the pip install command with pip 3.9 and then updated the brotlipy layer as well with 3.9 and received the following error.
[ERROR] Runtime.ImportModuleError: Unable to import module 'lambda_function': No module named 'brotli._brotli' Traceback (most recent call last)
Not sure if this has been seen in the past layer development and maybe the packaging of the layers need to be packaged together. Thanks

@ddelange
Copy link
Contributor

ddelange commented Mar 7, 2024

brotlipy is not maintained, rather go for brotli: you can install both in a single layer:

pip install brotli python-magic --force-reinstall --find-links https://github.com/ddelange/python-magic/releases/expanded_assets/0.4.28

@NTC4818
Copy link
Author

NTC4818 commented Mar 13, 2024

Still Not reading as it was in python 3.7, any ideas why it might be acting differently. It is running in aws lambda environment

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

Successfully merging a pull request may close this issue.

3 participants