NextCloud Add OnlyOffice Error while downloading the document file to be converted

Nextcloud
Nextcloud version (eg, 20.0.5): 28
Operating system and version (eg, Ubuntu 20.04): 4.19.90-52.15.v2207.ky10.aarch64
nginx version (eg, Apache 2.4.25): 1.21.5
PHP version (eg, 7.4): 8.3.4

Onlyoffice
Installed with help from: How to Integrate OnlyOffice with NextCloud on Ubuntu - LinuxBabe

The issue you are facing:
Error onlyoffice GetConvertedUri on check error: Error occurred in the document service: Error while downloading the document file to be converted.

Is this the first time you’ve seen this error? (Y/N):Y

Nextcloud configuration and logs
The output of my nextcloud.log:

{"reqId":"Gq098e4iisPwJKxkhJgB","level":3,"time":"2024-05-27T05:22:33+00:00","remoteAddr":"XXXXX","user":"XXXXX","app":"onlyoffice","method":"PUT","url":"/apps/onlyoffice/ajax/settings/address","message":"getConvertedUri on check error","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 Edg/125.0.0.0","version":"28.0.3.2","exception":{"Exception":"Exception","Message":"\u6587\u6863\u670d\u52a1\u5185\u90e8\u53d1\u751f\u5f02\u5e38: Error while downloading the document file to be converted.","Code":0,"Trace":[{"file":"/usr/share/nginx/html/nextcloud/apps/onlyoffice/lib/DocumentService.php","line":103,"function":"processConvServResponceError","class":"OCA\\Onlyoffice\\DocumentService","type":"->"},{"file":"/usr/share/nginx/html/nextcloud/apps/onlyoffice/lib/DocumentService.php","line":444,"function":"getConvertedUri","class":"OCA\\Onlyoffice\\DocumentService","type":"->"},{"file":"/usr/share/nginx/html/nextcloud/apps/onlyoffice/lib/Controller/SettingsController.php","line":192,"function":"checkDocServiceUrl","class":"OCA\\Onlyoffice\\DocumentService","type":"->"},{"file":"/usr/share/nginx/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"saveAddress","class":"OCA\\Onlyoffice\\Controller\\SettingsController","type":"->"},{"file":"/usr/share/nginx/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/usr/share/nginx/html/nextcloud/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/usr/share/nginx/html/nextcloud/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/usr/share/nginx/html/nextcloud/lib/base.php","line":1069,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/usr/share/nginx/html/nextcloud/index.php","line":39,"function":"handleRequest","class":"OC","type":"::"}],"File":"/usr/share/nginx/html/nextcloud/apps/onlyoffice/lib/DocumentService.php","Line":249,"message":"getConvertedUri on check error","CustomMessage":"getConvertedUri on check error"}}

/usr/share/nginx/html/nextcloud/config/config.php:

<?php
$CONFIG = array (
  'instanceid' => 'oc1dj37xll3o',
  'passwordsalt' => 'kaigEJdL+dHY4tmjx6jpEcUrrkRkNI',
  'secret' => 'Mratj/hmDvDbsTyjaGImXCBb74AqPs/aQ3En3Hq2FIGaIlBG',
  'trusted_domains' => 
  array (
    0 => 'pan.xxxx.com',
    1 => '127.0.0.1',
    2 => '10.1.51.204',
    3 => '10.1.51.205',
    4 => '10.1.43.204',
    5 => 'onlyoffice.xxxx.com',
  ),
  'datadirectory' => '/data/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '28.0.3.2',
  'overwrite.cli.url' => 'https://pan.xxxx.com',
  'overwritehost' => 'pan.xxxx.com',
  'overwriteprotocol' => 'https',
  'dbname' => 'nextcloud_db',
  'dbhost' => '127.0.0.1:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextclouduser',
  'dbpassword' => 'nextcloudpasswd',
  'onlyoffice' =>
  array (
    'verify_peer_off' => true,
    'jwt_secret' => "NOvp27PTL3QdB435UwLTNSI4xnEycesy",
    'jwt_header' => "AuthorizationJwt",
  ),
  'allow_local_remote_servers' => true,
  'installed' => true,
);

onlyoffice configuration and logs
the onlyoffice is another machine,local.json :

