Onlyoffice Secret Key Issue

Onlyoffice App works fine inside Nextcloud until I specify a secret inside local.json and then enter it inside the app. I get the following error
Error when trying to connect (Error occurred in the document service: Error while downloading the document file to be converted.)

If I enter the incorrect secret I get
Error when trying to connect (Error occurred in the document service: Invalid token)
ONLYOFFICE

Both server are https secured and using proper certs again everything works fine until I try to secure before exposing to the outside.

[details]

Nextcloud version : 16.0.3
Operating system and version : Centos 7
Apache or nginx version: Apache/2.4.6
PHP version (eg, 7.1): PHP 7.2.17

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Install document server on Ubuntu 18.04 or 19 (tried both) using these directions https://helpcenter.onlyoffice.com/server/linux/document/linux-installation.aspx

  2. Secure the server with ssl

  3. Enable secret in local.json and specify secret

4.Enter into onlyoffice app inside nextcloud.

The output of your Nextcloud log in Admin > Logging:

Error	onlyoffice	CommandRequest on check error: Error occurred in the document service: Invalid token	
2019-07-11T11:25:52-0500
Error	onlyoffice	GetConvertedUri on check error: Error occurred in the document service: Error while downloading the document file to be converted.	
2019-07-11T11:25:46-0500
Fatal	onlyoffice	Download empty without jwt	
2019-07-11T11:25:45-0500
Fatal	onlyoffice	Download empty without jwt	
2019-07-11T11:25:44-0500
Fatal	onlyoffice	Download empty without jwt	
2019-07-11T11:25:43-0500
Error	onlyoffice	GetConvertedUri on check error: Error occurred in the document service: Error while downloading the document file to be converted.	
2019-07-11T11:25:10-0500
Fatal	onlyoffice	Download empty without jwt	
2019-07-11T11:25:08-0500
Fatal	onlyoffice	Download empty without jwt	
2019-07-11T11:25:07-0500
Fatal	onlyoffice	Download empty without jwt

I’m running Document Server on Debian 9. When I updated OnlyOffice from 5.2 to 5.3, it seemed like several of the paths changed, so the local.json I was updating wasn’t the one Document Server was using any more. I don’t remember the old path, but on 5.3 the path that works for me is /etc/onlyoffice/documentserver/local.json.

Inside this file, I had to set the same secret in three places: inbox, outbox, and session. I also had to change three booleans from false to true. In the JSON they are roughly in vicinity of:

  • token > enable > request > inbox = true
  • token > enable > request > outbox = true
  • token > enable > browser = true

Until I changed these three booleans, the OnlyOffice app in NextCloud only worked when I didn’t set the secret. After I changed all three of these, the secret was required to connect to Document Server.

Thanks for the tips, It seems that is what I did and it still doesn’t work. Do you have anything in config.php on nextcloud?

My local.json is attached same location as you mentioned /etc/onlyoffice/documentserver/local.json

when I enter the secret as test I get the error and if I set the values to false in local.json and remove the secret from app it connects fine. So weird, the same thing on 2 separate installs of document server. Thanks for all the help I am really stuck st this point

I don’t have anything in my config.php for Nextcloud that’s related to OnlyOffice. My local.json looks basically the same as yours. My secret is longer, but I don’t think that would make any difference.

What happens if you leave the secret key blank in Nextcloud, after you set the secret in OnlyOffice? If it works in Nextcloud, you’ll know that OnlyOffice isn’t using the key you’ve set.

I assume you know that you have to restart the OnlyOffice Document Server, after you modify the local.json file. On my Debian 9 system, I have to run service supervisor restart.

Yes I did restart the services. If I enter the wrong secret it throws an error that’s about invalid token.
Thanks for all your suggestions

How does your ds.conf file look ?

Anyone have any good installation instructions?