Skip to content

joex unoconv xlsx: pdf fails: "Failed to connect to soffice.bin in 6 seconds" #3293

@tiborrr

Description

@tiborrr

When joex tries to convert XLSX to PDF using unoconv, it fails with:

/usr/bin/unoconv:778: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
Failed to connect to /usr/lib/libreoffice/program/soffice.bin (pid=604775) in 6 seconds.
Connector : couldn't connect to socket (Connection refused)
Error: Unable to connect or start own listener. Aborting.

This happens consistently. soffice.bin does start (new pid each time), but unoconv times out after 6s before the socket is ready. Multiple stalled listeners accumulate over time (ps shows 8+ on port 2002).

Environment

  • Docspell version: [fill in your version, e.g. from docker tag or logs]
  • Joex container OS: Ubuntu 24.10 (oracular)
  • unoconv: 0.7
  • LibreOffice: 24.8.7.2
  • Python: 3.12.7
  • Kernel: 6.11.0-1015-azure

Reproduction

  1. Run /usr/bin/unoconv -f pdf -o out.pdf in.xlsx inside running joex container
  2. Fails immediately, but new soffice.bin --accept=socket,host=127.0.0.1,port=2002 starts and lingers
root@docspell-joex:/# ps aux | grep soffice
root      544591  0.0  0.1 933696 18172 ?        Sl   Mar13   0:00 /usr/lib/libreoffice/program/soffice.bin --headless --invisible --nocrashreport --nodefault --nofirststartwizard --nologo --norestore --accept=socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext
root      544901  0.0  0.0 301052 14208 ?        S    Mar13   0:00 /usr/lib/libreoffice/program/soffice.bin --headless --invisible --nocrashreport --nodefault --nofirststartwizard --nologo --norestore --accept=socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext
root      602850  0.0  0.4 301052 72072 ?        S    14:25   0:00 /usr/lib/libreoffice/program/soffice.bin --headless --invisible --nocrashreport --nodefault --nofirststartwizard --nologo --norestore --accept=socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext
root      603009  0.0  0.4 301052 71852 ?        S    14:26   0:00 /usr/lib/libreoffice/program/soffice.bin --headless --invisible --nocrashreport --nodefault --nofirststartwizard --nologo --norestore --accept=socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext
root      604612  0.0  0.4 301052 71956 ?        S    14:31   0:00 /usr/lib/libreoffice/program/soffice.bin --headless --invisible --nocrashreport --nodefault --nofirststartwizard --nologo --norestore --accept=socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext
root      604775  0.0  0.4 301052 71592 pts/0    S    17:27   0:00 /usr/lib/libreoffice/program/soffice.bin --headless --invisible --nocrashreport --nodefault --nofirststartwizard --nologo --norestore --accept=socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext
root      604796  0.0  0.4 301052 71408 pts/0    S    17:46   0:00 /usr/lib/libreoffice/program/soffice.bin --headless --invisible --nocrashreport --nodefault --nofirststartwizard --nologo --norestore --accept=socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext
root      604800  0.0  0.4 301052 72096 pts/0    S    17:46   0:00 /usr/lib/libreoffice/program/soffice.bin --headless --invisible --nocrashreport --nodefault --nofirststartwizard --nologo --norestore --accept=socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext
root      604809  0.0  0.0   3604  1880 pts/0    S+   17:48   0:00 grep --color=auto soffice

Workarounds tried

  • pkill -f soffice.bin && unoconv -l Joex started working immidiately

Expected behavior
unoconv should either:

  • Use a persistent listener (like unoconv -l in background)
  • Increase timeout beyond 6s
  • Kill old listeners before spawning new

Additional context

  • Joex logs show unoconv calls during XLSX processing
  • Seen on Azure/Ubuntu 24.10 host
  • ps aux | grep soffice before/after attached

See my full log below.

root@docspell-joex:/# uname -a
Linux docspell-joex 6.11.0-1015-azure #15~24.04.1-Ubuntu SMP Thu May  1 02:52:08 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
root@docspell-joex:/# cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=24.10
DISTRIB_CODENAME=oracular
DISTRIB_DESCRIPTION="Ubuntu 24.10"
PRETTY_NAME="Ubuntu 24.10"
NAME="Ubuntu"
VERSION_ID="24.10"
VERSION="24.10 (Oracular Oriole)"
VERSION_CODENAME=oracular
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=oracular
LOGO=ubuntu-logo
root@docspell-joex:/# which soffice
/usr/bin/soffice
root@docspell-joex:/# unoconv -V
unoconv 0.7
Written by Dag Wieers <dag@wieers.com>
Homepage at http://dag.wieers.com/home-made/unoconv/

