docling icon indicating copy to clipboard operation
docling copied to clipboard

LibreOffice DOCX/PPTX/XLSX conversions have no timeout and share a colliding user profile

Open DanielNg0729 opened this issue 4 months ago • 0 comments

Bug

The LibreOffice-backed conversions used for DOCX DrawingML objects, PPTX chart rendering, and XLSX EMF/WMF images have two related problems:

  1. The shared get_docx_to_pdf_converter() helper (docling/backend/docx/drawingml/utils.py), used by the DOCX and PPTX backends, calls soffice --headless --convert-to pdf with no timeout. A hung LibreOffice process (e.g. a modal dialog it can't show in headless mode, or a malformed input) blocks the calling thread forever.

  2. MsExcelDocumentBackend duplicates the same subprocess call independently, with its own 60s timeout — better, but neither implementation passes -env:UserInstallation. LibreOffice takes an exclusive lock on its default user profile directory, so when two conversions run concurrently (parallel Docling workers, docling-serve handling simultaneous requests, or a job that touches DOCX+XLSX+PPTX content at once), the second soffice invocation can fail to acquire the lock and the conversion fails intermittently and silently (the image/chart is just skipped).

Steps to reproduce

  1. Run two documents that each contain LibreOffice-dependent content (DrawingML objects, EMF/WMF images, or native charts) through Docling concurrently — e.g. two worker processes, or docling-serve handling 2 simultaneous requests.
  2. Observe that one conversion hangs (DOCX/PPTX path, no timeout) or silently drops the affected image/chart (profile lock contention).

Expected

Every LibreOffice invocation should be bounded by a timeout and use an isolated profile directory so concurrent conversions can't interfere with each other.

Docling version

2.113.0

Python version

3.13

DanielNg0729 avatar Jul 17 '26 09:07 DanielNg0729