onlyoffice-owncloud icon indicating copy to clipboard operation
onlyoffice-owncloud copied to clipboard

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

Open xlangyun opened this issue 4 years ago • 10 comments

Do you want to request a feature or report a bug?

What is the current behavior? /var/log/onlyoffice/documentserver/converter/out.log [2019-08-12T21:48:03.765] [ERROR] nodeJS - error downloadFile:url=http://10.10.10.223/index.php/apps/onlyoffice/empty?doc=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY3Rpb24iOiJlbXB0eSJ9.FZwXATHSHK9nqy8GCbVmXkTA8QkkvZ7Mvn89diwM_Hk;attempt=3;code:null;connect:null;(id=conv_check_284448135_docx)^M Error: Error response: statusCode:403 ;body:^M {"message":"Access denied"} at Request._callback (/var/www/onlyoffice/documentserver/server/Common/sources/utils.js:256:18) at Request.self.callback (/var/www/onlyoffice/documentserver/server/Common/node_modules/request/request.js:185:22) at emitTwo (events.js:106:13) at Request.emit (events.js:191:7) at Request. (/var/www/onlyoffice/documentserver/server/Common/node_modules/request/request.js:1161:10) at emitOne (events.js:96:13) at Request.emit (events.js:188:7) at IncomingMessage. (/var/www/onlyoffice/documentserver/server/Common/node_modules/request/request.js:1083:12) at IncomingMessage.g (events.js:292:16) at emitNone (events.js:91:20) at IncomingMessage.emit (events.js:185:7) at endReadableNT (_stream_readable.js:978:12) at _combinedTickCallback (internal/process/next_tick.js:80:11) at process._tickCallback (internal/process/next_tick.js:104:9)

[2019-08-12T22:03:47.609] [WARN] nodeJS - worker 66528 died (code = 1; signal = null). restart... [2019-08-12T22:03:48.047] [WARN] nodeJS - worker 66536 died (code = 1; signal = null). restart... [2019-08-12T22:03:48.805] [WARN] nodeJS - worker 66542 died (code = 1; signal = null). restart... [2019-08-12T22:03:49.622] [WARN] nodeJS - worker 66549 died (code = 1; signal = null). restart... [2019-08-12T22:03:50.250] [WARN] nodeJS - worker 66555 died (code = 1; signal = null). restart... [2019-08-12T22:03:50.974] [WARN] nodeJS - worker 66561 died (code = 1; signal = null). restart... [2019-08-12T22:03:51.395] [WARN] nodeJS - worker 66567 died (code = 1; signal = null). restart... [2019-08-12T22:03:51.874] [WARN] nodeJS - worker 66573 died (code = 1; signal = null). restart... [2019-08-12T22:03:52.292] [WARN] nodeJS - worker 66579 died (code = 1; signal = null). restart... [2019-08-12T22:03:52.815] [WARN] nodeJS - worker 66585 died (code = 1; signal = null). restart... [2019-08-12T22:03:53.272] [WARN] nodeJS - worker 66591 died (code = 1; signal = null). restart... [2019-08-12T22:03:53.798] [WARN] nodeJS - worker 66597 died (code = 1; signal = null). restart... [2019-08-12T22:03:54.374] [WARN] nodeJS - worker 66603 died (code = 1; signal = null). restart... [2019-08-12T22:03:54.905] [WARN] nodeJS - worker 66610 died (code = 1; signal = null). restart... [2019-08-12T22:03:55.364] [WARN] nodeJS - worker 66616 died (code = 1; signal = null). restart... [2019-08-12T22:03:55.783] [WARN] nodeJS - worker 66622 died (code = 1; signal = null). restart... [2019-08-12T22:03:56.210] [WARN] nodeJS - worker 66628 died (code = 1; signal = null). restart... [2019-08-12T22:03:56.715] [WARN] nodeJS - worker 66634 died (code = 1; signal = null). restart... [2019-08-12T22:03:57.162] [WARN] nodeJS - worker 66640 died (code = 1; signal = null). restart... [2019-08-12T22:03:57.639] [WARN] nodeJS - worker 66646 died (code = 1; signal = null). restart... [2019-08-12T22:03:58.043] [WARN] nodeJS - worker 66654 died (code = 1; signal = null). restart... [2019-08-12T22:03:58.458] [WARN] nodeJS - worker 66660 died (code = 1; signal = null). restart... [2019-08-12T22:03:58.908] [WARN] nodeJS - worker 66666 died (code = 1; signal = null). restart... [2019-08-12T22:03:59.327] [WARN] nodeJS - worker 66672 died (code = 1; signal = null). restart..

Error: Module version mismatch. Expected 48, got 57. at Error (native) at Object.Module._extensions..node (module.js:604:18) at Module.load (module.js:494:32) at tryModuleLoad (module.js:453:12) at Function.Module._load (module.js:445:3) at Module.require (module.js:504:17) at require (internal/module.js:20:19) at Object. (/var/www/onlyoffice/documentserver/server/SpellChecker/sources/spellCheck.js:13:17) at Module._compile (module.js:577:32) at Object.Module._extensions..js (module.js:586:10) module.js:604 return process.dlopen(module, path._makeLong(filename));

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

What is the expected behavior?

Did this work in previous versions of DocumentServer?

DocumentServer version: My owncloud version is 10.0.0 I used this cmd to install DS yestoday(sudo yum install onlyoffice-documentserver). Operating System: Centos 7 Browser version:

xlangyun avatar Aug 12 '19 05:08 xlangyun

Hello, @xlangyun, attach screenshot the page of Onlyoffice Server settings.

HelenBelova17 avatar Sep 02 '19 10:09 HelenBelova17

