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

Running command throws com::sun::star::container::NoSuchElementException Exception #29

Open
Rudigern opened this issue Jan 13, 2020 · 9 comments

Comments

@Rudigern
Copy link

Updating my AWS Lambda function with the new LibraOffice compiled for Amazon Linux 2 and when I run the command it throws com::sun::star::container::NoSuchElementException'.

I've confirmed the file is there and tried both pptx and docx but it throws the same exception. I did notice in a test that you run the command twice with it expecting to fail the first time, not sure if it's related.

Thanks for your function and work on this, very much appreciated.

@vladholubiev
Copy link
Owner

Hey @Rudigern,

What Lambda runtime do you use? Could you please share the file you're trying to convert? What's the desired output file format?

Yeah, you noticed it right. Running the command twice is worth trying. Did it help you?

@Rudigern
Copy link
Author

Rudigern commented Jan 13, 2020

@vladgolubev Using NodeJS 12x. I've used two different files and run it against the old Lambda function and the old one works. I do run it twice but the exception still gets thrown and there is no output file however there is still that long string of numbers that occurs in the console.

2,32,40,99,111,114,101,32,100,117,109,112,101,100,41,32,46,47,105,110,115,116,100,105,114,47,112

Whats the error that occurs to need to run it twice?

Also I'm using the Lambda Layer at

arn:aws:lambda:ap-southeast-2:764866452798:layer:libreoffice-gzip:1

@tpiske
Copy link

tpiske commented Jan 14, 2020

Hello,

I have this same error converting a docx file to pdf:

terminate called after throwing an instance of 'com::sun::star::container::NoSuchElementException'
sh: line 1:    15 Aborted (core dumped) instdir/program/soffice.bin --headless --norestore --invisible --nodefault --nofirststartwizard --nolockcheck --nologo --norestore --convert-to pdf --outdir /tmp test.docx

I'm using Python 3.8 (Amazon Linux 2)
Lambda Layer: arn:aws:lambda:us-east-1:764866452798:layer:libreoffice-gzip:1

@Rudigern
Copy link
Author

Looks like someone else has come across this issue too.

@fughur
Copy link

fughur commented Jan 16, 2020

Same here trying to run hello world test from https://github.com/shelfio/aws-lambda-libreoffice/blob/master/test.js on both lambci/lambda:nodejs10.x and lambci/lambda:nodejs12.x using new libreoffice build. Running command twice doesn't help.

Here is command i used (works well with previous libre build)
cd /tmp && \"/tmp/instdir/program/soffice.bin\" --headless --invisible --nodefault --view --nolockcheck --nologo --norestore --nofirststartwizard --convert-to pdf:impress_pdf_Export --outdir \"/tmp\" \"/tmp/test.txt\"

@fughur
Copy link

fughur commented Jan 16, 2020

Okay it seems that only layer.tar.gz.zip is broken, layer.tar.br.zip works well after applying twice call hack.
They even have different size after unpacking - ~250mb for .gz (oh false hope) instead of ~350mb of .br.

@Rudigern
Copy link
Author

I've confirmed that as @fughur has said, the tar.gz is broken. I've zipped up the compiled version of tar.br and as a tar.gz (I couldn't be bothered changing the function to accommodate yet) and it works. It's missing a whole bunch of fonts that I'll have to look to add but now it works.

@curtiseinsmann
Copy link

Can confirm. Running this on an Amazon Linux 2 machine, the binary extracted from lo.tar.gz in release 6.4.0.1 threw this error, even when running it from the command line. Binary extracted from lo.tar.br (unpacked by referencing this code) works from the command line without calling it twice. Running the binary from lo.tar.br in a node runtime works, but only after calling it twice.

@lanlin
Copy link

lanlin commented Jul 10, 2020

same error here when running on AWS Lambda

/tmp/instdir/program/soffice.bin --headless --invisible --nodefault --nofirststartwizard --nolockcheck --nologo --norestore --convert-to odt --outdir /tmp /tmp/target.txt

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

6 participants