-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
hello,
when creating previews of libreoffice documents I get the following error:
unlink(/var/local/nextcloud/data/Myname/files/myfile.png): No such file or directory at /usr/share/webapps/nextcloud/lib/private/Preview/Office.php#65
I did some digging and found two problems:
-
libreoffice needs a home folder to run, even headless, as it creates some .config files; but my http user didn't have one. I fixed it by adding
putenv('HOME=' . $tmpDir);
in .../lib/private/Preview/Office.php, before line 53 -
the output folder of the conversion to png is $tmpDir (see .../lib/private/Preview/Office.php, line 51) while the previewer looks for the png file in $dirname. So I changed
$pngPreview = $dirname . '/' . $filename . '.png';
to:
$pngPreview = $tmpDir . '/' . $filename . '.png';
in .../lib/private/Preview/Office.php line 59.
This solved my problem, but I am not sure if it's a good fix, especially the first part.
Cheers