Nextcloud integration broken with documentserver 7.1 (URI malformed)

After upgrading onlyoffice-documentserver (on Debian Bullseye) from 7.0.1-37 to 7.1.0-215, the Nextcloud integration doesn’t work any longer. It always reports “Healthcheck failed”. The logfile at /var/log/onlyoffice/documentserver/converter/out.log logs the following error:

[2022-05-26T23:12:53.381] [ERROR] nodeJS - createTaskQueue error :
URIError: URI malformed
    at decodeURIComponent (<anonymous>)
    at new Url (/snapshot/server/build/server/Common/node_modules/url-parse/index.js:391:41)
    at Url (/snapshot/server/build/server/Common/node_modules/url-parse/index.js:245:12)
    at connect (/snapshot/server/build/server/Common/node_modules/amqplib/lib/connect.js:131:17)
    at Object.connect (/snapshot/server/build/server/Common/node_modules/amqplib/callback_api.js:14:3)
    at startConnect (/snapshot/server/build/server/Common/sources/rabbitMQCore.js)
    at /snapshot/server/build/server/Common/sources/rabbitMQCore.js
    at new Promise (<anonymous>)
    at Object.connetPromise (/snapshot/server/build/server/Common/sources/rabbitMQCore.js)
    at /snapshot/server/build/server/Common/sources/taskqueueRabbitMQ.js
    at Generator.next (<anonymous>)
    at onFulfilled (/snapshot/server/build/server/Common/node_modules/co/index.js:65:19)
    at /snapshot/server/build/server/Common/node_modules/co/index.js:54:5
    at new Promise (<anonymous>)
    at co (/snapshot/server/build/server/Common/node_modules/co/index.js:50:10)
    at initRabbit (/snapshot/server/build/server/Common/sources/taskqueueRabbitMQ.js)

The documentserver has JWT authentication configured and the Nextcloud integration app is configured to use it.

After downgrading onlyoffice-documentserver back to 7.0.1-37, it again works as expected.

Any ideas what could be the problem? Did anybody else face similar issues with Documentserver 7.1?

Since the nodeJS error seems to be related to RabbitMQ, I tried to switch RabbitMQ from the 3.8.9-3 package from Bullseye to 3.8.15-1 from cloudsmith, but that didn’t help at all.

Hi @doobry,

Yes, it seems like a RabbitMQ issue but we haven’t added any changes to message queues in this update. Could you please send me the following info?

  1. Screenshot of ONLYOFFICE connector app in Nextcloud.
  2. The config file /etc/onlyoffice/documentserver/local.json

Hey @Carl,

first sorry for the late reply. Unfortunately the problem persists with latest OnlyOffice 7.1.1-23 and 7.2.0-204. Only downgrading to 7.0.1-37 fixes the issues for us.

Our local-production-linux.json file (with sensitive content removed) is:

{
  "services": {
    "CoAuthoring": {
      "sql": {
        "type": "postgres",
        "dbHost": "localhost",
        "dbPort": "5432",
        "dbName": "onlyoffice",
        "dbUser": "onlyoffice",
        "dbPass": "*********",
      },
      "token": {
        "enable": {
          "request": {
            "inbox": true,
            "outbox": true
          },
          "browser": true
        },
        "inbox": {
          "header": "Authorization"
        },
        "outbox": {
          "header": "Authorization"
        }
      },
      "secret": {
        "inbox": {
          "string": "********"
        },
        "outbox": {
          "string": "********"
        },
        "session": {
          "string": "********"
        }
      }
    }
  },
  "rabbitmq": {
    "url": "amqp://onlyoffice:********@localhost/"
  }
}

local.json has exactly the same content, only the rabbitmq url is different: amqp://guest:guest@localhost.

When hitting “Save” in the Nextcloud connector app, this produces the following documentserver error log:

