Error while trying to connect from OnlyOffice to Nextcloud

Hello everyone,

I have installed ONLYOFFICE Docs Community Edition 7.0.1 as indicated in the documentation on the ONLYOFFICE website.
It is installed on a Ubuntu 18.04 LTS.
It integrated well with my Nextcloud (this one is installed on another computer).

However when I updated the version from 7.0.1 to 7.2.1, it does not want to connect to my Nextcloud.
It tells me as error message:
“Error while attempting to connect (An error occurred in the document service: Error while downloading the document file to be converted.) (version 7.3.0.184)”

My Nextcloud version is there 20.0.14.

And when I use the built-in test example it tells me this:
screen

Do you have any idea what I could do to get this one to successfully reconnect to my Nextcloud?

Hello @onlyofficepb

First of all, I want you to pay attention that you are using an outdated version of Document Server, the actual version is 7.3.3.

Second, starting from version 7.2 JWT Token is enabled by default.

So far, I am quite confused about which version is currently installed on your server.

You are telling that updated to version 7.2.1, but in the error message it is stated that the version is 7.3.0.

Could please double check the currently installed version with command apt list --installed | grep onlyoffice and share the output?
Additionally, please specify the installation method whether it is Docker or DEB/RPM packages.

Hello @Constantine

Thank you for your quick answer.

Yes indeed the current version is 7.3.3 but as I had a problem on the 7.3.0 I wanted to find an answer to my problem before starting another version update

It is a mistake on my part it is indeed the version 7.3.0.184 installed on the machine.
image

Concerning the installation it was an installation of DEB/RPM packages, I had followed for the installation of there 7.0.1 this procedure which now is for the 7.3.3 : Installer ONLYOFFICE Docs sur Debian, Ubuntu et dérivés - ONLYOFFICE

Thank you for your help

Thank you for the confirmation.

To fix the issue you have two options:

  • disable JWT Token (not recommended);
  • configure JWT Token on both sides (Document Server and Nextcloud).

If you decide to disable it, please follow these simple steps:

  1. Locate local.json config of Document Server in /etc/onlyoffice/documentserver/;
  2. Open it and find section "token", then change "inbox", "outbox" and "browser" strings to false like that:
      "token": {
        "enable": {
          "request": {
            "inbox": false,
            "outbox": false
          },
          "browser": false
        },
  1. After that restart Document Server services with systemctl restart ds-* to apply the change.

To make sure that JWT Token is configured properly on both sides, please follow this instruction:

  1. In the mentioned local.json config locate "secret" section and fetch JWT Token secret key (marked on the example below as <secret>):
      },
      "secret": {
        "inbox": {
          "string": "<secret>"
        },
        "outbox": {
          "string": "<secret>"
        },
        "session": {
          "string": "<secret>"
        }
      }
  1. Open your Nextcloud portal and proceed to the ONLYOFFICE connector app settings;
  2. Make sure that the address of Document Server is valid, then in the Secret key field insert your secret key (<secret> from local.json) and try connecting.

Let me know if it helps.

Hello @Constantine

I have just tried the whole configuration that you have indicated just on your post.

So I have this in my local.json file :
image

And when I enter on my nextcloud the address and then the secret key indicated in the local.json file, I always have the same error message which is : “Error while trying to connect (An error occurred in the document service: Error while downloading the document file to be converted.) (version 7.3.0.184)”.

Thank you again for your answers.

Hello @onlyofficepb

As I can see, you have JWT Token disabled. That way you have to leave Secret key field blank in the connector settings.

Indeed I deactivated it to test but my first goal was to make it work by letting it activate but even by leaving the “true” instead of the “false” and with my secret key, I still have this error message.

Please set inbox, outbox and browser values back to true to enable JWT, restart Document Server services with systemctl restart ds-* to apply the change and then specify token credentials on Nextcloud side:

  1. Locate config.php of Nextcloud in config folder of root Nextcloud catalog;
  2. Add next section to it to specify JWT credentials:
  'onlyoffice' =>
  array (
    "jwt_secret" =>"<secret>",
    "jwt_header" =>"<header>"
  ),

