Ubuntu 22.04 Install

Do you want to: error registering onlyoffice on nextcloud on Ubuntu 22.04
Document Server version: 7.0.1.37
Connector version: 7.3.2
DMS (platform) version: nextcloud 23.0.3
OS: Ubuntu 22.04
Browser version: FF 100.0

I did a clean install of my system using Ubuntu 22.04. I followed in install instructions here Installing ONLYOFFICE Docs for Debian, Ubuntu, and derivatives - ONLYOFFICE

I am using a remote postgresql RabbitMQ and Redis servers. I fallowed in instructions to direct to these remote services.

Everything seems to work fine up to the point that there is not service listening to port 8000 on the server. I get a clean health check. there document server welcome page loads fine. There is nothing listening on port 8000. when I try to save the connection in Nextcloud Onlyoffice connector I get the following message.

Error when trying to connect (Error occurred in the document service: Error while downloading the document file to be converted.) (version 7.0.1.37)

Attach logs if possible.

root@nuc7i7bnh:/var/log/onlyoffice/documentserver/docservice# tail -f out.log
[2022-05-04T02:21:50.403] [WARN] nodeJS - Express server listening on port 8000 in production-linux mode. Version: 7.0.1. Build: 37
[2022-05-04T03:05:42.756] [WARN] nodeJS - Express server startingā€¦
[2022-05-04T03:05:42.758] [WARN] nodeJS - Failed to subscribe to plugin folder updates. When changing the list of plugins, you must restart the server.
[2022-05-04T03:05:42.820] [WARN] nodeJS - Express server listening on port 8000 in production-linux mode. Version: 7.0.1. Build: 37
[2022-05-04T03:26:46.976] [WARN] nodeJS - Express server startingā€¦
[2022-05-04T03:26:46.977] [WARN] nodeJS - Failed to subscribe to plugin folder updates. When changing the list of plugins, you must restart the server.
[2022-05-04T03:26:47.036] [WARN] nodeJS - Express server listening on port 8000 in production-linux mode. Version: 7.0.1. Build: 37
[2022-05-05T02:05:35.920] [WARN] nodeJS - Express server startingā€¦
[2022-05-05T02:05:35.922] [WARN] nodeJS - Failed to subscribe to plugin folder updates. When changing the list of plugins, you must restart the server.
[2022-05-05T02:05:35.981] [WARN] nodeJS - Express server listening on port 8000 in production-linux mode. Version: 7.0.1. Build: 37

root@nuc7i7bnh**:/var/log/onlyoffice/documentserver/converter**# tail -f out.log
[2022-05-05T02:13:25.934] [ERROR] nodeJS - error downloadFile:url=
Error: ETIMEDOUT
at Timeout. (/snapshot/server/build/server/Common/node_modules/request/request.js:848:19)
at listOnTimeout (internal/timers.js:557:17)
at processTimers (internal/timers.js:500:7)
[2022-05-05T02:27:23.068] [ERROR] nodeJS - error downloadFile:url=
Error: ETIMEDOUT
at Timeout. (/snapshot/server/build/server/Common/node_modules/request/request.js:848:19)
at listOnTimeout (internal/timers.js:557:17)
at processTimers (internal/timers.js:500:7)

root@nuc7i7bnh:/var/log/onlyoffice/documentserver/metrics# tail -f out.log
gauges: { ā€˜statsd.timestamp_lagā€™: 0 },
timer_data: {},
counter_rates: {
ā€˜statsd.bad_lines_seenā€™: 0,
ā€˜statsd.packets_receivedā€™: 0,
ā€˜statsd.metrics_receivedā€™: 0
},
sets: {},
pctThreshold: [ 90 ]
}

root@nuc7i7bnh:/var/log/onlyoffice/documentserver# tail nginx.error.log
2022/05/04 01:22:57 [error] 128271#128271: *56 connect() failed (111: Unknown error) while connecting to upstream, client: 72.111.50.124, server: , request: ā€œGET /healthcheck HTTP/2.0ā€, upstream: ā€œ127.0.0.1:8000/healthcheckā€, host: ā€œā€
2022/05/04 01:25:57 [error] 128271#128271: *68 connect() failed (111: Unknown error) while connecting to upstream, client: 72.111.50.124, server: , request: ā€œGET /healthcheck HTTP/2.0ā€, upstream: ā€œ127.0.0.1:8000/healthcheckā€, host: ā€œā€

root@nuc7i7bnh:/var/log/onlyoffice/documentserver# ss -4tlun
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
udp UNCONN 0 0 0.0.0.0:8125 0.0.0.0:*
udp UNCONN 0 0 127.0.0.53%lo:53 0.0.0.0:*
tcp LISTEN 0 511 0.0.0.0:80 0.0.0.0:*
tcp LISTEN 0 4096 127.0.0.53%lo:53 0.0.0.0:*
tcp LISTEN 0 128 0.0.0.0:22 0.0.0.0:*
tcp LISTEN 0 511 0.0.0.0:443 0.0.0.0:*
tcp LISTEN 0 128 127.0.0.1:6011 0.0.0.0:*
tcp LISTEN 0 511 127.0.0.1:6379 0.0.0.0:*

