unoconv / unoconv

Universal Office Converter - Convert between any document format supported by LibreOffice/OpenOffice.
http://dag.wieers.com/home-made/unoconv/
GNU General Public License v2.0
2.55k stars 373 forks source link

converting this word file to pdf gets stuck, never succeeds on convert it #568

Closed silva96 closed 2 years ago

silva96 commented 3 years ago

OS: Ubuntu 20.04.1 LTS (Server edition, no window system)

unoconv 0.7 platform posix/linux python 3.8.5 (default, Jul 28 2020, 12:59:40) [GCC 9.3.0] LibreOffice 6.4.6.2

bad_doc.docx

after minutes, I cancel the command with CTRL-C

$ unoconv -v -f pdf --output /home/ubuntu/bad_doc.pdf /home/ubuntu/bad_doc.docx
Input file: /home/ubuntu/bad_doc.docx
^Cunoconv: SystemError during update-indexes phase:
Couldn't instantiate python representation of structured UNO type com.sun.star.lang.DisposedException
Traceback (most recent call last):
  File "/usr/bin/unoconv", line 1285, in <module>
    die(exitcode)
  File "/usr/bin/unoconv", line 1138, in die
    if convertor.desktop.getCurrentFrame():
uno.DisposedException: Binary URP bridge already disposed
sayoder commented 3 years ago

I am seeing this issue as well (document here)

Description:    Ubuntu 20.04.2 LTS
Release:        20.04
Codename:       focal
unoconv 0.7
Written by Dag Wieers <dag@wieers.com>
Homepage at http://dag.wieers.com/home-made/unoconv/

platform posix/linux
python 3.8.5 (default, Jul 28 2020, 12:59:40)
[GCC 9.3.0]
LibreOffice 7.0.4.2

unoconv spawns a LibreOffice listener (usr/lib/libreoffice/program/soffice.bin) to convert the document. The listener hangs at 100% CPU usage and prevents any other unoconv tasks from connecting to it.

This is happening for this specific document and none others that I can find.

silva96 commented 3 years ago

This pptx also fails

ppt clase 1.pptx

Also, I can Open it with libreoffice GUI, and convert it successfully .

Windd01 commented 3 years ago

im have the same issues :(

Windd01 commented 3 years ago

My server hangs at 100% CPU so unoconv stuck with this. i kill this process and everything working again.

regebro commented 3 years ago

I was able to convert the pptx example with unoserver, although admittedly it took quite a long time.

https://pypi.org/manage/project/unoserver/

The docx example indeed seems to get stuck even with libreoffice wordmalo.docx --convert-to pdf. From unoserver is looks like it gets stuck when opening the file!?

silva96 commented 2 years ago

I was able to convert the pptx example with unoserver, although admittedly it took quite a long time.

https://pypi.org/manage/project/unoserver/

The docx example indeed seems to get stuck even with libreoffice wordmalo.docx --convert-to pdf. From unoserver is looks like it gets stuck when opening the file!?

@regebro What is this unoserver, what's the difference with unoconv? I'm not using it, should I change unoconv with unoserver?

regebro commented 2 years ago

@silva96 It would be great if you could try it. It's a simplified rewrite of unoconv, that has some added benefits, like allowing multiple servers, and also making it clear that you only need it if you want to run Libreoffice as a file conversion server, and there's little point in using it just to convert single files.

I've also noticed that some of the files that seem to put unoconv in an infinite loop works on unoserver. I haven't investigated why. But with this file it seemed to make no difference, though.

silva96 commented 2 years ago

I'm actually migrating to the Microsoft Graph Api and leaving LibreOffice/unoconv as a fallback method of conversion so I won't be able to try it. Sounds great though!