platform posix/linux
python 3.12.7 (main, Jun 18 2025, 13:16:51) [GCC 14.2.0]
LibreOffice 24.8.7.2
root@docspell-joex:/# ps aux | grep soffice
root      544591  0.0  0.1 933696 18172 ?        Sl   Mar13   0:00 /usr/lib/libreoffice/program/soffice.bin --headless --invisible --nocrashreport --nodefault --nofirststartwizard --nologo --norestore --accept=socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext
root      544901  0.0  0.0 301052 14208 ?        S    Mar13   0:00 /usr/lib/libreoffice/program/soffice.bin --headless --invisible --nocrashreport --nodefault --nofirststartwizard --nologo --norestore --accept=socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext
root      602850  0.0  0.4 301052 72072 ?        S    14:25   0:00 /usr/lib/libreoffice/program/soffice.bin --headless --invisible --nocrashreport --nodefault --nofirststartwizard --nologo --norestore --accept=socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext
root      603009  0.0  0.4 301052 71852 ?        S    14:26   0:00 /usr/lib/libreoffice/program/soffice.bin --headless --invisible --nocrashreport --nodefault --nofirststartwizard --nologo --norestore --accept=socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext
root      604612  0.0  0.4 301052 71956 ?        S    14:31   0:00 /usr/lib/libreoffice/program/soffice.bin --headless --invisible --nocrashreport --nodefault --nofirststartwizard --nologo --norestore --accept=socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext
root      604775  0.0  0.4 301052 71592 pts/0    S    17:27   0:00 /usr/lib/libreoffice/program/soffice.bin --headless --invisible --nocrashreport --nodefault --nofirststartwizard --nologo --norestore --accept=socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext
root      604796  0.0  0.4 301052 71408 pts/0    S    17:46   0:00 /usr/lib/libreoffice/program/soffice.bin --headless --invisible --nocrashreport --nodefault --nofirststartwizard --nologo --norestore --accept=socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext
root      604800  0.0  0.4 301052 72096 pts/0    S    17:46   0:00 /usr/lib/libreoffice/program/soffice.bin --headless --invisible --nocrashreport --nodefault --nofirststartwizard --nologo --norestore --accept=socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext
root      604809  0.0  0.0   3604  1880 pts/0    S+   17:48   0:00 grep --color=auto soffice
root@docspell-joex:/# /usr/bin/unoconv -f pdf -o out.pdf in.xlsx
/usr/bin/unoconv: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'):
Failed to connect to /usr/lib/libreoffice/program/soffice.bin (pid=604811) in 6 seconds.
Connector : couldn't connect to socket (Connection refused)
Error: Unable to connect or start own listener. Aborting.
root@docspell-joex:/# ps aux | grep soffice
root      544591  0.0  0.1 933696 18172 ?        Sl   Mar13   0:00 /usr/lib/libreoffice/program/soffice.bin --headless --invisible --nocrashreport --nodefault --nofirststartwizard --nologo --norestore --accept=socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext
root      544901  0.0  0.0 301052 14208 ?        S    Mar13   0:00 /usr/lib/libreoffice/program/soffice.bin --headless --invisible --nocrashreport --nodefault --nofirststartwizard --nologo --norestore --accept=socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext
root      602850  0.0  0.4 301052 72072 ?        S    14:25   0:00 /usr/lib/libreoffice/program/soffice.bin --headless --invisible --nocrashreport --nodefault --nofirststartwizard --nologo --norestore --accept=socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext
root      603009  0.0  0.4 301052 71852 ?        S    14:26   0:00 /usr/lib/libreoffice/program/soffice.bin --headless --invisible --nocrashreport --nodefault --nofirststartwizard --nologo --norestore --accept=socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext
root      604612  0.0  0.4 301052 71956 ?        S    14:31   0:00 /usr/lib/libreoffice/program/soffice.bin --headless --invisible --nocrashreport --nodefault --nofirststartwizard --nologo --norestore --accept=socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext
root      604775  0.0  0.4 301052 71592 pts/0    S    17:27   0:00 /usr/lib/libreoffice/program/soffice.bin --headless --invisible --nocrashreport --nodefault --nofirststartwizard --nologo --norestore --accept=socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext
root      604796  0.0  0.4 301052 71408 pts/0    S    17:46   0:00 /usr/lib/libreoffice/program/soffice.bin --headless --invisible --nocrashreport --nodefault --nofirststartwizard --nologo --norestore --accept=socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext
root      604800  0.0  0.4 301052 72096 pts/0    S    17:46   0:00 /usr/lib/libreoffice/program/soffice.bin --headless --invisible --nocrashreport --nodefault --nofirststartwizard --nologo --norestore --accept=socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext
root      604811  0.8  0.4 301052 71464 pts/0    S    17:48   0:00 /usr/lib/libreoffice/program/soffice.bin --headless --invisible --nocrashreport --nodefault --nofirststartwizard --nologo --norestore --accept=socket,host=127.0.0.1,port=2002,tcpNoDelay=1;urp;StarOffice.ComponentContext
root      604814  0.0  0.0   3604  1916 pts/0    S+   17:49   0:00 grep --color=auto soffice
root@docspell-joex:/# pkill -f soffice.bin && unoconv -l
/usr/bin/unoconv:1103: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  if product.ooName != "LibreOffice" or LooseVersion(product.ooSetupVersion) <= LooseVersion('3.3'):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions