Unable to connect Nextcloud with OnlyOffice

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:


Or for longer, use three backticks above and below the code snippet:


Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 27.0.1
Operating system and version (eg, Ubuntu 20.04): Debian 12
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.57
PHP version (eg, 7.4): 8.2

The issue you are facing: Unable to connect Nextcloud with OnlyOffice

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

Steps to replicate it:

  1. Install OnlyOffice plugin
  2. Introduce my OnlyOffice server ip and secret
  3. Click connect

The output of your Nextcloud log in Admin > Logging:

Error	onlyoffice	Exception: Se ha producido un error en el servicio de documentos: Error while downloading the document file to be converted.

    /var/www/html/nextcloud/apps/onlyoffice/lib/DocumentService.php - line 95:


    /var/www/html/nextcloud/apps/onlyoffice/lib/DocumentService.php - line 446:


    /var/www/html/nextcloud/apps/onlyoffice/lib/Controller/SettingsController.php - line 176:


    /var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 230:


    /var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 137:


    /var/www/html/nextcloud/lib/private/AppFramework/App.php - line 183:


    /var/www/html/nextcloud/lib/private/Route/Router.php - line 315:


    /var/www/html/nextcloud/lib/base.php - line 1071:


    /var/www/html/nextcloud/index.php - line 36:


Fatal	onlyoffice	Download empty without jwt

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

$CONFIG = array (
  'instanceid' => 'xxxxx',
  'passwordsalt' => 'xxxxxx',
  'secret' => 'xxxxx',
  'trusted_domains' => 
  array (
    0 => 'xxxxx',
  'datadirectory' => '/var/www/html/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => 'xxxxx',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost:3306',
  'dbport' => '',
  'lost_password_link' => 'xxxxx',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'xxxxx',
  'installed' => true,
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'updater.release.channel' => 'stable',
  'app_install_overwrite' => 
  array (
    0 => 'externalpassword',
  'onlyoffice' =>
    array (
      "jwt_secret" => "xxxxxx",
      "jwt_header" => "Authorization"

The output of your Apache/nginx/system log in /var/log/____:



Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

Exception: Se ha producido un error en el servicio de documentos: Error while downloading the document file to be converted.

Try changing the onlyoffice settings in the config.php file, mine is like:

 'onlyoffice' =>
  array (
    'jwt_header' => 'AuthorizationJwt',

To add from the CLI with occ:

sudo -u www-data php /var/www/html/nextcloud/occ config:system:set onlyoffice jwt_header --value=AuthorizationJwt

I am running OO 7.4, with nc 27.0.1 and that got my test instance working with onlyoffice. FYI

1 Like

Not working for me but thanks!

This fixed it for me.
I was running the OnlyOffice Snap so I had to set like this:
sudo snap set onlyoffice-ds onlyoffice.jwt-header=AuthorizationJwt
and verify like this:
sudo snap get onlyoffice-ds onlyoffice.jwt-header

And obviously update header string in Nextcloud.

1 Like

Ah ok. Glad you got it working!