{
  "services": {
    "CoAuthoring": {
      "sql": {
        "type": "postgres",
        "dbHost": "localhost",
        "dbPort": "5432",
        "dbName": "onlyoffice",
        "dbUser": "onlyoffice",
        "dbPass": "onlyoffice"
      },
      "token": {
        "enable": {
          "request": {
            "inbox": true,
            "outbox": true
          },
          "browser": true
        },
        "inbox": {
          "header": "AuthorizationJwt"
        },
        "outbox": {
          "header": "AuthorizationJwt"
        }
      },
      "secret": {
        "inbox": {
          "string": "NOvp27PTL3QdB435UwLTNSI4xnEycesy"
        },
        "outbox": {
          "string": "NOvp27PTL3QdB435UwLTNSI4xnEycesy"
        },
        "session": {
          "string": "NOvp27PTL3QdB435UwLTNSI4xnEycesy"
        }
      }
    }
  },
  "rabbitmq": {
    "url": "amqp://guest:guest@localhost"
  },
  "storage": {
    "fs": {
      "secretString": "7A0a1J9fjvMqVTboEMNR"
    }
  }
}

nginx/conf.d/ds.conf :

include /etc/nginx/includes/http-common.conf;
server {
  listen 127.0.0.1:80;
  listen [::]:80 default_server;
  server_name onlyoffice.xxxx.com;   
  server_tokens off;
  set $secure_link_secret 7A0a1J9fjvMqVTboEMNR;
  rewrite ^ https://$host$request_uri? permanent;
}
server {
  listen 0.0.0.0:443 ssl http2;
  listen [::]:443 ssl default_server;
  server_tokens off;
  root /usr/share/nginx/html;
  set $secure_link_secret 7A0a1J9fjvMqVTboEMNR;
  server_name onlyoffice.xxxx.com;   
  ssl_certificate /etc/xxxx.com.pem;   
  ssl_certificate_key /etc/xxxx.com.key;   
  ssl_verify_client off;
  ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
  ssl_protocols TLSv1.2;
  ssl_session_cache  builtin:1000  shared:SSL:10m;
  ssl_prefer_server_ciphers   on;
  add_header Strict-Transport-Security max-age=31536000;
  add_header Access-Control-Allow-Origin *;
  add_header X-Content-Type-Options nosniff;
  include /etc/nginx/includes/ds-*.conf;
}

/var/log/onlyoffice/documentserver/converter/out.log

[2024-05-27] [ERROR] [localhost] [conv_check_592047619_docx] [userId] nodeJS - error downloadFile:url=https://pan.xxxx.com/apps/onlyoffice/empty?doc=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY3Rpb24iOiJlbXB0eSJ9.h8zzMmYroF5JGPH2dhR6hW_Amp0LeNdq-GwGzAbhyB4;attempt=3;code:HPE_CR_EXPECTED;connect:null Error: Parse Error: Missing expected CR after header value
    at TLSSocket.socketOnData (node:_http_client:494:22)
    at TLSSocket.emit (node:events:527:28)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at TLSSocket.Readable.push (node:internal/streams/readable:228:10)
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23)

And suggestions on what I can try with?

Thanks in advance

@alexander_onlyoffice is there probably a direction you can point me to? Any hint, what the root cause for this issue might be or where I could search for it? Or do you know somebody else, who could help me? Thank you.

Hi, I have the same problem. in my case I run onlyoffice 8 on docker, the example is running and I can edit files, but I can’t link to nextcloud 29 after a php and nextcloud update.

Please help, I’ve been having the problem for 1 day

/var/www/nextcloud/data/nextcloud.log

