nextcloud and onlyoffice intergartion

Issues during installation, usage and configuring
Post Reply
rajbps
Posts: 6
Joined: Tue Mar 05, 2019 12:14 am

nextcloud and onlyoffice intergartion

Post by rajbps » Sun Apr 21, 2019 9:51 pm

Hi Team,

I have nextcloud installed on centos 7 with nginx and lets encrypt setup fine. On a second box again cent os7 with nginx, i have installed only office. When I go to https://onlyoffice.domain.com, I get document server running. But when I try o setup only office in nextcloud, I keep getting, "Error when trying to connect (Error occured in the document service: Error while downloading file to be converted.)

This is the config in nextcloud config file:
nextcloud config
),
'twofactor_enforced_excluded_groups' =>
array (
),
'onlyoffice' =>
array (
'verify_peer_off' => TRUE,
'jwt_secret' => 'test',
'jwt_header' => 'test',
), 'maintenance' => false,
'theme' => '',
'loglevel' => 1,
);


This is the the local.json file from onlyoffice
local.json
{
"services": {
"CoAuthoring": {
"sql": {
"dbHost": "localhost",
"dbName": "onlyoffice",
"dbUser": "onlyoffice",
"dbPass": "onlyoffice"
},
"redis": {
"host": "localhost"
},
"token": {
"enable": {
"request": {
"inbox": true,
"outbox": true
},
"browser": true
},
"inbox": {
"header": "test"
},
"outbox": {
"header": "test"
}
},
"secret": {
"inbox": {
"string": "Mysecret"
},
"outbox": {
"string": "Mysecret"
},
"session": {
"string": "Mysecret"
}
}
}
},
"rabbitmq": {
"url": "amqp://guest:guest@localhost"
}
}

In nextcloud onlyoffice setup I have under Secret key (leave blank to disable)

Mysecret

In onlyoffice logs this is what I can see.
DS log
[2019-04-21T22:42:17.372] [ERROR] nodeJS - error downloadFile:url=https://office.domain.com/apps/onlyoffi ... 9271_docx)
Error: Error response: statusCode:404 ;body:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot GET /apps/onlyoffice/empty</pre>
</body>
</html>