Hello!

Could you please attach a screenshot of settings in the connector app?
It seems that there is no connection between Document Server and Nextcloud

I believe I might have the same issue as this, when trying to connect a new Nextcloud server running 23.0.4, I have all the correct settings and then when I click Save on the page with the ONLYOFFICE settings in Nextcloud I get:

Error when trying to connect (Error occurred in the document service: Error while downloading the document file to be converted.) (version 7.0.1.37)

@Dmitry when you have asked:

Do you mean the Nextcloud /settings/admin/onlyoffice page?

Just upgraded the connector to 7.3.4

I am able to get to the server from the nextcloud. they are hosted on the same device.

root@nuc7i8bnh:/var/log/nginx# echo $(curl https://onlyoffice.taomerle.com/healthcheck)
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 4 100 4 0 0 61 0 --:ā€“:-- --:ā€“:-- --:ā€“:-- 61
true

When I try to save I get the following.

Hello adakel9,
Please specify if your Document Server is also installed on Ubuntu 22.04.
Also provide /var/log/onlyoffice/documentserver/converter/out.log after reproducing the issue.

Hi @Carl, in my case both the Nextcloud and ONLYOFFICE servers are running on Debian Bullseye 11.3, however after looking again at the logs that @adakel9 posted above perhaps this isnā€™t the same issue, I do however have exactly the same error message in the Nextcloud interface.

When I reproduce the error this is the output to /var/log/onlyoffice/documentserver/converter/out.log:

[2022-05-09T09:15:44.778] [ERROR] nodeJS - error downloadFile:url=XXX-OMITTED-XXX ;attempt=3;code:null;connect:null;(id=conv_check_1238790865_docx)
Error: Error response: statusCode:403; headers:{"date":"Mon, 09 May 2022 09:15:27 GMT","server":"Apache/2.4.53 (Debian)","expires":"Thu, 19 Nov 1981 08:52:00 GMT","pragma":"no-cache","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":"none","set-cookie":["oc_sessionPassphrase=XXX-OMITTED-XXX; path=/; secure; HttpOnly; SameSite=Lax","XXX-OMITTED-XXX; 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"],"strict-transport-security":"max-age=63072000;","permissions-policy":"interest-cohort=()","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","upgrade":"h2,h2c","connection":"Upgrade, Keep-Alive","content-length":"27","keep-alive":"timeout=5, max=100","content-type":"application/json; charset=utf-8"};
    at Request.fResponse (/snapshot/server/build/server/Common/sources/utils.js)
    at Request.emit (events.js:400:28)
    at Request.onRequestResponse (/snapshot/server/build/server/Common/node_modules/request/request.js:1059:10)
    at ClientRequest.emit (events.js:400:28)
    at HTTPParser.parserOnIncomingClient (_http_client.js:647:27)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:126:17)
    at TLSSocket.socketOnData (_http_client.js:515:22)
    at TLSSocket.emit (events.js:400:28)
    at addChunk (internal/streams/readable.js:290:12)
    at readableAddChunk (internal/streams/readable.js:265:9)
    at TLSSocket.Readable.push (internal/streams/readable.js:204:10)
    at TLSWrap.onStreamRead (internal/stream_base_commons.js:188:23)

The corresponding Apache access log 403 entry on the Nextcloud server:

X.X.X>X - - [09/May/2022:09:15:27 +0000] "GET /apps/onlyoffice/empty?doc=XXX-OMITTED-XXX HTTP/1.1" 403 1810 "-" "Node.js/6.13"

And the corresponding entry in the Nextcloud log file, data/nextcloud.log:

{
  "reqId": "XXX-OMITTED-XXX",
  "level": 3,
  "time": "2022-05-09T09:15:27+00:00",
  "remoteAddr": "X.X.X.X",
  "user": "--",
  "app": "onlyoffice",
  "method": "GET",
  "url": "/apps/onlyoffice/empty?doc=XXX-OMITTED-XXX",
  "message": "Download empty with invalid jwt",
  "userAgent": "Node.js/6.13",
  "version": "23.0.4.1",
  "exception": {
    "Exception": "Firebase\\JWT\\BeforeValidException",
    "Message": "Cannot handle token prior to 2022-05-09T09:15:44+0000",
    "Code": 0,
    "Trace": [
      {
        "file": "/home/cloud/sites/nextcloud/apps/onlyoffice/controller/callbackcontroller.php",
        "line": 344,
        "function": "decode",
        "class": "Firebase\\JWT\\JWT",
        "type": "::"
      },
      {
        "file": "XXX-OMITTED-XXX/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 217,
        "function": "emptyfile",
        "class": "OCA\\Onlyoffice\\Controller\\CallbackController",
        "type": "->"
      },
      {
        "file": "XXX-OMITTED-XXX/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 126,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "XXX-OMITTED-XXX/nextcloud/lib/private/AppFramework/App.php",
        "line": 157,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/XXX-OMITTED-XXX/nextcloud/lib/private/Route/Router.php",
        "line": 302,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::"
      },
      {
        "file": "XXX-OMITTED-XXX/nextcloud/lib/base.php",
        "line": 1008,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->"
      },
      {
        "file": "XXX-OMITTED-XXX/nextcloud/index.php",
        "line": 36,
        "function": "handleRequest",
        "class": "OC",
        "type": "::"
      }
    ],
    "File": "XXX-OMITTED-XXX/nextcloud/apps/onlyoffice/3rdparty/jwt/JWT.php",
    "Line": 124,
    "CustomMessage": "Download empty with invalid jwt"
  }
}

