OnlyOffice error problem

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:

example

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

longer
example
here

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): Nextcloud Hub II (23.0.6)
Operating system and version (eg, Ubuntu 20.04): Linux 5.4.0-113-generic x86_64
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.41 (Ubuntu)

PHP version (eg, 7.4): PHP 7.4.3

The issue you are facing:

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

Steps to replicate it:

  1. Open document on moblie which is not work, but it still work on the web portal.

The output of your Nextcloud log in Admin > Logging:

onlyoffice	GuzzleHttp\Exception\ServerException: Server error: `POST https://ndocs.netcraft.com.mo/index.php/apps/documentserver_community/ConvertService.ashx` resulted in a `500 Internal Server Error` response: <!DOCTYPE html> <html class="ng-csp" data-placeholder-focus="false" lang="en" data-locale="en" > <head data-requesttok (truncated...)
/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php - line 69:

GuzzleHttp\Exception\RequestException::create()

/var/www/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php - line 204:

GuzzleHttp\Middleware::GuzzleHttp\{closure}("*** sensiti ... *")

/var/www/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php - line 153:

GuzzleHttp\Promise\Promise::callHandler()

/var/www/nextcloud/3rdparty/guzzlehttp/promises/src/TaskQueue.php - line 48:

GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}("*** sensiti ... *")

/var/www/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php - line 248:

GuzzleHttp\Promise\TaskQueue->run()

/var/www/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php - line 224:

GuzzleHttp\Promise\Promise->invokeWaitFn()

/var/www/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php - line 269:

GuzzleHttp\Promise\Promise->waitIfPending()

/var/www/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php - line 226:

GuzzleHttp\Promise\Promise->invokeWaitList()

/var/www/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php - line 62:

GuzzleHttp\Promise\Promise->waitIfPending()

/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php - line 187:

GuzzleHttp\Promise\Promise->wait()

/var/www/nextcloud/lib/private/Http/Client/Client.php - line 294:

GuzzleHttp\Client->request()

/var/www/nextcloud/apps/onlyoffice/lib/documentservice.php - line 372:

OC\Http\Client\Client->post()

/var/www/nextcloud/apps/onlyoffice/lib/documentservice.php - line 177:

OCA\Onlyoffice\DocumentService->Request()

/var/www/nextcloud/apps/onlyoffice/lib/documentservice.php - line 91:

OCA\Onlyoffice\DocumentService->SendRequestToConvertService()

/var/www/nextcloud/apps/onlyoffice/lib/preview.php - line 269:

OCA\Onlyoffice\DocumentService->GetConvertedUri()

/var/www/nextcloud/lib/private/Preview/ProviderV1Adapter.php - line 53:

OCA\Onlyoffice\Preview->getThumbnail()

/var/www/nextcloud/lib/private/Preview/GeneratorHelper.php - line 62:

OC\Preview\ProviderV1Adapter->getThumbnail()

/var/www/nextcloud/lib/private/Preview/Generator.php - line 246:

OC\Preview\GeneratorHelper->getThumbnail()

/var/www/nextcloud/lib/private/Preview/Generator.php - line 141:

OC\Preview\Generator->getMaxPreview()

/var/www/nextcloud/lib/private/Preview/Generator.php - line 110:

OC\Preview\Generator->generatePreviews()

/var/www/nextcloud/lib/private/PreviewManager.php - line 212:

OC\Preview\Generator->getPreview()

/var/www/nextcloud/core/Controller/PreviewController.php - line 169:

OC\PreviewManager->getPreview()

/var/www/nextcloud/core/Controller/PreviewController.php - line 142:

OC\Core\Controller\PreviewController->fetchPreview()

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

OC\Core\Controller\PreviewController->getPreviewByFileId()

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

OC\AppFramework\Http\Dispatcher->executeController()

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

OC\AppFramework\Http\Dispatcher->dispatch()

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

OC\AppFramework\App::main()

/var/www/nextcloud/lib/base.php - line 1008:

OC\Route\Router->match()

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

OC::handleRequest()

OCP\Files\NotFoundException: /appdata_ocru8ytkzh2p/documentserver_community/doc_1769759011/Editor.bin
/var/www/nextcloud/lib/private/Files/Node/Folder.php - line 146:

OC\Files\Node\Root->get()

/var/www/nextcloud/lib/private/Files/SimpleFS/SimpleFolder.php - line 75:

OC\Files\Node\Folder->get()

/var/www/nextcloud/apps/documentserver_community/lib/Document/DocumentStore.php - line 105:

OC\Files\SimpleFS\SimpleFolder->getFile()

/var/www/nextcloud/apps/documentserver_community/lib/Controller/ConvertController.php - line 59:

OCA\DocumentServer\Document\DocumentStore->getDocumentForEditor()

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

OCA\DocumentServer\Controller\ConvertController->convert()

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

OC\AppFramework\Http\Dispatcher->executeController()

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

OC\AppFramework\Http\Dispatcher->dispatch()

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

OC\AppFramework\App::main()

/var/www/nextcloud/lib/base.php - line 1008:

OC\Route\Router->match()

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

OC::handleRequest()

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

<?php
$CONFIG = array (
  'passwordsalt' => '123456789',
  'secret' => '123456789',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => 'X.X.X.X',
    2 => 'test.com',
  ),
  'datadirectory' => '/ndata/ncdata',
  'dbtype' => 'pgsql',
  'version' => '23.0.6.1',
  'overwrite.cli.url' => 'http://localhost',
  'dbname' => 'nextcloud_db',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'cccccccc',
  'dbpassword' => 'ccccccccc',
  'installed' => true,
  'instanceid' => 'ccccccccc',
  'log_type' => 'file',
  'logfile' => '/var/log/nextcloud/nextcloud.log',
  'loglevel' => '2',
  'log.condition' =>
  array (
    'apps' =>
    array (
      0 => 'admin_audit',
    ),
  ),
  'mail_smtpmode' => 'smtp',
  'logtimezone' => 'Etc/UTC',
  'maintenance' => false,
  'theme' => '',
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'test',
  'mail_domain' => 'testing.com',
  'mail_smtphost' => 'X.X.X.X',
  'mail_smtpport' => '25',
  'allow_local_remote_servers' => true,
  'updater.secret' => '123456789',
);

I recently got the same issue on my desktop NC site on docx, xls and xlsx documents while this used to work a few weeks ago.
My NC site is automatically updated and I suppose one update broke this.
I get no logs in the apache error log file related to this.
For now, I don’t see what is wrong with the line of code mentioned in the log:

   function GetConvertedUri($document_uri, $from_extension, $to_extension, $document_revision_id, $region = null) {
        $responceFromConvertService = $this->SendRequestToConvertService($document_uri, $from_extension, $to_extension, $document_revision_id, false, $region);

Here is the full OnlyOffice error I get from the NC > Administration > Logging menu when I try opening a document with OnlyOffice:

Exception: Bad Response. Errors: Specification mandates value for attribute defer attributes construct error Couldn't find end of Start Tag script line 17 Opening and ending tag mismatch: link line 15 and script Specification mandates value for attribute defer attributes construct error Couldn't find end of Start Tag script line 18 Opening and ending tag mismatch: link line 14 and script Specification mandates value for attribute defer attributes construct error Couldn't find end of Start Tag script line 19 Opening and ending tag mismatch: link line 13 and script Specification mandates value for attribute defer attributes construct error Couldn't find end of Start Tag script line 20 Opening and ending tag mismatch: link line 12 and script Specification mandates value for attribute defer attributes construct error Couldn't find end of Start Tag script line 21 Opening and ending tag mismatch: link line 11 and script Specification mandates value for attribute defer attributes construct error Couldn't find end of Start Tag script line 22 Opening and ending tag mismatch: link line 10 and script Specification mandates value for attribute defer attributes construct error Couldn't find end of Start Tag script line 23 Opening and ending tag mismatch: meta line 9 and script Specification mandates value for attribute defer attributes construct error Couldn't find end of Start Tag script line 24 Opening and ending tag mismatch: meta line 8 and script Specification mandates value for attribute defer attributes construct error Couldn't find end of Start Tag script line 25 Opening and ending tag mismatch: meta line 5 and script Specification mandates value for attribute defer attributes construct error Couldn't find end of Start Tag script line 26 Opening and ending tag mismatch: meta line 4 and script Specification mandates value for attribute defer attributes construct error Couldn't find end of Start Tag script line 27 Opening and ending tag mismatch: head line 2 and script Specification mandates value for attribute defer attributes construct error Couldn't find end of Start Tag script line 28 Opening and ending tag mismatch: html line 0 and script Extra content at the end of the document
/var/www/nextcloud/apps/onlyoffice/lib/documentservice.php - line 91:

OCA\Onlyoffice\DocumentService->SendRequestToConvertService()

/var/www/nextcloud/apps/onlyoffice/lib/preview.php - line 269:

OCA\Onlyoffice\DocumentService->GetConvertedUri()

/var/www/nextcloud/lib/private/Preview/ProviderV1Adapter.php - line 53:

OCA\Onlyoffice\Preview->getThumbnail()

/var/www/nextcloud/lib/private/Preview/GeneratorHelper.php - line 65:

OC\Preview\ProviderV1Adapter->getThumbnail()

/var/www/nextcloud/lib/private/Preview/Generator.php - line 335:

OC\Preview\GeneratorHelper->getThumbnail()

/var/www/nextcloud/lib/private/Preview/Generator.php - line 159:

OC\Preview\Generator->getMaxPreview()

/var/www/nextcloud/lib/private/Preview/Generator.php - line 111:

OC\Preview\Generator->generatePreviews()

/var/www/nextcloud/lib/private/PreviewManager.php - line 212:

OC\Preview\Generator->getPreview()

/var/www/nextcloud/core/Controller/PreviewController.php - line 169:

OC\PreviewManager->getPreview()

/var/www/nextcloud/core/Controller/PreviewController.php - line 142:

OC\Core\Controller\PreviewController->fetchPreview()

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

OC\Core\Controller\PreviewController->getPreviewByFileId()

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

OC\AppFramework\Http\Dispatcher->executeController()

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

OC\AppFramework\Http\Dispatcher->dispatch()

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

OC\AppFramework\App::main()

/var/www/nextcloud/lib/base.php - line 1023:

OC\Route\Router->match()

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

OC::handleRequest()

Here are the versions I use:
PHP 7.4.30
Operating System: Linux 5.10.0-16-amd64 x86_64
Apache/2.4.54 (Debian)
onlyoffice 7.5.2
Nextcloud 24.0.3

I will post again here if I find a solution.

When I try to save the settings, I get a different log message. Here is what happens.

I follow: NC > Settings > ONLYOFFICE > ONLYOFFICE Docs address: I leave existing value:
https://MY_NC_SERVER/apps/documentserver_community/

I click “save” and I go the logs from the NC settings. Here is what I get:

[onlyoffice] Error: Exception: Bad healthcheck status at <<closure>>

0. /var/www/nextcloud/apps/onlyoffice/controller/settingscontroller.php line 175
   OCA\Onlyoffice\DocumentService->checkDocServiceUrl()
1. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 225
   OCA\Onlyoffice\Controller\SettingsController->SaveAddress()
2. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 133
   OC\AppFramework\Http\Dispatcher->executeController()
3. /var/www/nextcloud/lib/private/AppFramework/App.php line 172
   OC\AppFramework\Http\Dispatcher->dispatch()
4. /var/www/nextcloud/lib/private/Route/Router.php line 298
   OC\AppFramework\App::main()
5. /var/www/nextcloud/lib/base.php line 1023
   OC\Route\Router->match()
6. /var/www/nextcloud/index.php line 36
   OC::handleRequest()

PUT /apps/onlyoffice/ajax/settings/address

Here is the line of code:

list ($error, $version) = $documentService->checkDocServiceUrl($this->urlGenerator, $this->crypt);

The same happens with the option to disable the certificate verification enabled.

I can see that the save call reaches this:
/var/www/nextcloud/apps/onlyoffice/lib/documentservice.php:388:

public function checkDocServiceUrl($urlGenerator, $crypt) {

The issue occurs on line 408 of the same file:

$healthcheckResponse = $this->HealthcheckRequest();

This is because in the same file line 259 we have this:

$response = $this->Request($urlHealthcheck);

Which is expected to return “true” while it returns an HTML file which seems to be the login page.
It looks like the user authentication is not considered when checking the service.

Maybe there is an issue with how I configured authentication on my server?