shelfio / libreoffice-lambda-layer

MIT License
108 stars 21 forks source link

When trying to convert DOCX with TOC I've got Error: Please verify input parameters... (SfxBaseModel::impl_store <file:///tmp/d/TestTOC2.pdf> failed: 0xc10(Error Area:Io Class:Write Code:16)) #33

Open amer1993 opened 3 years ago

amer1993 commented 3 years ago

Hi

I'm using libreoffice-lambda-layer to convert files to PDF When trying to convert a docx file that contains automatic table-of-content (TOC) I'm getting this error: Error: Please verify input parameters... (SfxBaseModel::impl_store file:///tmp/TestTOC2.pdf failed: 0xc10(Error Area:Io Class:Write Code:16)) Attached a file that duplicate this issue: TestTOC2.docx

I prepared docker image with amazon linux 2 and was able to duplicate this issue. I installed libreoffice 6.4.7 from RPM (in addition to some libs) and and tried the conversion with it, the issue did not duplicate.

After some inspection I found that copying shared/config/soffice.cfg/ share/config/soffice.cfg/ folder from the libreoffice 6.4.7 installation to the layer package SOLVED the issue.

For me this issue sufficient workaround, but you may want to consider this on the upcoming update.

Thanks.


Modified share folder instead of shared, thanks to @beckmarc

evrardts commented 3 years ago

Hi @amer1993 can you please specify how you copy the office.cfg folder to the layer package? I added the layer via arn, I do not really understand where I can copy that folder. Thanks a lot!

amer1993 commented 3 years ago

Hi @amer1993 can you please specify how you copy the office.cfg folder to the layer package? I added the layer via arn, I do not really understand where I can copy that folder. Thanks a lot!

Hi, I've got the shared/config/soffice.cfg/ share/config/soffice.cfg/ folder form libreoffice 6.4.7 official RPM: https://www.libreoffice.org/download/download/?type=rpm-x86_64&version=6.4.7 I actually downloaded the libreoffice-lambda-layer and added the shared/config/soffice.cfg/ share/config/soffice.cfg/ folder to it and created my own layer. Attaching the folder content that I used: shared.zip


Modified share folder instead of shared, thanks to @beckmarc

muhammaddadu commented 3 years ago

what do you mean copying it to the layer package?

beckmarc commented 3 years ago

@amer1993 Hi, thanks for the solution. I'm facing exactly the same issue but I seem to misunderstand your steps. Did you mean that you zipped the soffice.cfg folder together with the lo.tar.br and then uploaded this file as the layer? I tried various things without any success. Would be very nice if you could show the exact folder structure or just upload the zipped version that you used for your layer.

amer1993 commented 3 years ago

@muhammaddadu, @beckmarc I hope the the following steps help

1- I downloaded the libreoffice package that this project created: https://github.com/shelfio/libreoffice-lambda-layer/raw/master/layer.tar.br.zip 2- I extracted it (un-zip, un-br, un-tar) till I reached the 'instdir' folder 3- I added the content of https://github.com/shelfio/libreoffice-lambda-layer/files/5774944/shared.zip (shared/config/soffice.cfg share/config/soffice.cfg folder) 4- I re-compressed the 'instdir' folder (tar, br, zip) into layer.tar.br.zip 5- From AWS console I created a new Lambda Layer with the resulted layer.tar.br.zip and used it in my lambda function.


Modified share folder instead of shared, thanks to @beckmarc

sonphnt commented 3 years ago

@beckmarc Did you make it work? Can you clarify the folder structure ? I tried without success as well.

@amer1993 The "instdir" folder will look like this after being extracted instdir/presets instdir/program instdir/sdk instdir/share

And we copy "soffice.cfg" folder into this instdir/soffice.cfg ? (this copy does not work for me, I still get the error)

or the sub folders of "soffice.cfg" around 15 folders then it will become

instdir/cui instdir/dbaccess .....

thanks

beckmarc commented 3 years ago

@sonphnt Yes, I did get it to work. The "share" folder in the LibreOffice instdir directory is supposed to equal the "shared" folder. So you have to add the "config/soffice.cfg" to the "share" folder and everything will work. What a small missing "d" can do :smile:

sonphnt commented 3 years ago

@beckmarc Nice. Now it works. Yeah the "d" missing 😄. . Thanks.

The final folder structure will look like this for someone who still has a problem instdir/share/config/soffice.cfg

liftyourgame commented 2 years ago

Followed the steps but not working for me. Before zipping. ls instdir/share/config/soffice.cfg gives: cui editeng fps svt vcl dbaccess filter sfx svx writerperfect desktop formula simpress uui xmlsec

liftyourgame commented 2 years ago

Solved it. My serverless-libreoffice project was still refering to the old layer.

Jun711 commented 2 years ago

@amer1993 @liftyourgame @sonphnt I got this tar error after completing all the steps mentioned above. I did this on a Mac machine. Has anyone seen this error?

err:  Error: Invalid tar header. Maybe the tar is corrupted or it needs to be    at addChunk       
(_stream_readable.js:297:12)omain.js:483:12)le-stream/lib/_stream_writable.js:307:11)
jpike88 commented 2 years ago

