TL;DR
After updating our e-learning Moodle server (Ubuntu 24. 04) sometime in Sept. 2026, the preview of the assignments stopped working. After extended research what was wrong, the issue was in unoconv (converter script that calls Libreoffice that converts a document from .docx or .odt to pdf). The fix that worked is to replace 3 lines (unohelper.absolutize –> uno.absolutize) in the mentioned script.
The issue
Our Moodle deployment uses unoconv (Site admin/Plugins/Document converters).
After an initial setup some years ago, it worked flawlessly. Recently I noticed there is no document preview shown anymore. I think the reason is Ubuntu server update that I made approx. in that time.
When I clicked ‘Grade’ in Moodle assignments, a blank page appeared instead of uploaded document PDF preview.
Diagnosis
Firstly I played around with front-end, because I thought something is blocking loading of the assignment preview (browser – F12 – developer tools). No success.
Then I moved to back-end. I tried to run unoconv script and libreoffice converter from the server’s cli. I uploaded test.odt document to the server via scp, then I ran the document conversion commands:
#test unoconv with user www-data
sudo -u www-data unoconv -f pdf -o /tmp/test.pdf /tmp/test.odt
#check the file
file /tmp/lo-test/test.pdf
#and
#test libreoffice
libreoffice \
--headless \
--convert-to pdf \
--outdir /tmp/lo-test \
/tmp/test.odt
#check the file
file /tmp/lo-test/test.pdf Libreoffice conversion worked, but unoconv returned an error (something like AttributeError: module ‘unohelper’ has no attribute ‘absolutize’).
I found that the bug is documented in Debian mailing list:
https://mail-archive.com/debian-bugs-dist%40lists.debian.org/msg2114806.html
The fix
The unoconv script should be patched:
cd /usr/bin
cp unoconv unoconf_old #make backup of script
sed -i 's/unohelper\.absolutize/uno.absolutize/g' unoconv
# <--replace all occurences of unohelper.absolutize with uno.absolutizeThere were 3 occurrences of unohelper.absolutize that were replaced.
After that, restart unoconv service:
sudo systemctl restart unoconv #restart unoconv service
sudo systemctl status unoconv "check statusIf everything ok, it should output:
* unoconv.service - Unoconv listener for document conversions
Loaded: loaded (/etc/systemd/system/unoconv.service; enabled; preset: enabled)
Active: active (running) since Fri 2026-10-16 19:54:56 CEST; 2 days ago
Docs: https://github.com/dagwieers/unoconv
Main PID: 314 (python3)
Tasks: 6 (limit: 38172)
Memory: 137.5M (peak: 138.1M)
CPU: 5.426s
CGroup: /system.slice/unoconv.service
|-314 python3 /usr/bin/unoconv --listener
`-431 /usr/lib/libreoffice/program/soffice.bin --headless --invisible --nocrashreport --nodefa>
Oct 16 19:54:56 moodle systemd[1]: Started unoconv.service - Unoconv listener for document conversions.
Oct 16 19:54:57 moodle unoconv[314]: /usr/bin/unoconv:1238: DeprecationWarning: distutils Version classes ar>
Oct 16 19:54:57 moodle unoconv[314]: if product.ooName != "LibreOffice" or LooseVersion(product.ooSetupVer>
That’s it, that fix took 2 hrs of my life. This writeup doesn’t include all dead-ends and wrong assumptions.