In your case <header> is AuthorizationJwt and <secret> is test, so it should be like that:

    "jwt_secret" =>"AuthorizationJwt",
    "jwt_header" =>"test"

After that try to connect again.

I reset the values to enable JWT and restart the Document Server.
I have this in my local.json file:

      "token": {
        "enable": {
          "request": {
            "inbox": true,
            "outbox": true
          },
          "browser": true
        },
        "inbox": {
          "header": "AuthorizationJwt"
        },
        "outbox": {
          "header": "AuthorizationJwt"
        }
      },
      "secret": {
        "inbox": {
          "string": "test"
        },
        "outbox": {
          "string": "test"
        },
        "session": {
          "string": "test"

On Nextcloud I added the line :
"jwt_header" => "test"
So I have this in my config.php file :
image

I restarted my web server to take the changes into account but still get this error message: “Error while attempting to connect (An error occurred in the document service: Error while downloading the document file to be converted.) (version 7.3.0.184)”.

Please provide us log files of Document Server that are located in /var/log/onlyoffice/documentserver for analysis.
You can upload them to your portal and share an external link. If you are worried about any sensitive data, you can send the link me via PM.

Very well, however when I want to send you a personal message, it tells me that it is not possible…

I have increased your trust level, please try again.

I got the same issue,
tried all variants I guess but no luck

nextcloud and OO are on the different servers
nextcloud is public via reverse proxy and OO is accessible via private address through reverse proxy in order to get SSL certificate

[2024-03-06T08:46:31.697] [ERROR] [localhost] [conv_check_1010098590_docx] [userId] nodeJS - error downloadFile:url=http://10.9.9.3/apps/onlyoffice/empty?doc=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY3Rpb24iOiJlbXB0eSJ9.to7r0HOAVsJpw1a2HRLSxoNzoEs9mosxor3NvmCK8s0;attempt=3;code:null;connect:null Error: Error response: statusCode:403; headers:{“server”:“nginx”,“date”:“Wed, 06 Mar 2024 08:46:25 GMT”,“content-type”:“application/json; charset=utf-8”,“content-length”:“27”,“connection”:“keep-alive”,“set-cookie”:[“oc_sessionPassphrase=cTpjANL0xxccqhs8x4oTnZTAlx74A%2F1qaIT8XVT8Q4h8kp6hGmbOU18HjuBQbN47sL%2BQ7I0fcbtTaj5PU1zQCd%2B%2FqB3tslJlzypoy6ezisHCrdr5q%2FMj2hRvcYNRzdMr; path=/; HttpOnly; SameSite=Lax”,“nc_sameSiteCookielax=true; path=/; httponly;expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=lax”,“nc_sameSiteCookiestrict=true; path=/; httponly;expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=strict”,“ocy4rki19yaq=ca518e86a86484431227d6f3ceea689a; path=/; HttpOnly; SameSite=Lax”],“expires”:“Thu, 19 Nov 1981 08:52:00 GMT”,“pragma”:“no-cache”,“cache-control”:“no-cache, no-store, must-revalidate”,“x-request-id”:“dAEABsvBqnbiuohxlCTg”,“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, noindex, nofollow”,“referrer-policy”:“no-referrer”,“x-content-type-options”:“nosniff”,“x-download-options”:“noopen”,“x-frame-options”:“SAMEORIGIN”,“x-permitted-cross-domain-policies”:“none”,“x-xss-protection”:“1; mode=block”};

Hello @Semyon

Please try executing this command:

sudo bash /usr/bin/documentserver-update-securelink.sh

In general, take a look at proxy configs we suggest using with Document Server:

I use Nginx Proxy Manager as a reverse proxy.
According your suggestion I tried to add some changes into nginx config for DS host.
I didn’t succeeded in it and decided to rollback to the initial configuration that were at the start.
And somehow NC connector started working, so the issue was in the reverse proxy but not understandable for me.

1 Like