Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libreoffice document preview #17864

Closed
Bartarian opened this issue Nov 8, 2019 · 2 comments
Closed

libreoffice document preview #17864

Bartarian opened this issue Nov 8, 2019 · 2 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug

Comments

@Bartarian
Copy link

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:

  1. 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

  2. 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

@Bartarian Bartarian added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Nov 8, 2019
@kesselb
Copy link
Contributor

kesselb commented Dec 18, 2019

Fixed by #18456

@kesselb kesselb closed this as completed Dec 18, 2019
@SKB-CGN
Copy link

SKB-CGN commented Nov 29, 2021

Hi,
seems, that the error comes again with Nextcloud 22.2.3 after upgrade.

I do not see office previews anymore.

Error core ImagickException: unable to open image '/tmp//Address.png': No such file or directory @ error/blob.c/OpenBlob/3533
Error PHP Error: unlink(/tmp//Address.png): No such file or directory at /usr/local/www/nextcloud/lib/private/Preview/Office.php#66

Seems, that the instance-id or the folder is not returned properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug
Projects
None yet
Development

No branches or pull requests

3 participants