Could you please specify if the problem recurs?

LinneyS avatar Dec 26 '19 10:12 LinneyS

I can't get pass this thing! Screenshot from 2020-03-04 21-34-13

ghost avatar Mar 05 '20 02:03 ghost

@cldtech, if your Document Server and ownCloud are publicly accessible via domain names, there is no need to use 'Advanced server settings' - please disable this section. Please check also JWT settings:

  1. Open /etc/onlyoffice/documentserver/local.json and find the following section:
 "inbox": {
          "header": "JWT_header"
        },
        "outbox": {
          "header": "JWT_header"
        }
      },
      "secret": {
        "inbox": {
          "string": "JWT_secret"
        },
        "outbox": {
          "string": "JWT_secret"
        },
        "session": {
          "string": "JWT_secret"
  1. Add the following section to config.php of ownCloud:
'onlyoffice' =>
  array (
    "jwt_secret" => "JWT_secret",
    "jwt_header" => "JWT_header"
	)

Where under JWT_secret and JWT_header are the corresponding values from local.json 3. Then click on the 'Save' button on the integration app settings page.

If this doesn't help, please check the accessibility of the Document Server and ownCloud to each other with wget command. On the server with Document Server wget https://owncloud_address and wget https://documentserver_address on the machine with ownCloud.

Specify also what SSL certificates are used on both servers.

alexanderonlyoffice avatar Mar 06 '20 14:03 alexanderonlyoffice

@cldtech, if your Document Server and ownCloud are publicly accessible via domain names, there is no need to use 'Advanced server settings' - please disable this section. Please check also JWT settings:

1. Open /etc/onlyoffice/documentserver/local.json and find the following section:
 "inbox": {
          "header": "JWT_header"
        },
        "outbox": {
          "header": "JWT_header"
        }
      },
      "secret": {
        "inbox": {
          "string": "JWT_secret"
        },
        "outbox": {
          "string": "JWT_secret"
        },
        "session": {
          "string": "JWT_secret"
1. Add the following section to config.php of ownCloud:
'onlyoffice' =>
  array (
    "jwt_secret" => "JWT_secret",
    "jwt_header" => "JWT_header"
	)

Where under JWT_secret and JWT_header are the corresponding values from local.json 3. Then click on the 'Save' button on the integration app settings page.

If this doesn't help, please check the accessibility of the Document Server and ownCloud to each other with wget command. On the server with Document Server wget https://owncloud_address and wget https://documentserver_address on the machine with ownCloud.

Specify also what SSL certificates are used on both servers.

Here is what i have, this is the layout i got with fresh installs and i only changed values as said here.

config.php

'onlyoffice' => 
  array (
    'verify_peer_off' => true,
    'jwt_secret' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
    'jwt_header' => 'AuthorizationJwt',
  ),

local.json

"services": {
	"CoAuthoring": {
		"sql": {
			"type": "mysql",
			"dbPort": 3307,
			"dbPass": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
			"charset": "utf8"
		},
		"secret": {
			"browser": {"string": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "file": "", "tenants": {}},
			"inbox": {"string": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "file": "", "tenants": {}},
			"outbox": {"string": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "file": ""},
			"session": {"string": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "file": ""}
		},
		"token": {
			"enable": {
				"browser": false,
				"request": {
					"inbox": false,
					"outbox": false
				}
			},
			"inbox": {
				"header": "AuthorizationJwt"
			},
			"outbox": {
				"header": "AuthorizationJwt"
			}
		}
	}
}

It's a self-signed certificate that's why 'verify_peer_off' => true, which resolve the first error i had. I thought it was obvious because i got here with a google search "onlyoffice-ds self-signed certificate" and didn't realize it wasn't even the title. Apologies :man_facepalming: Oh and the document server does shoe the "Document Server is running" every time i try.

ghost avatar Mar 06 '20 15:03 ghost

Hello, I just solved a fairly similar problem. The problem was caused by a bad time synchronization between the owncloud server and the onlyoffice document server. JWT tokens are only valid for 5 minutes. Check the NTP time synchro and the timezone of the servers. Good luck.

tititototutu avatar Sep 06 '20 16:09 tititototutu

Im experiencing the time-sync problem, too. Unfortunately I've got no control over the system time on the server serving my nextcloud instance (managed webhost). Since the nextcloud server lags behind the JWTs from onlyoffice are "not yet valid". This is a matter of ~1 to 2 seconds!

Is there a way to get around this?

rose-a avatar Jan 19 '21 20:01 rose-a

@rose-a Your best bet would be to modify apps/onlyoffice/3rdparty/jwt/JWT.php and change the value of $leeway to, say, 3. Note that if you have configured updating apps routinely via cron job, you'll have to repeat this each time the app gets updated.

CL-Jeremy avatar Jan 21 '21 19:01 CL-Jeremy

I can reproduce this problem and confirm that setting the leeway resolves it.

To get this issue closed out properly, would it be acceptable to expose the $leeway setting to the onlyoffice settings page under the "Advanced server settings" of the "Server settings" section?

This would cause the field to be hidden by default so it doesn't cause confusion. The default value could remain at zero for backward compatibility.

anon8675309 avatar Oct 24 '22 22:10 anon8675309

I can reproduce this problem and confirm that setting the leeway resolves it.

To get this issue closed out properly, would it be acceptable to expose the $leeway setting to the onlyoffice settings page under the "Advanced server settings" of the "Server settings" section?

This would cause the field to be hidden by default so it doesn't cause confusion. The default value could remain at zero for backward compatibility.

This sadly doesn't fix the issue on my side

NitrinCloud avatar Jan 21 '23 11:01 NitrinCloud