I have double checked the JWT secret and it is correct and I have several other Nextcloud servers that are working with the same ONLYOFFICE server without an issue.

I donā€™t know if this is relevant but The ONLYOFFICE server doesnā€™t have NodeJS installed, the Nextcloud server does:

nodejs --version
v12.22.5

Hello Chris,
This error means there is time discrepancy between your Nextcloud server and the server where DS is installed.
Please check the time settings on both servers. Alternatively, you could set a leeway in the connector parameters to avoid the issue:

  1. Go to /var/www/nextcloud/apps/onlyoffice/3rdparty/jwt/JWT.php
  2. Set the leeway value to 60 seconds public static $leeway = 60;

Save the config and then try to save the connector settings.

1 Like

Both services are running on the same physical server. 22.04

Following is the log entry

root@nuc7i8bnh:/var/log/onlyoffice/documentserver/converter# tail -f out.log
[2022-05-11T00:00:04.909] [WARN] nodeJS - update cluster with 1 workers
[2022-05-11T00:00:04.914] [WARN] nodeJS - worker 134496 started.
[2022-05-11T00:00:04.917] [WARN] nodeJS - update cluster with 1 workers
[2022-05-11T00:09:22.392] [ERROR] nodeJS - error downloadFile:url=https://cloud.taomerle.com/apps/onlyoffice/empty?doc=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY3Rpb24iOiJlbXB0eSJ9.rhmBnI0bpzcQFAIm7cE0qFLPH_kM5Zs_LBNyH5Q4nvM;attempt=1;code:ETIMEDOUT;connect:true;(id=conv_check_1400040237_docx)
Error: ETIMEDOUT
at Timeout. (/snapshot/server/build/server/Common/node_modules/request/request.js:848:19)
at listOnTimeout (internal/timers.js:557:17)
at processTimers (internal/timers.js:500:7)

Just in case
root@nuc7i8bnh:/var/log/onlyoffice/documentserver/converter# node -v
v12.22.9

I am able to connect to the public test server, so I feel there is nothing wrong with my nextcloud installation.

My postgresql server and RabbitMQ server are hosted separately. I did use the following to configure them (passwords and usernames have been normalized)

echo onlyoffice-documentserver onlyoffice/db-host string 10.10.0.3| sudo debconf-set-selections
echo onlyoffice-documentserver onlyoffice/db-user string onlyoffice | sudo debconf-set-selections
echo onlyoffice-documentserver onlyoffice/db-pwd password onlyoffice | debconf-set-selections
echo onlyoffice-documentserver onlyoffice/db-name string onlyoffice | sudo debconf-set-selections
echo onlyoffice-documentserver onlyoffice/rabbitmq-host string 10.10.0.3 | sudo debconf-set-selections
echo onlyoffice-documentserver onlyoffice/rabbitmq-user string onlyoffice | sudo debconf-set-selections
echo onlyoffice-documentserver onlyoffice/rabbitmq-pwd password onlyoffice | sudo debconf-set-selections
echo onlyoffice-documentserver onlyoffice/jwt-enabled boolean true | sudo debconf-set-selections
echo onlyoffice-documentserver onlyoffice/jwt-secret password onlyoffice | sudo debconf-set-selections

Hello,
Youā€™ve mentioned NC and Document Server are installed on one machine in your case. Could you describe in more details how the setup was performed? Is it docker-compose? What server is used as a proxy?

I linked the how-to in my original post. I followed it to the letter.

All that is irrelevant as I found the issue and it had nothing to do with Nextcloud, the connector or Only office. My IPS changed something in their network/routing configutration tthat disabled the abillity to get back to the DNS entry of my system from inside the network. ā€¦

I would not get to www.myonlyofficeinstall.com form www.mynextcoudinstall.com , even though they are on the same physical server. From inside my network www.whjatever.com would not resolve back to my public IP. I added entries in my /etc/hosts file to resolve the DNS internally and it fixed my issue.

this will be a rear case for any install. And I did not see this as a solution at the start because I was able to do the install without this issue in the past.

OK, Iā€™m glad youā€™ve managed to find the reason of the issue.