==> /var/log/onlyoffice/documentserver/docservice/out.log <==
[2022-09-25T19:08:38.569] [ERROR] [localhost] [docId] [userId] nodeJS - healthCheck error URIError: URI malformed
    at decodeURIComponent (<anonymous>)
    at new Url (/snapshot/server/build/server/Common/node_modules/url-parse/index.js:391:41)
    at Url (/snapshot/server/build/server/Common/node_modules/url-parse/index.js:245:12)
    at connect (/snapshot/server/build/server/Common/node_modules/amqplib/lib/connect.js:131:17)
    at Object.connect (/snapshot/server/build/server/Common/node_modules/amqplib/callback_api.js:14:3)
    at startConnect (/snapshot/server/build/server/Common/sources/rabbitMQCore.js)
    at /snapshot/server/build/server/Common/sources/rabbitMQCore.js
    at new Promise (<anonymous>)
    at Object.connetPromise (/snapshot/server/build/server/Common/sources/rabbitMQCore.js)
    at /snapshot/server/build/server/DocService/sources/DocsCoServer.js
    at Generator.next (<anonymous>)
    at onFulfilled (/snapshot/server/build/server/DocService/node_modules/co/index.js:65:19)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)

Hello @doobry
Sorry for the late reply.
Are Document server and Nextcloud installed on separate servers? Please let us know Nextcloud and connector app versions.
Also please point me to the guide which you used for DS installation\update.

Hello @Alexandre,

Nextcloud version is 24.0.4 and the connector app version is 7.5.4.

I used your Nextcloud and Onlyoffice integration docs for configuring the setup.

As written, with the onlyoffice-documentserver packages up to 7.0, everything works fine. Only when upgrading to 7.1 or 7.2, the setup breaks.

Could you please reproduce the issue one more time (Document server update to the latest version)? Please reproduce the issue (go to connector app page > click Save button > make a screenshot of pop-up error entry) and provide us with whole Document server logs folder and local.json and config.php (from Nextcloud side) files.
One more thing. When update process is finished, please go to Document server welcome page (https://domain_name) > enable integrated example and check if the issue persists there.

Dear @Alexandre,

sorry for the late reply. Unfortunately the problem still persists with latest Nextcloud (25.0.2), documentserver (7.2.2-56) and Onlyoffice-Nextcloud integration app (7.6.8).

Here’s the screenshot of the toast with the error in Nextcloud Onlyoffice settings:

Here’s the the corresponding documentserver logs:

[2022-12-29T20:55:06.024] [ERROR] [localhost] [docId] [userId] nodeJS - healthCheck error URIError: URI malformed
    at decodeURIComponent (<anonymous>)
    at new Url (/snapshot/server/build/server/Common/node_modules/url-parse/index.js:391:41)
    at Url (/snapshot/server/build/server/Common/node_modules/url-parse/index.js:245:12)
    at connect (/snapshot/server/build/server/Common/node_modules/amqplib/lib/connect.js:131:17)
    at Object.connect (/snapshot/server/build/server/Common/node_modules/amqplib/callback_api.js:14:3)
    at startConnect (/snapshot/server/build/server/Common/sources/rabbitMQCore.js)
    at /snapshot/server/build/server/Common/sources/rabbitMQCore.js
    at new Promise (<anonymous>)
    at Object.connetPromise (/snapshot/server/build/server/Common/sources/rabbitMQCore.js)
    at /snapshot/server/build/server/DocService/sources/DocsCoServer.js
    at Generator.next (<anonymous>)
    at onFulfilled (/snapshot/server/build/server/DocService/node_modules/co/index.js:65:19)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
[2022-12-29T20:55:20.321] [ERROR] [localhost] [docId] [userId] nodeJS - healthCheck error URIError: URI malformed
    at decodeURIComponent (<anonymous>)
    at new Url (/snapshot/server/build/server/Common/node_modules/url-parse/index.js:391:41)
    at Url (/snapshot/server/build/server/Common/node_modules/url-parse/index.js:245:12)
    at connect (/snapshot/server/build/server/Common/node_modules/amqplib/lib/connect.js:131:17)
    at Object.connect (/snapshot/server/build/server/Common/node_modules/amqplib/callback_api.js:14:3)
    at startConnect (/snapshot/server/build/server/Common/sources/rabbitMQCore.js)
    at /snapshot/server/build/server/Common/sources/rabbitMQCore.js
    at new Promise (<anonymous>)
    at Object.connetPromise (/snapshot/server/build/server/Common/sources/rabbitMQCore.js)
    at /snapshot/server/build/server/DocService/sources/DocsCoServer.js
    at Generator.next (<anonymous>)
    at onFulfilled (/snapshot/server/build/server/DocService/node_modules/co/index.js:65:19)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
[2022-12-29T20:55:26.644] [ERROR] [localhost] [docId] [userId] nodeJS - healthCheck error URIError: URI malformed
    at decodeURIComponent (<anonymous>)
    at new Url (/snapshot/server/build/server/Common/node_modules/url-parse/index.js:391:41)
    at Url (/snapshot/server/build/server/Common/node_modules/url-parse/index.js:245:12)
    at connect (/snapshot/server/build/server/Common/node_modules/amqplib/lib/connect.js:131:17)
    at Object.connect (/snapshot/server/build/server/Common/node_modules/amqplib/callback_api.js:14:3)
    at startConnect (/snapshot/server/build/server/Common/sources/rabbitMQCore.js)
    at /snapshot/server/build/server/Common/sources/rabbitMQCore.js
    at new Promise (<anonymous>)
    at Object.connetPromise (/snapshot/server/build/server/Common/sources/rabbitMQCore.js)
    at /snapshot/server/build/server/DocService/sources/DocsCoServer.js
    at Generator.next (<anonymous>)
    at onFulfilled (/snapshot/server/build/server/DocService/node_modules/co/index.js:65:19)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
[2022-12-29T20:58:27.578] [ERROR] [localhost] [docId] [userId] nodeJS - healthCheck error URIError: URI malformed
    at decodeURIComponent (<anonymous>)
    at new Url (/snapshot/server/build/server/Common/node_modules/url-parse/index.js:391:41)
    at Url (/snapshot/server/build/server/Common/node_modules/url-parse/index.js:245:12)
    at connect (/snapshot/server/build/server/Common/node_modules/amqplib/lib/connect.js:131:17)
    at Object.connect (/snapshot/server/build/server/Common/node_modules/amqplib/callback_api.js:14:3)
    at startConnect (/snapshot/server/build/server/Common/sources/rabbitMQCore.js)
    at /snapshot/server/build/server/Common/sources/rabbitMQCore.js
    at new Promise (<anonymous>)
    at Object.connetPromise (/snapshot/server/build/server/Common/sources/rabbitMQCore.js)
    at /snapshot/server/build/server/DocService/sources/DocsCoServer.js
    at Generator.next (<anonymous>)
    at onFulfilled (/snapshot/server/build/server/DocService/node_modules/co/index.js:65:19)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)

