Alfresco: Handling “LibreOffice not responding”

Alfresco Community uses LibreOffice for various content transformations. From time to time, certain transformations screw the Office server process. It stops responding to requests. There are most likely various triggers (type of transformation, actual document) for this misbehavior (endless loop, stuck, death, whatnot) of the process. There are alternatives preventing some of the issues, but it seems pretty hopeless to track everything down to the root cause and fix it.

The Community Edition uses the OODirect subsystem which also manages the lifecycle of the process. However, there is nothing in place to recover from a screwed/terminated process. The drop-in extension below provides this functionality. I have only tried it with Alfresco 5.1, but I think it should also work starting at 4.2.

To use it, drop it in webapps/alfresco/WEB-INF/lib or modules/platform. It won’t do anything unless you set a cron expression in like shown below.

contentreich.officeWatchDog.cronExpression=0 */10 * * * ?

The timeoutSeconds parameter says how long you are willing to wait before you consider the process screwed, kill will only work on a Unix system for now. The extension keeps track of the process, so it won’t work if you start/restart the Office process manually.

Enjoy! ;)

Download Alfresco Office Watchdog
Andreas Steffan
Pragmatic ? Scientist and DevOps Mind @ Contentreich. Believes in Open Source, the Open Web and Linux. Freelancing in DevOps-, Cloud-, Kubernetes, JVM- and Contentland and speaks Clojure, Kotlin, Groovy, Go, Python, JavaScript, Java, Alfresco and WordPress. Built infrastructure before it was cool. ❤️ Emacs.

6 thoughts on “Alfresco: Handling “LibreOffice not responding””

  1. Hallo Andreas,

    thanks for sharing! Yet another approach but looks straight forward instead of putting the jodconverter code back which has been removed in 4.2.
    Would you mind to put the OfficeWatchDog code on github to see what happens and to be able to fix things in case?

    What’s the license you share?


  2. Hi Heiko,

    in fact, I suggested putting it on github under the banner of “Order of the Bee” – aiming to push for a joint Alfresco fix effort. It seems nobody is interested, so I keep fixing and tweaking things for us and our customers. That’s most likely what you and other companies like Loftux do as well. From time to time, I’ll give away stuff for free.

    Lets face it: Collaboration on code does not work well in Alfresco land.

    Regarding the license, I am giving it away for free (Download link on the page) – without any warranty.

  3. Hi Andreas,
    OOTB or not. You may put it on your deas github account?

    Concerning joint Alfresco fix efforts: We put our patches modules also on our github account and should combine our work with Loftux …

  4. Hi Andreas,
    in your opinion what are the pros and cons of killing all the subprocesses?
    I ask you this because in the moment of restarting openoffice I would like to be able to recover the subprocesses without killing them but I would like to understand if this is possible.
    Actually I’m using the Alfresco 5.2 Community Edition.
    Thanks in advance

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert