shelfio / aws-lambda-libreoffice

Utility to work with Docker version of LibreOffice in Lambda
MIT License
225 stars 43 forks source link

javaldx: Could not find a Java Runtime Environment! #211

Open zoemrob opened 2 years ago

zoemrob commented 2 years ago

So I believe I followed the instructions, not sure if I missed something though.

FROM public.ecr.aws/shelf/lambda-libreoffice-base:7.4-node16-x86_64

COPY index.js package.json ${LAMBDA_TASK_ROOT}

RUN npm install

CMD [ "index.handler" ]

This is my Dockerfile I have my app code in index.js. I'm running docker build --platform linux/x86_64 -t convert-to-pdf . and then deploying that image to my ECR registry and deploying that on my lambda function. It's all working, except when I call the convertTo method I end up getting this chunk of errors:

javaldx: Could not find a Java Runtime Environment!
Warning: failed to read path from javaldx
Error: Please verify input parameters... (SfxBaseModel::impl_store <file:///tmp/SampleResume.pdf> failed: 0xc10(Error Area:Io Class:Write Code:16) at /home/buildslave/source/libo-core/sfx2/source/doc/sfxbasemodel.cxx:3207 at /home/buildslave/source/libo-core/sfx2/source/doc/sfxbasemodel.cxx:1783)

I haven't seen anyone else having this issue, so I'm unsure what the problem could be.

zoemrob commented 2 years ago

Only other relevant info: I'm running on an Apple Silicon M1, which is why I'm passing in the --platform argument.

vladholubiev commented 2 years ago

Is this error specific to 1 file or happens with all even the simplest .txt files?

JagWireZ commented 2 years ago

I see the same issue. Built on Apple M1 Mac, using the linux_amd64 platform, and the error arises within Lambda.

legome0937 commented 1 year ago

image I deployed to AWS. Please help me @vladgolubev

zoemrob commented 1 year ago
FROM public.ecr.aws/shelf/lambda-libreoffice-base:7.4-node16-x86_64

COPY index.js package.json ${LAMBDA_TASK_ROOT}

# dependency not supplied by lambda-libreoffice-base image
RUN yum install java-1.8.0-openjdk-devel -y
RUN npm install

CMD [ "index.handler" ]

Adding the java-1.8.0-openjdk-devel package did allow me to run this.

legome0937 commented 1 year ago
FROM public.ecr.aws/shelf/lambda-libreoffice-base:7.4-node16-x86_64

COPY index.js package.json ${LAMBDA_TASK_ROOT}

# dependency not supplied by lambda-libreoffice-base image
RUN yum install java-1.8.0-openjdk-devel -y
RUN npm install

CMD [ "index.handler" ]

Adding the java-1.8.0-openjdk-devel package did allow me to run this.

Thanks! It works well