I am going INSANE from trying to debug this with a new version of libreoffice. A workaround of just plonking a folder from one place to another isn't an option for me. Anyone have any idea what that error even means? Anyone know why replacing those config files actually fixes this for the older version?

FYI in my case, it's happening regardless of whether the docx file has a table of contents or not.

dallanmc commented 1 year ago

Huge thanks to the OP for providing a fix for this. Anyone tried to run Libreoffice from EFS?

tanghuaqiang commented 1 month ago

org.jodconverter.core.office.OfficeException: Could not store document: 2024地质设计doc.pdf at org.jodconverter.local.task.LocalConversionTask.storeDocument(LocalConversionTask.java:198) ~[jodconverter-local-4.4.6.jar:4.4.6] at org.jodconverter.local.task.LocalConversionTask.execute(LocalConversionTask.java:131) ~[jodconverter-local-4.4.6.jar:4.4.6] at org.jodconverter.local.office.LocalOfficeManagerPoolEntry.doExecute(LocalOfficeManagerPoolEntry.java:121) ~[jodconverter-local-4.4.6.jar:4.4.6] at org.jodconverter.core.office.AbstractOfficeManagerPoolEntry.lambda$execute$0(AbstractOfficeManagerPoolEntry.java:81) ~[jodconverter-core-4.4.6.jar:4.4.6] at java.base/java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:264) ~[na:na] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java) ~[na:na] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na] at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na] Caused by: com.sun.star.io.IOException: SfxBaseModel::impl_store file:///D:/kkFileView-master/server/src/main/file/2024地质设计doc.pdf failed: 0xc10(Error Area:Io Class:Write Code:16) at com.sun.star.lib.uno.environments.remote.Job.remoteUnoRequestRaisedException(Job.java:173) ~[jurt-4.1.2.jar:na] at com.sun.star.lib.uno.environments.remote.Job.execute(Job.java:139) ~[jurt-4.1.2.jar:na] at com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:334) ~[jurt-4.1.2.jar:na] at com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:303) ~[jurt-4.1.2.jar:na] at com.sun.star.lib.uno.environments.remote.JavaThreadPool.enter(JavaThreadPool.java:87) ~[jurt-4.1.2.jar:na] at com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.sendRequest(java_remote_bridge.java:636) ~[jurt-4.1.2.jar:na] at com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.request(ProxyFactory.java:146) ~[jurt-4.1.2.jar:na] at com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.invoke(ProxyFactory.java:128) ~[jurt-4.1.2.jar:na] at com.sun.proxy.$Proxy82.storeToURL(Unknown Source) ~[na:na] at org.jodconverter.local.task.LocalConversionTask.storeDocumentToURL(LocalConversionTask.java:214) ~[jodconverter-local-4.4.6.jar:4.4.6] at org.jodconverter.local.task.LocalConversionTask.storeDocument(LocalConversionTask.java:192) ~[jodconverter-local-4.4.6.jar:4.4.6] ... 8 common frames omitted

tanghuaqiang commented 1 month ago

@liftyourgame @muhammaddadu @sonphnt Hi, could you help me take a look? There is a similar issue where the Word to PDF preview remains unchanged

Sylsria commented 4 weeks ago

@liftyourgame @muhammaddadu @sonphnt Hi, could you help me take a look? There is a similar issue where the Word to PDF preview remains unchanged

same error