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

Layer not working on Amazon Linux 2 #1

Open
markusahlstrand opened this issue Sep 3, 2020 · 11 comments
Open

Layer not working on Amazon Linux 2 #1

markusahlstrand opened this issue Sep 3, 2020 · 11 comments

Comments

@markusahlstrand
Copy link

Thanks for publishing this layer!

I tried using it in a node lambda, but they run on the newer VM (amazon linux 2) and it doesn't seem to work.. I'm no good with python, but as far as I understand the X11 packages are not available on the newer VM's. Would it be possible to add the missing packages to the layer?

Thanks!

@gipsh
Copy link
Owner

gipsh commented Sep 3, 2020

When you execute the binary /opt/ebook-convert what error is throwing ?

I need to try it myself on the new vms.

@markusahlstrand
Copy link
Author

This is the error I get when I try to convert a file from epub -> mobi

Command failed: ebook-convert \"/tmp/1599059003173.epub\" \"/tmp/1599059003173.epub.azw3\"
Traceback (most recent call last):
 File \"site.py\", line 77, in main
 File \"site-packages/calibre/ebooks/conversion/cli.py\", line 401, in main
 File \"site-packages/calibre/ebooks/conversion/plumber.py\", line 1275, in run
 File \"site-packages/calibre/ebooks/conversion/plugins/mobi_output.py\", line 312, in convert
 File \"site-packages/calibre/ebooks/mobi/writer2/resources.py\", line 12, in <module>
 File \"site-packages/calibre/ebooks/mobi/utils.py\", line 13, in <module>
 File \"site-packages/calibre/utils/img.py\", line 17, in <module>
ImportError: libGL.so.1: cannot open shared object file: No such file or directory

It seems that other people has run in to similar issues when trying to get calibre on Synology devices and to my understanding this is due to missing X11 packages.

@gipsh
Copy link
Owner

gipsh commented Sep 4, 2020

Did you try installing the amazon linux 2 vm on your host and run the layer locally?
Probably there are more missing libs.

@markusahlstrand
Copy link
Author

I'll try settings up an image on ec2. Guessing that the Amazon Linux 2 AMI (HVM) is the same image they use in the lambdas?

@markusahlstrand
Copy link
Author

I got an ec2 image up and running and have check the following:

  • The automatic installer of calibre, the v4 tarball and the v3 tarball all fail with the same error.
  • The prerequisites xdg-utils, wget, xz-utils and python ≥ 2.6 all seem available
  • GLIBC and gcc versions seems fine.

The error I get is:
Traceback (most recent call last):
File "site.py", line 75, in main
File "site-packages/calibre/init.py", line 23, in
File "site-packages/calibre/startup.py", line 156, in
File "locale.py", line 545, in getdefaultlocale
File "locale.py", line 477, in _parse_localename
ValueError: unknown locale: UTF-8

@markusahlstrand
Copy link
Author

Ok.. so it seems to simply be an issue with the default locale being wrong.

Tried what was suggested in this post and it seems to work in my VM: https://www.mobileread.com/forums/showthread.php?t=286960

I'll try adding these environment variable to my lambda code and hopefully the layer works fine.

@gipsh
Copy link
Owner

gipsh commented Sep 4, 2020

I tried myself to run the layer on amazon linux 2 vm, and got the same error for libGL.
Once installed i still throwing errors for Qt.
Is going to take some time to make it work and im not sure if could be done without hitting the 250MB limit for the layer.

@markusahlstrand
Copy link
Author

Ok, I installed Qt as part of chrome headless when debugging (https://intoli.com/blog/installing-google-chrome-on-centos/), and maybe that fixed the first part of the issue.. I'll wipe the server and try it again.

@markusahlstrand
Copy link
Author

Would custom runtimes be a way to get around this issue: https://aws.amazon.com/about-aws/whats-new/2020/08/aws-lambda-supports-custom-runtimes-amazon-linux-2/

@evangow
Copy link

evangow commented Sep 15, 2022

@markusahlstrand did you ever find a workaround to these issues?

@markusahlstrand
Copy link
Author

Nope, we are running a docker container as a lambda instead which works well

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

No branches or pull requests

3 participants