Bug 165417 - headless soffice.bin (from converter) does not quit, which silently breaks LibreOffice with GUI
Summary: headless soffice.bin (from converter) does not quit, which silently breaks Li...
Status: RESOLVED NOTOURBUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
24.8.5.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-24 13:35 UTC by Vincent Lefevre
Modified: 2025-11-22 11:59 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vincent Lefevre 2025-02-24 13:35:16 UTC
Under Linux (Debian/unstable), after running a conversion tool such as odt2*, a headless soffice.bin process is often left behind (at least when an error occurs). In such a case, when I run LibreOffice with GUI, say by running "libreoffice" from the command line, this succeeds (i.e. I do not get any error), but nothing happens: I do not get any window.
Comment 1 Mike Kaganski 2025-02-24 13:44:47 UTC
1. Without being able to reproduce the problem, it's impossible to find out why it doesn't exit - and impossible to act on it.

2. But the conversion tool itself - is it LibreOffice? Or is it something that makes use of LibreOffice? That tool itself shouldn't use the default LibreOffice profile - that would avoid interference between it and the interactive LibreOffice instance. But that is a bug of that tool.
Comment 2 Vincent Lefevre 2025-02-24 13:58:27 UTC
To reproduce the issue:

$ touch file.odt
$ odt2sxw file.odt
/bin/odt2sxw:778: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  if product.ooName not in ('LibreOffice', 'LOdev') or LooseVersion(product.ooSetupVersion) <= LooseVersion('3.3'):
Traceback (most recent call last):
  File "/bin/odt2sxw", line 1037, in convert
    document.storeToURL(outputurl, tuple(outputprops) )
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
uno.com.sun.star.io.IOException: SfxBaseModel::impl_store <file:///home/vinc17/file.sxw> failed: 0x81a(Error Area:Io Class:Parameter Code:26)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/bin/odt2sxw", line 1282, in <module>
    main()
    ~~~~^^
  File "/bin/odt2sxw", line 1198, in main
    convertor.convert(inputfn)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/bin/odt2sxw", line 1039, in convert
    raise UnoException("Unable to store document to %s (ErrCode %d)\n\nProperties: %s" % (outputurl, e.ErrCode, outputprops), None)
                                                                                                     ^^^^^^^^^
  File "/usr/lib/python3/dist-packages/uno.py", line 507, in _uno_struct__getattr__
    return getattr(self.__dict__["value"], name)
AttributeError: ErrCode

where odt2sxw comes from the unoconv Debian package.
Comment 3 Vincent Lefevre 2025-02-24 14:08:47 UTC
Note: I've chosen odt2sxw as an example, as AFAIK, it always fails with this error and a headless soffice.bin process left behind. But I could also reproduce an error with odt2txt (also from unoconv) on a private OpenDocument Spreadsheet (.ods) file.
Comment 4 Buovjaga 2025-11-13 16:47:44 UTC
I installed

https://archlinux.org/packages/extra/x86_64/odt2txt/
https://archlinux.org/packages/extra/any/unoconv/

but there is no odt2sxw command. Please advise.
Comment 5 Vincent Lefevre 2025-11-21 23:39:04 UTC
The Makefile contains

install:
        install -d -m0755 $(DESTDIR)$(bindir)
        install -d -m0755 $(DESTDIR)$(mandir)/man1/
        install -p -m0755 unoconv $(DESTDIR)$(bindir)/unoconv
        install -p -m0644 doc/unoconv.1 $(DESTDIR)$(mandir)/man1/unoconv.1

install-links: $(links)

$(filter %,$(links)):
        ln -sf unoconv $(DESTDIR)$(bindir)/$@

I suppose that archlinux just installs unoconv, i.e. "make install".
Debian does the equivalent of
  make install install-links

So odt2sxw is just a symbolic link to unoconv, and I suppose that it is equivalent to "unoconv -f sxw".
Comment 6 Buovjaga 2025-11-22 07:56:48 UTC
Ok, tested with 0 byte odt, but soffice.bin process does not linger afterwards:

$ unoconv -f sxw ./file.odt
/usr/bin/unoconv:860: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  if product.ooName not in ('LibreOffice', 'LOdev') or LooseVersion(product.ooSetupVersion) <= LooseVersion('3.3'):
unoconv: UnoException during export phase:
Unable to store document to file:///satadisk/libobugs/file.sxw (Error (com.sun.star.io.IOException){ (com.sun.star.uno.Exception){ Message = (string)"SfxBaseModel::impl_store <file:///satadisk/libobugs/file.sxw> failed: 0x81a(Error Area:Io Class:Parameter Code:26)", Context = (com.sun.star.uno.XInterface)0x0{} } })

Properties: ((com.sun.star.beans.PropertyValue){ Name = (string)"FilterName", Handle = (long)0x0, Value = (any){ (string)"StarOffice XML (Writer)" }, State = (com.sun.star.beans.PropertyState)DIRECT_VALUE }, (com.sun.star.beans.PropertyValue){ Name = (string)"OutputStream", Handle = (long)0x0, Value = (any){ (com.sun.star.uno.XInterface)0x55a32389b0b8{, supportedInterfaces={com.sun.star.io.XOutputStream,com.sun.star.lang.XTypeProvider}} }, State = (com.sun.star.beans.PropertyState)DIRECT_VALUE }, (com.sun.star.beans.PropertyValue){ Name = (string)"Overwrite", Handle = (long)0x0, Value = (any){ (boolean)true }, State = (com.sun.star.beans.PropertyState)DIRECT_VALUE })

Arch Linux 64-bit
Version: 25.8.3.2 (X86_64) / LibreOffice Community
Build ID: 580(Build:2)
CPU threads: 8; OS: Linux 6.17; UI render: default; VCL: kf6 (cairo+wayland)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
25.8.3-1
Calc: CL threaded
Comment 7 Mike Kaganski 2025-11-22 11:59:26 UTC
I was able to reproduce, using Ubuntu with its unoconv (using both odt2sxw, and unoconv -f sxw). After the failure, `pidof soffice.bin` gives a pid, and without killing it, `libreoffice` silently does nothing.

Closing NOTOURBUG. It is the error in unoconv, that doesn't stop the process it launched, when there is an error. It starts it initially in listening mode, using a command line like

> soffice --headless --invisible --nocrashreport --nodefault --nofirststartwizard --nologo --norestore --accept=socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext

and then it attaches to it, passes commands to the listened port, and eventually is expected to stop the process.

There is nothing that can be changed in LibreOffice, which works correctly.