The (redacted) local.json is:

{
  "services": {
    "CoAuthoring": {
      "sql": {
        "type": "postgres",
        "dbHost": "localhost",
        "dbPort": "5432",
        "dbName": "onlyoffice",
        "dbUser": "onlyoffice",
        "dbPass": "*****"
      },
      "token": {
        "enable": {
          "request": {
            "inbox": true,
            "outbox": true
          },
          "browser": true
        },
        "inbox": {
          "header": "Authorization"
        },
        "outbox": {
          "header": "Authorization"
        }
      },
      "secret": {
        "inbox": {
          "string": "*****"
        },
        "outbox": {
          "string": "*****"
        },
        "session": {
          "string": "*****"
        }
      }
    }
  },
  "FileConverter": {
    "converter": {
      "maxDownloadBytes": 268435456
    }
  },
  "rabbitmq": {
    "url": "amqp://onlyoffice:*****@localhost/"
  }
}

One more thing. When update process is finished, please go to Document server welcome page (https://domain_name) > enable integrated example and check if the issue persists there.

Indeed, the problem also exists in the example app. The loading spinner to load the document spins endlessly, no error message is shown either in the browser or in the documentserver logs.

Maybe relevant: onlyoffice-documentserver is installed and configured using your Ansible role from https://github.com/ONLYOFFICE/ansible-role-documentserver

It seems related to the rabbitmq credentials. When I install the Debian package onlyoffice-documentserver manually, everything works. When keeping the default rabbitmq credentials, it works too. Only when using custom rabbitmq credentials (that worked before), it no longer works.

So, the issue is related to custom RabbitMQ credentials on Ansible installation, am I right?
Please let us know what exactly you changed in this guide GitHub - ONLYOFFICE/ansible-role-documentserver: Ansible Role Document Server
I believe we have to take a closer look at it.