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

It seems to crash with docx larger than a certain size #169

Closed
Jun711 opened this issue Jan 18, 2022 · 4 comments
Closed

It seems to crash with docx larger than a certain size #169

Jun711 opened this issue Jan 18, 2022 · 4 comments

Comments

@Jun711
Copy link

Jun711 commented Jan 18, 2022

It works perfectly most of the time but certain documents make it crash. I suspect it is document size as the document I tried was 5MB. Desktop Libreoffice is able to convert this docx Real Property Casebook _ text.docx to pdf.

I am not sure if there are special characters in the document that make converting fail. And, subsequent requests that are sent to this same lambda instance would not work (see the error message at the bottom). It seems that the libreoffice soffice.bin file is removed when this error occurs.

This is the error log I got when I tried to convert the attached docx

/bin/sh: line 1: 221 Aborted (core dumped) /tmp/instdir/program/soffice.bin --headless --invisible --nodefault --view --nolockcheck --nologo --norestore --nofirststartwizard --convert-to pdf --outdir /tmp /tmp/RealPropertyCasebook_text.docx
/tmp/instdir/program/soffice.bin[0x40068a]
/lib64/libc.so.6(__libc_start_main+0xea)[0x7f780372413a]
/tmp/instdir/program/soffice.bin[0x40064b]
/tmp/instdir/program/libmergedlo.so(soffice_main+0x105)[0x7f7805999cc5]
/tmp/instdir/program/libmergedlo.so(_Z10ImplSVMainv+0x62)[0x7f7806942642]
/tmp/instdir/program/libmergedlo.so(+0x1c74755)[0x7f7805979755]
/tmp/instdir/program/libmergedlo.so(_ZN11Application7ExecuteEv+0x3e)[0x7f780693bc8e]
/tmp/instdir/program/libmergedlo.so(+0x2c34f62)[0x7f7806939f62]
/tmp/instdir/program/libmergedlo.so(_ZN14SvpSalInstance7DoYieldEbb+0x39)[0x7f78069d3f99]
/tmp/instdir/program/libmergedlo.so(_ZN16SalUserEventList18DispatchUserEventsEb+0x185)[0x7f7806914b65]
/tmp/instdir/program/libmergedlo.so(_ZN14SvpSalInstance12ProcessEventEN16SalUserEventList12SalUserEventE+0x26)[0x7f78069d3626]
/tmp/instdir/program/libmergedlo.so(+0x29d1351)[0x7f78066d6351]
/tmp/instdir/program/libmergedlo.so(+0x1c7366a)[0x7f780597866a]
/tmp/instdir/program/libmergedlo.so(+0x1c71f82)[0x7f7805976f82]
/tmp/instdir/program/libmergedlo.so(+0x1c8d752)[0x7f7805992752]
/tmp/instdir/program/libmergedlo.so(+0x1c85255)[0x7f780598a255]
/tmp/instdir/program/libmergedlo.so(_ZN10comphelper19SynchronousDispatch8dispatchERKN3com3sun4star3uno9ReferenceINS4_10XInterfaceEEERKN3rtl8OUStringESD_RKNS4_8SequenceINS3_5beans13PropertyValueEEE+0x3b0)[0x7f7804d99a00]
/tmp/instdir/program/libmergedlo.so(+0x1567ad8)[0x7f780526cad8]
/tmp/instdir/program/libmergedlo.so(+0x1566e14)[0x7f780526be14]
/tmp/instdir/program/libmergedlo.so(+0x15cbb96)[0x7f78052d0b96]
/tmp/instdir/program/libmergedlo.so(+0x15ca4fa)[0x7f78052cf4fa]
/tmp/instdir/program/libmergedlo.so(+0x1c2da10)[0x7f7805932a10]
/tmp/instdir/program/libmergedlo.so(_ZN12SfxBaseModel4loadERKN3com3sun4star3uno8SequenceINS2_5beans13PropertyValueEEE+0x1bb)[0x7f78058954cb]
/tmp/instdir/program/libmergedlo.so(_ZN14SfxObjectShell6DoLoadEP9SfxMedium+0x1124)[0x7f780586cf44]
/tmp/instdir/program/libmergedlo.so(_ZN14SfxObjectShell10ImportFromER9SfxMediumRKN3com3sun4star3uno9ReferenceINS4_4text10XTextRangeEEE+0x1ac3)[0x7f7805864143]
/lib64/libc.so.6(abort+0x148)[0x7f7803738148]
/lib64/libc.so.6(gsignal+0x110)[0x7f7803736ca0]
/lib64/libc.so.6(+0x33d10)[0x7f7803736d10]
/tmp/instdir/program/libuno_sal.so.3(+0x394ae)[0x7f7803ae74ae]
/tmp/instdir/program/libuno_sal.so.3(+0x16b09)[0x7f7803ac4b09]
/tmp/instdir/program/libmergedlo.so(+0x2c3bb04)[0x7f7806940b04]
/tmp/instdir/program/libmergedlo.so(+0x1c6ea50)[0x7f7805973a50]
/tmp/instdir/program/libmergedlo.so(_ZN11Application5AbortERKN3rtl8OUStringE+0x95)[0x7f780693a455]
/tmp/instdir/program/libmergedlo.so(+0x2cb87c2)[0x7f78069bd7c2]
/lib64/libc.so.6(abort+0x148)[0x7f7803738148]
/lib64/libc.so.6(gsignal+0x110)[0x7f7803736ca0]
/lib64/libc.so.6(+0x33d10)[0x7f7803736d10]
/tmp/instdir/program/libuno_sal.so.3(+0x395b3)[0x7f7803ae75b3]
/tmp/instdir/program/libuno_sal.so.3(+0x13e62)[0x7f7803ac1e62]
Stack:
Fatal exception: Signal 6
Application Error
Error: source file could not be loaded
rm: cannot remove ‘/tmp/RealPropertyCasebook_text.docx’: No such file or directory

