unoconv document conversion fails for certain word docs

Picture of Hittesh Ahuja
unoconv document conversion fails for certain word docs
Plugin developersTesters

We have been struggling with this for a few weeks now and wondering if anyone else is in the same boat?  Last year we enabled and have been successfully using the unoconv document converter to convert word docs to PDF for Moodle Assignment Annotation PDF feature. Recently we've hit a major issue where some documents fail to convert and are "stuck" which in turn hold up the queue in the \assignfeedback_editpdf\task\convert_submissions (Annotate PDF) scheduled task belonging to the mdl_assignfeedback_editpdf_queue.

Any document stuck in the queue also crashes the user interface where you either get a white screen of death or the page becomes unresponsive after a while.

Our external hosts have managed to minimise the issue by having a compatible LibreOffice version with unoconv (stated below) which withstands most conversions but you still get an odd one here and there which holds up the whole queue.


Potential work-around:

-          Going forward we plan to keep Document conversions (a new feature added to Moodle 3.4) open turned on BUT make PDF the default submission type which would help minimise the problem but we are really not pleased with this as academic really enjoy the features of word documents being automatically converted to PDF on the fly for them to easily annotate all on one single grading page.

-          An automated script that kills the last item stuck in the queue so the rest of the items can move on to being converted. The only problem here is how to you determine if something is definitely “stuck”? Do you keep a record of the last successfully converted item and compare it with the current one determining a threshold for how long an item has been in the queue ( for example more than 30 mins ) and hence qualifies as “stuck” ?

We do appreciate that none of the solutions are full-proof and hence the best way would be if someone could confirm that unoconv is the best way forward and maybe a work around on how to deal with documents that fail to convert.

For now, we are keeping a record of every offended submission in an excel sheet to collect evidence on why the documents might fail to convert.

Anyone else in a similar situation to us and are using any clever automated scripts to combat or even fix the conversions?

Also, is one else using a different document converter mechanism to unoconv? We do know of Microsoft Office converter and Google Drive converter but we are not so sure with the latter one due to the safe harbour agreement.  


Software specifications:

Moodle 3.1 with mySQL


Unoconv 0.8.2 ( using a listener) 

Happy to provide any more server info if required. 

Related forum posts:

Thanks a lot ,

Hittesh Ahuja

Average of ratings: -
Picture of Adam Barbary
Re: unoconv document conversion fails for certain word docs

Hi Hittesh,

I think moving to PDF as your default submission format is probably the best way forward. Not only are there issues with text document conversions failing, there are also many areas where the converted document loses formatting and generates strange text, particularly around tables and referencing. A submitted PDF should be behave the same as a text document in the annotator, so staff shouldn't notice any difference when marking these.

I personally would like to see an option for disabling the conversion on an assignment by assignment basis as some assignment types are clearly best left in their native format. eg. Data samples in spreadsheets. One file submitted was converted to several thousand PDF pages.



Average of ratings: -
Picture of Susana L.
Re: unoconv document conversion fails for certain word docs

Hi Hittesh,

We are having a similar problem using moodle 3.1:

I also would like to understand if the problem is solved in moodle 3.5, or if the most secure option for the next academic year is to disable the feature at all...


Average of ratings: -