{"reqId":"BPDEn8k1CwYjiODKGRxo","level":3,"time":"2024-06-11T16:13:03+00:00","remoteAddr":"172.17.x.x","user":"2BBC9933-564D-4F2A-803E-419BC030A67D","app":"onlyoffice","method":"PUT","url":"/index.php/apps/onlyoffice/ajax/settings/address","message":"getConvertedUri on check error","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36","version":"29.0.2.2","exception":{"Exception":"Exception","Message":"Se ha producido un error en el servicio de documentos: Error while downloading the document file to be converted.","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/onlyoffice/lib/DocumentService.php","line":103,"function":"processConvServResponceError","class":"OCA\\Onlyoffice\\DocumentService","type":"->"},{"file":"/var/www/nextcloud/apps/onlyoffice/lib/DocumentService.php","line":444,"function":"getConvertedUri","class":"OCA\\Onlyoffice\\DocumentService","type":"->"},{"file":"/var/www/nextcloud/apps/onlyoffice/lib/Controller/SettingsController.php","line":192,"function":"checkDocServiceUrl","class":"OCA\\Onlyoffice\\DocumentService","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":232,"function":"saveAddress","class":"OCA\\Onlyoffice\\Controller\\SettingsController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":138,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":338,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1050,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":49,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/apps/onlyoffice/lib/DocumentService.php","Line":249,"message":"getConvertedUri on check error","CustomMessage":"getConvertedUri on check error"}}

/var/log/onlyoffice/documentserver/converter\out.log

[2024-06-11T12:13:03.649] [ERROR] [localhost] [conv_check_1826646241_docx] [userId] nodeJS - error downloadFile:url=https://cloudy.inra.gob.bo/index.php/apps/onlyoffice/empty?doc=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY3Rpb24iOiJlbXB0eSJ9.KVKRuB48cYIoNKpEvRM_eyiLr3aOoCvn7Tt9Zra10AY;attempt=3;code:null;connect:null Error: Error response: statusCode:403; headers:{"date":"Tue, 11 Jun 2024 16:13:01 GMT","server":"Apache/2.4.41 (Ubuntu)","expires":"Thu, 19 Nov 1981 08:52:00 GMT","pragma":"no-cache","x-request-id":"nLk0TsRZgOwhhuFxaKAD","cache-control":"no-cache, no-store, must-revalidate","content-security-policy":"default-src 'none';base-uri 'none';manifest-src 'self';frame-ancestors 'none'","feature-policy":"autoplay 'none';camera 'none';fullscreen 'none';geolocation 'none';microphone 'none';payment 'none'","x-robots-tag":"noindex, nofollow","set-cookie":["oc_sessionPassphrase=j8hbvlsan8IvNWG%2FXn5uhaOJU03eb79Cz719UJyebBuYE6keqURPWuwx0iBCOMkV7SyCdF9C6i7FranrWCrKrOFXqKfX%2F9HbZIVMy2HJiuft3d14e%2B5A8wsF%2FgxQHr%2Fb; path=/; secure; HttpOnly; SameSite=Lax","__Host-nc_sameSiteCookielax=true; path=/; httponly;secure; expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=lax","__Host-nc_sameSiteCookiestrict=true; path=/; httponly;secure; expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=strict","oc95kr9suc00=tlnsptqh9439dhha7sqfc3jjbp; path=/; secure; HttpOnly; SameSite=Lax"],"strict-transport-security":"max-age=15552000; includeSubDomains","referrer-policy":"no-referrer","x-content-type-options":"nosniff","x-frame-options":"SAMEORIGIN","x-permitted-cross-domain-policies":"none","x-xss-protection":"1; mode=block","upgrade":"h2,h2c","connection":"Upgrade, Keep-Alive","keep-alive":"timeout=5, max=100","transfer-encoding":"chunked","content-type":"application/json; charset=utf-8"};
    at Request.fResponse (/snapshot/server/Common/sources/utils.js)
    at Request.emit (node:events:527:28)
    at Request.onRequestResponse (/snapshot/server/Common/node_modules/request/request.js:1066:10)
    at ClientRequest.emit (node:events:527:28)
    at HTTPParser.parserOnIncomingClient (node:_http_client:631:27)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17)
    at TLSSocket.socketOnData (node:_http_client:494:22)
    at TLSSocket.emit (node:events:527:28)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at TLSSocket.Readable.push (node:internal/streams/readable:228:10)
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23)

Error: Error response: statusCode:403; headers:{"date":"Tue, 11 Jun 2024 16:13:01 GMT","server":"Apache/2.4.41 (Ubuntu)","expires":"Thu, 19 Nov 1981 08:52:00 GMT....."

This line catches my attention, I am a newbie to Linux, please help

Answering me,
What I did was set up another server and set up onlyoffice with docker, according to the forums it is also to verify that they are at the same time and with that I now have the onlyoffice functional, I did not touch the nextcloud configuration.

My decision to do this was because the log says

"expires":"Thu, 19 Nov 1981 08:52:00 GMT