Skip to content

[Bug]: unoserver crash loop on startup (v2.11.0, :latest Standard) #6397

@ToledoEM

Description

@ToledoEM

Installation Method

Docker

The Problem

Since v2.11.0 (PR #6328), the :latest slim image now ships unoserver. On startup, unoserver fails to bind port 2003 with OSError: [Errno 98] Address already in use, the watcher restarts it immediately, and it fails again — no backoff, no exit. The loop runs indefinitely. The main app starts fine. LibreOffice-based conversions don't work.

Logs:

INFO:unoserver:Failed to start servers
unoserver PID 1242 not found for port 2003
Restarting unoserver on 127.0.0.1:2003 (uno-port 2004)

OSError: [Errno 98] Address already in use
INFO:unoserver:Failed to start servers

Environment: stirlingtools/stirling-pdf:latest (slim, without LibreOffice) v2.11.0, running as a Home Assistant add-on (single container, no host-level port conflicts).

Expected: unoserver starts cleanly, or fails once with a clear error and stops retrying. unoserver is a LibreOffice bridge

EDITED it should not be included in the slim image where LibreOffice is absent.

Version of Stirling-PDF

2.11.0

Last Working Version of Stirling-PDF

2.10.1

Page Where the Problem Occurred

No response

Docker Configuration

# hadolint ignore=DL3007
FROM stirlingtools/stirling-pdf:latest

# Install s6-overlay and bashio (HA supervisor tooling)
ARG S6_OVERLAY_VERSION=3.2.0.2
# hadolint ignore=DL3008
RUN apt-get update \
    && apt-get install -y --no-install-recommends \
         curl \
         xz-utils \
         jq \
    && rm -rf /var/lib/apt/lists/* \
    && ARCH="$(dpkg --print-architecture)" \
    && case "$ARCH" in \
         amd64)   S6_ARCH="x86_64"   ;; \
         arm64)   S6_ARCH="aarch64"  ;; \
         *) echo "Unsupported arch: $ARCH"; exit 1 ;; \
       esac \
    && curl -fsSL "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz" \
       | tar -C / -Jxp \
    && curl -fsSL "https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${S6_ARCH}.tar.xz" \
       | tar -C / -Jxp \
    && mkdir -p /usr/lib/bashio \
    && curl -fsSL "https://github.com/hassio-addons/bashio/archive/refs/heads/main.tar.gz" \
       | tar -C /usr/lib/bashio --strip-components=2 -xz bashio-main/lib \
    && ln -sf /usr/lib/bashio/bashio /usr/bin/bashio \
    && printf '#!/usr/bin/env bash\n. /usr/lib/bashio/bashio.sh\nexec "$@"\n' > /usr/bin/with-contenv \
    && chmod +x /usr/bin/with-contenv \
    && apt-get purge -y --auto-remove curl xz-utils

COPY run.sh /run.sh
COPY rootfs /

RUN chmod +x /run.sh \
    && chmod +x /etc/s6-overlay/s6-rc.d/stirling_pdf/run \
    && chmod +x /etc/s6-overlay/s6-rc.d/stirling_pdf/finish

ARG BUILD_VERSION
LABEL \
  io.hass.version="${BUILD_VERSION}" \
  io.hass.type="addon" \
  io.hass.arch="aarch64|amd64"

ENTRYPOINT ["/init"]

Relevant Log Output

INFO:unoserver:Failed to start servers
unoserver PID 1343 not found for port 2003
Restarting unoserver on 127.0.0.1:2003 (uno-port 2004)
INFO:unoserver:Starting unoserver 3.6.
INFO:unoserver:Command: /usr/bin/soffice --headless --invisible --nocrashreport --nodefault --nologo --nofirststartwizard --norestore -env:UserInstallation=file:///root/.libreoffice_uno_1001/instance_2003 --accept=socket,host=127.0.0.1,port=2004,tcpNoDelay=1;urp;StarOffice.ComponentContext
Exception in thread Thread-1 (serve):
Traceback (most recent call last):
  File "/usr/lib/python3.12/threading.py", line 1073, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.12/threading.py", line 1010, in run
    self._target(*self._args, **self._kwargs)
  File "/opt/venv/lib/python3.12/site-packages/unoserver/server.py", line 133, in serve
    with XMLRPCServer((self.interface, int(self.port)), allow_none=True) as server:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv/lib/python3.12/site-packages/unoserver/server.py", line 44, in __init__
    super().__init__(addr=addr_info[0][4], allow_none=allow_none)
  File "/usr/lib/python3.12/xmlrpc/server.py", line 594, in __init__
    socketserver.TCPServer.__init__(self, addr, requestHandler, bind_and_activate)
  File "/usr/lib/python3.12/socketserver.py", line 457, in __init__
    self.server_bind()
  File "/usr/lib/python3.12/socketserver.py", line 473, in server_bind
    self.socket.bind(self.server_address)
OSError: [Errno 98] Address already in use
INFO:unoserver:Failed to start servers

Additional Information

No response

Browsers Affected

No response

No Duplicate of the Issue

  • I have verified that there are no existing issues raised related to my problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions