nextcloud / nextcloud/workflow_pdf_converter

libreoffice can hang in an infinite(?) loop

Open
#1 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
26
Forks
8
Avg merge
10h 30m
Merged PRs (30d)
31

Description

Observed it with an ogg file. LibreOffice would try to treat it with the Writer import filter and just run and run and run as waste CPU cycles but don't come to an end (I waited about half an hour). Audio- and Video mimetype now are black listed, howerver I would not trust LibreOffice be working properly with other unexpected formats or perhaps corrupted files. Since the libreoffice would run, the cron job would run, too, and not finish, thus block everything.

To avoid this, we shoud switch from using exec to proc_open and friends which allow more control, for instance cancelling the process after some time. Cf. https://github.com/nextcloud/pdf_converter/blob/master/lib/BackgroundJobs/Convert.php#L87-L95

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the referenced Convert.php section in nextcloud/pdf_converter and the workflow's current LibreOffice invocation. Determine how the process can be monitored and stopped safely, then verify that a hanging or unexpectedly formatted input cannot block the cron job indefinitely.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.