Open Ayh4m opened 1 year ago
Hey @Ayh4m, I had this same use case and was able to get it working. See the repo here
I have the same problem, could anyone solve it?
For anyone dealing with this specific error: this happens when the log message returned from libreoffice doesn't match a regex return logs.match(/\/tmp\/.+->\s(\/tmp\/.+) using/)[1];
in the library/logs
module. This assumes that the log message 1) is in English (the 'using') and 2) that the input and output path both start with /tmp/
.
I was bumping into this while testing the code on MacOS where /tmp is a symbolic link to /private/tmp/, so the output path in the messages returned from libreoffice had /private/tmp/ in them and did not match the regex, thus returning null form the match and an error trying to access index 1 of null. I worked around it by monkey patching getConvertedFilePath
when testing on MacOS.
It did work just fine for me with no modification while running in the deployed Lambda, however, if someone were to have some locale variables set in their Dockerfile and libreoffice outputs messages in a language other than than English, this would be broken in deployed Lambdas too.
Hello guys,
I'm trying to convert a MS Word .docx file (that is being downloaded from S3 bucket) to a pdf one (and upload it to the same location in that S3 bucket).
NOTE: I've tried the layer solution and it did work for me.
I've followed all the mentioned steps:
1- Created my own docker image:
Where my Dockerfile looks like this:
and apps.js looks like this:
& package.json is the following:
2- Pushed it to ECR.
3- Created a Lambda Function:
With the following configurations:
AND I'm getting the following error:
Any suggestions?!