Error generating JPEG preview image of docx document?

Document Server version:

apt-cache policy onlyoffice-documentserver | head -2 | xargs
onlyoffice-documentserver: Installed: 7.4.1-36

OS:

cat /etc/debian_version 
11.7

On a Debian Bullseye server running the .deb version of ONLYOFFICE and Nextcloud Hub 6 (27.1.1) I have noticed these errors in the data/nextcloud.log (I have formatted this using jq for readability):

{
  "reqId": "XX",
  "level": 3,
  "time": "2023-09-27T09:17:01+00:00",
  "remoteAddr": "XXX",
  "user": "cloud",
  "app": "onlyoffice",
  "method": "GET",
  "url": "/core/preview?fileId=29&x=250&y=250",
  "message": "GetConvertedUri: from docx to jpeg",
  "userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/118.0",
  "version": "27.1.1.0",
  "exception": {
    "Exception": "Exception",
    "Message": "Error occurred in the document service: Error while downloading the document file to be converted.",
    "Code": 0,
    "Trace": [
      {
        "file": "/home/cloud/sites/nextcloud/apps/onlyoffice/lib/DocumentService.php",
        "line": 95,
        "function": "ProcessConvServResponceError",
        "class": "OCA\\Onlyoffice\\DocumentService",
        "type": "->"
      },
      {
        "file": "/home/cloud/sites/nextcloud/apps/onlyoffice/lib/Preview.php",
        "line": 269,
        "function": "GetConvertedUri",
        "class": "OCA\\Onlyoffice\\DocumentService",
        "type": "->"
      },
      {
        "file": "/home/cloud/sites/nextcloud/lib/private/Preview/ProviderV1Adapter.php",
        "line": 53,
        "function": "getThumbnail",
        "class": "OCA\\Onlyoffice\\Preview",
        "type": "->"
      },
      {
        "file": "/home/cloud/sites/nextcloud/lib/private/Preview/GeneratorHelper.php",
        "line": 64,
        "function": "getThumbnail",
        "class": "OC\\Preview\\ProviderV1Adapter",
        "type": "->"
      },
      {
        "file": "/home/cloud/sites/nextcloud/lib/private/Preview/Generator.php",
        "line": 397,
        "function": "getThumbnail",
        "class": "OC\\Preview\\GeneratorHelper",
        "type": "->"
      },
      {
        "file": "/home/cloud/sites/nextcloud/lib/private/Preview/Generator.php",
        "line": 373,
        "function": "generateProviderPreview",
        "class": "OC\\Preview\\Generator",
        "type": "->"
      },
      {
        "file": "/home/cloud/sites/nextcloud/lib/private/Preview/Generator.php",
        "line": 166,
        "function": "getMaxPreview",
        "class": "OC\\Preview\\Generator",
        "type": "->"
      },
      {
        "file": "/home/cloud/sites/nextcloud/lib/private/Preview/Generator.php",
        "line": 116,
        "function": "generatePreviews",
        "class": "OC\\Preview\\Generator",
        "type": "->"
      },
      {
        "file": "/home/cloud/sites/nextcloud/lib/private/PreviewManager.php",
        "line": 192,
        "function": "getPreview",
        "class": "OC\\Preview\\Generator",
        "type": "->"
      },
      {
        "file": "/home/cloud/sites/nextcloud/core/Controller/PreviewController.php",
        "line": 144,
        "function": "getPreview",
        "class": "OC\\PreviewManager",
        "type": "->"
      },
      {
        "file": "/home/cloud/sites/nextcloud/core/Controller/PreviewController.php",
        "line": 113,
        "function": "fetchPreview",
        "class": "OC\\Core\\Controller\\PreviewController",
        "type": "->"
      },
      {
        "file": "/home/cloud/sites/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 230,
        "function": "getPreviewByFileId",
        "class": "OC\\Core\\Controller\\PreviewController",
        "type": "->"
      },
      {
        "file": "/home/cloud/sites/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 137,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/home/cloud/sites/nextcloud/lib/private/AppFramework/App.php",
        "line": 183,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/home/cloud/sites/nextcloud/lib/private/Route/Router.php",
        "line": 315,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::"
      },
      {
        "file": "/home/cloud/sites/nextcloud/lib/base.php",
        "line": 1068,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->"
      },
      {
        "file": "/home/cloud/sites/nextcloud/index.php",
        "line": 36,
        "function": "handleRequest",
        "class": "OC",
        "type": "::"
      }
    ],
    "File": "/home/cloud/sites/nextcloud/apps/onlyoffice/lib/DocumentService.php",
    "Line": 241,
    "message": "GetConvertedUri: from docx to jpeg",
    "CustomMessage": "GetConvertedUri: from docx to jpeg"
  }
}

Other than this error ONLYOFFICE is working fine, I can open and edit documents.

I’m not sure if this is a ONLYOFFICE or Nextcloud issue (or both?) or how to find the cause, it looks to me that it might be an error generating a JPEG thumbnail of the front page of a document?

The URL in question, /core/preview?fileId=29&x=250&y=250 returns a empty JSON list when requested while logged in:

[]

Does anyone have any suggestions regarding how to debug and / or fix this?

hello @chris :wave:

  1. Let’s clarify the connector version right away, although it seems to be the latest.
  2. Send the Document Server logs in a private message or in the topic with a link to the archive: /var/log/onlyoffice/documentserver/
  3. Send a screenshot of the problematic preview image.
  4. Does the issue affect all files or just one, or only DOCX files?
  5. Hmm, please send the connector settings.

You can change the Common Settings:)

1 Like

Thanks @Nikolas this is what I have:

  1. By β€œthe connector version” I think you mean the Nextcloud ONLYOFFICE app version?

    occ app:list | grep onlyoffice
      - onlyoffice: 8.2.0
    
  2. I have deleted all the gzipped logs so /var/log/onlyoffice/documentserver only contains these files:

    .
    β”œβ”€β”€ converter
    β”‚   β”œβ”€β”€ err.log
    β”‚   β”œβ”€β”€ out.log
    β”‚   └── out.log-20230929
    β”œβ”€β”€ docservice
    β”‚   β”œβ”€β”€ err.log
    β”‚   β”œβ”€β”€ out.log
    β”‚   └── out.log-20230929
    β”œβ”€β”€ metrics
    β”‚   β”œβ”€β”€ err.log
    β”‚   β”œβ”€β”€ out.log
    β”‚   └── out.log-20230929
    β”œβ”€β”€ nginx.error.log
    └── nginx.error.log-20230921
    

    And I have sent you a private message containing a URL to download them.

  3. I don’t know where a preview would be shown? I was only reporting an error I found in the logs, everything appears to be working OK, this is on a development server, I can create an account for you on it if that would help?

  4. I don’t know where the effect would be found?

  5. As I have said it’s a development server so I have shared the results of:

     occ config:list --private > config.json
    

    with you in a private message.

Thanks for the suggestion regarding how to disable the generation of preview images, perhaps that is the best thing to do? :man_shrugging:

hi @chris

The logs you provided for September 29th are empty.
Based on your previous inquiry, it seems that the issue occurred on the 27th.

  1. Is it possible for you to provide logs for the 27th?
  2. Is the issue reproducible in the new logs (nextcloud.log)?
  3. Have you installed any custom fonts on the server?
  4. For a more in-depth analysis of the problem, we need extended logs from the document server.
    As a first step, try disabling the preview generation setting and check if the log entry repeats.

  1. It’s possible that the issue is specific to certain documents. Do you have the ability to provide these documents?

Okay, let’s go to the PM