at Request._callback (/var/www/onlyoffice/documentserver/server/Common/sources/utils.js:250: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.<anonymous> (/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.<anonymous> (/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-04-21T22:42:18.374] [DEBUG] nodeJS - ExitCode (code=0;signal=null;error:-81;id=conv_check_1231189271_docx)
[2019-04-21T22:42:18.375] [DEBUG] nodeJS - output (data={"cmd":{"c":"conv","id":"conv_check_1231189271_docx","format":"docx","url":"https://office.domain.com/apps/onlyoffi ... 89271_docx)
[2019-04-21T22:42:18.375] [DEBUG] nodeJS - postProcess (id=conv_check_1231189271_docx)
[2019-04-21T22:42:18.376] [DEBUG] nodeJS - deleteFolderRecursive (id=conv_check_1231189271_docx)

Can anyone advise please?

rajbps

Carl
Posts: 221
Joined: Thu Apr 12, 2018 10:00 am

Re: nextcloud and onlyoffice intergartion

Post by Carl » Mon Apr 22, 2019 6:53 am

Hello,

What is the address of your Nextcloud? Based on this error
[2019-04-21T22:42:17.372] [ERROR] nodeJS - error downloadFile:url=https://office.domain.com/apps/onlyoffi ... 9271_docx)
and
When I go to https://onlyoffice.domain.com, I get document server running.
I can assume that Document Server tries to download a file from itself rather than from the storage (Nextcloud), hence 404 error.

Also there is a discrepancy between JWT secrets in your Nextcloud config ('jwt_secret' => 'test') and in Document Server config ("string": "Mysecret")

rajbps
Posts: 6
Joined: Tue Mar 05, 2019 12:14 am

Re: nextcloud and onlyoffice intergartion

Post by rajbps » Mon Apr 22, 2019 9:49 am

@Carl,

After posting last night, i fixed those and still have the same issues.
local.json
{
"services": {
"CoAuthoring": {
"sql": {
"dbHost": "localhost",
"dbName": "onlyoffice",
"dbUser": "onlyoffice",
"dbPass": "onlyoffice"
},
"redis": {
"host": "localhost"
},
"token": {
"enable": {
"request": {
"inbox": true,
"outbox": true
},
"browser": true
},
"inbox": {
"header": "AuthorizationJwt"
},
"outbox": {
"header": "AuthorizationJwt"
}
},
"secret": {
"inbox": {
"string": "AuthorizationJwt"
},
"outbox": {
"string": "AuthorizationJwt"
},
"session": {
"string": "AuthorizationJwt"
}
}
}
},
"rabbitmq": {
"url": "amqp://guest:guest@localhost"
}
}

Also change the bit in nextcloud config file

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


Logs from convertor in document office
DS logs
[2019-04-22T10:45:35.116] [ERROR] nodeJS - error downloadFile:url=https://office.domain.com/apps/onlyoffi ... 4705_docx)
Error: Error response: statusCode:404 ;body:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot GET /apps/onlyoffice/empty</pre>
</body>
</html>

at Request._callback (/var/www/onlyoffice/documentserver/server/Common/sources/utils.js:250: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.<anonymous> (/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.<anonymous> (/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-04-22T10:45:36.118] [DEBUG] nodeJS - ExitCode (code=0;signal=null;error:-81;id=conv_check_1094614705_docx)
[2019-04-22T10:45:36.119] [DEBUG] nodeJS - output (data={"cmd":{"c":"conv","id":"conv_check_1094614705_docx","format":"docx","url":"https://office.domain.com/apps/onlyoffi ... 14705_docx)
[2019-04-22T10:45:36.120] [DEBUG] nodeJS - postProcess (id=conv_check_1094614705_docx)
[2019-04-22T10:45:36.120] [DEBUG] nodeJS - deleteFolderRecursive (id=conv_check_1094614705_docx)

Also just for this forum I change my domain to domain.

Both boxes are on the same domain ie domain.com. one is cloud.domain.com and the other is office.domain.com. Both of them are on different centos 7 boxes. In from of the boxes I am running pfsense with haproxy.

rajbps

Carl
Posts: 221
Joined: Thu Apr 12, 2018 10:00 am

Re: nextcloud and onlyoffice intergartion

Post by Carl » Tue Apr 23, 2019 8:00 am

cloud.domain.com is your Nextcloud and office.domain.com is your DS, right?

New log shows that Document Server still tries to download the file from itself rather than from the storage. Something seems to be wrong in your network configuration or in the addresses you indicate in Nextcloud settings. I need to see the screenshot with addresses. If you can't show the addresses here for security reasons, please send the screenshot to support@onlyoffice.com with a note 'For technical support' and a link to this forum thread.
Please check if DS and Nextcloud can reach each other with wget command:
run wget https://nextcloud_address on the machine with DS;
run wget https://DS_address on the machine with Nextcloud.

I would also recommend using spoiler tag when posting such log excerpts.

Carl
Posts: 221
Joined: Thu Apr 12, 2018 10:00 am

Re: nextcloud and onlyoffice intergartion

Post by Carl » Wed Apr 24, 2019 6:17 am

Hello Raj,

I received your screenshots. Addresses are indicated incorrectly. Please leave all fields except for Secret key empty in the Advanced server settings section. Only leave the address of your Document Server in Document Editing Service address field.

rajbps
Posts: 6
Joined: Tue Mar 05, 2019 12:14 am

Re: nextcloud and onlyoffice intergartion

Post by rajbps » Wed Apr 24, 2019 8:05 pm

Hi Carl,

I can confirm that is now working fine.

I have another question if I may. Does document server works with desktop editor directly. What I mean to say is when you open and try to connect from onlyoffice desktop editor, you get 3 options, onlyoffice, nextcloud and owncloud. I can now connect and get it to work from nextcloud but when I select onlyoffice, it does not connect. This one is out of this topic but just asking, if it should then I open a new post but if it does not then its ok. I cant find anywhere where it says it would or not.

rajbps

Carl
Posts: 221
Joined: Thu Apr 12, 2018 10:00 am

Re: nextcloud and onlyoffice intergartion

Post by Carl » Thu Apr 25, 2019 4:59 am

Hello Raj,

Option ONLYOFFICE in Desktop Editors means an ONLYOFFICE portal. You need to have ONLYOFFICE Enterprise Edition or ONLYOFFICE Community Edition installed for that. Document Server on its own doesn't serve as a file storage so you can't connect Desktop Editors to it.

Post Reply