Error: Command failed: rm /tmp/RealPropertyCasebook_text.docx rm: cannot remove ‘/tmp/RealPropertyCasebook_text.docx’: No such file or directory at checkExecSyncError (child_process.js:635:11) at execSync (child_process.js:671:15) at convertTo (/var/task/node_modules/@shelf/aws-lambda-libreoffice/lib/convert.js:58:31) at runMicrotasks (<anonymous>) at processTicksAndRejections (internal/process/task_queues.js:97:5) at async LibreOfficeService.convertToPdf (/var/task/services/libreoffice-service.js:173:7) at async Runtime.exports.handler (/var/task/app.js:102:15) { status: 1, signal: null, output: ...

This the error log for the subsequent requests

/bin/sh: /tmp/instdir/program/soffice.bin: No such file or directory

Error: Command failed: cd /tmp && /tmp/instdir/program/soffice.bin --headless --invisible --nodefault --view --nolockcheck --nologo --norestore --nofirststartwizard --convert-to pdf --outdir /tmp /tmp/abc.docx 
/bin/sh: /tmp/instdir/program/soffice.bin: No such file or directory at checkExecSyncError (child_process.js:635:11) 
at execSync (child_process.js:671:15) at convertTo (/var/task/node_modules/@shelf/aws-lambda-libreoffice/lib/convert.js:55:40) 
at runMicrotasks (<anonymous>) at processTicksAndRejections (internal/process/task_queues.js:97:5) 
at async LibreOfficeService.convertToPdf (/var/task/services/libreoffice-service.js:182:7) 
at async Runtime.exports.handler (/var/task/app.js:102:15) ...
@vladholubiev
Copy link
Member

Yes, this looks like a bug in the Libreoffice itself. I've seen problems with larger documents as well

@Jun711
Copy link
Author

Jun711 commented Jan 19, 2022

ok, maybe the newer version would work.

btw, when that happens, aws-lambda-libreoffice/lib/convert.js would throw an error as it fails to rm the input file.

Error: Command failed: rm /tmp/RealPropertyCasebook_text.docx rm: cannot remove 
‘/tmp/RealPropertyCasebook_text.docx’: No such file or directory at checkExecSyncError (child_process.js:635:11) 
at execSync (child_process.js:671:15) 
at convertTo (/var/task/node_modules/@shelf/aws-lambda-libreoffice/lib/convert.js:58:31) 
at runMicrotasks (<anonymous>) at processTicksAndRejections 
(internal/process/task_queues.js:97:5) at async LibreOfficeService.convertToPdf (/var/task/services/libreoffice-service.js:173:7) 
at async Runtime.exports.handler (/var/task/app.js:102:15) { status: 1, signal: null, output: ...

@arvinAM17
Copy link

I get this error as well, even with smaller files. I put the file 'document.docx' in the tmp folder right in the function environment, and it gives me
"errorType": "Error", "errorMessage": "Command failed: rm /tmp/tmp/document.docx\nrm: cannot remove ‘/tmp/tmp/document.docx’: No such file or directory\n"
And logs Error: source file could not be loaded as well. Any solutions?

@vladholubiev
Copy link
Member

We've released a major version of this package that works with the latest LibreOffice 7.3!

Check out the docs for a new package here.

We're not going to support the previous version of a package that worked with a Lambda Layer and an old 6.4 version of LibreOffice.

Feel free to (re)-open a new issue in regards to the recent package version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants