shelfio / libreoffice-lambda-base-image

MIT License
30 stars 18 forks source link

Cannot run libre office with @shelf/aws-lambda-libreoffice 4.0.4 #3

Closed Dizmus closed 2 years ago

Dizmus commented 2 years ago

Versions: "@shelf/aws-lambda-libreoffice": "^4.0.4 "npm": "^8.13.1", Node Version: v16.15.1

Docker Image:

FROM public.ecr.aws/shelf/lambda-libreoffice-base:7.3-node16-x86_64
COPY ./ ${LAMBDA_TASK_ROOT}/
RUN npm install -g yarn
RUN yarn install
CMD [ "index.handler" ]

Error when running on Lambda

{
  "errorType": "Error",
  "errorMessage": "Command failed: cd /tmp && libreoffice7.3 --headless --invisible --nodefault --view --nolockcheck --nologo --norestore --convert-to txt --outdir /tmp /tmp/536d871adocx\njavaldx failed!\nWarning: failed to read path from javaldx\nLibreOffice 7.3 - Fatal Error: The application cannot be started. \nUser installation could not be completed. \n",
  "trace": [
    "Error: Command failed: cd /tmp && libreoffice7.3 --headless --invisible --nodefault --view --nolockcheck --nologo --norestore --convert-to txt --outdir /tmp /tmp/536d871adocx",
    "javaldx failed!",
    "Warning: failed to read path from javaldx",
    "LibreOffice 7.3 - Fatal Error: The application cannot be started. ",
    "User installation could not be completed. ",
    "",
    "    at checkExecSyncError (node:child_process:828:11)",
    "    at execSync (node:child_process:899:15)",
    "    at convertTo (/var/task/node_modules/@shelf/aws-lambda-libreoffice/lib/convert.js:29:40)",
    "    at Runtime.module.exports.handler (/var/task/index.js:29:30)",
    "    at Runtime.handleOnce (file:///var/runtime/index.mjs:548:29)"
  ]
}
Dizmus commented 2 years ago

Additional information. If I add the following line to the dockerfile, it passes with warning:

RUN libreoffice7.3 --convert-to txt BmwEng.docx --headless --nologo --norestore --invisible --nofirststartwizard --view

Output of docker build:

image

I can assume, issue is with Lambda environment.

vladholubiev commented 2 years ago

Please see the troubleshooting section: https://github.com/shelfio/libreoffice-lambda-base-image#troubleshooting

IlliaHryshkevych commented 2 years ago

Please see the troubleshooting section: https://github.com/shelfio/libreoffice-lambda-base-image#troubleshooting

Thanks. That helped. But I have found it while reviewing another open issue. Can you please include it as a requirement for setup?

vladholubiev commented 2 years ago

@IlliaHryshkevych done, mentioned in README more prominently