Skip to content

libreoffice document preview #17864

Closed
Closed

Description

@A-Barta

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

Activity

  1. added
    0. Needs triagePending check for reproducibility or if it fits our roadmap
    on Nov 8, 2019
  2. kesselb commented on Dec 18, 2019

    @kesselb
    Contributor

    Fixed by #18456

  3. SKB-CGN commented on Nov 29, 2021

    @SKB-CGN

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. Needs triagePending check for reproducibility or if it fits our roadmapbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions