Nextcloud Office cannot open documents

Hi guys,

running into issues with Collabora online and until now I was not able to get the issue fixed, even with googling through other similar cases.

I am running nc24.0.6 and wanted to start to replace Onlyoffice with Collarbora/Nextcloud Office, as it seems that onlyoffice is deprecated from nc25 onwards.
I uninstalled the Onlyoffice-Apps (onlyoffice works fine btw) and
I installed these apps:

  • Built-in CODE Server v22.5.502
  • Nextcloud Office 6.2.0

I get the same error as many others as well: “Nextcloud Office could not load”

What I tried:

  • Deactivate and Deleting the Apps, reinstall them
  • added ‘allow_local_remote_servers’ => true, to the config
  • cleaning up DB (was an idea in some post)
  • trying out an older version of richdocuments (I think it was 4.2.x)
  • and some smaller things I do not remember completely

But in any case - same error…

Not sure, where the problem really lies :slight_smile: Any ideas?
Thanks in advance!

Now, for the support details:

Nextcloud version (eg, 20.0.5): 24.0.6 (stable)
Operating system and version (eg, Ubuntu 20.04): Debian 10
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.38
PHP version (eg, 7.4): os: 7.4.32, PLESK host: 8.0.24

The issue you are facing:

  • Collarbora is running into an error; general error message on opening documents.

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

Steps to replicate it:

  1. install Collarbora/Nextcloud Office & CODE Server
  2. Open an existing document or create a new one and open it

The output of your Nextcloud log in Admin > Logging:

the only log output in connection with collabora was this "info":


GuzzleHttp\Exception\ConnectException: cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://myhost.host/apps/richdocumentscode/proxy.php?req=/lool/convert-to/png
	0	/var/www/vhosts/myhost.host/httpdocs/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php - line 158: GuzzleHttp\Handler\CurlFactory::createRejection()
	1	/var/www/vhosts/myhost.host/httpdocs/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php - line 110: GuzzleHttp\Handler\CurlFactory::finishError()
	2	/var/www/vhosts/myhost.host/httpdocs/3rdparty/guzzlehttp/guzzle/src/Handler/CurlHandler.php - line 47: GuzzleHttp\Handler\CurlFactory::finish()
	3	/var/www/vhosts/myhost.host/httpdocs/lib/private/Http/Client/DnsPinMiddleware.php - line 113: GuzzleHttp\Handler\CurlHandler->__invoke()
	4	/var/www/vhosts/myhost.host/httpdocs/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php - line 64: OC\Http\Client\DnsPinMiddleware->OC\Http\Client\{closure}("*** sensiti ... *")
	5	/var/www/vhosts/myhost.host/httpdocs/3rdparty/guzzlehttp/guzzle/src/Middleware.php - line 31: GuzzleHttp\PrepareBodyMiddleware->__invoke()
	6	/var/www/vhosts/myhost.host/httpdocs/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php - line 71: GuzzleHttp\Middleware::GuzzleHttp\{closure}("*** sensiti ... *")
	7	/var/www/vhosts/myhost.host/httpdocs/3rdparty/guzzlehttp/guzzle/src/Middleware.php - line 63: GuzzleHttp\RedirectMiddleware->__invoke()
	8	/var/www/vhosts/myhost.host/httpdocs/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php - line 75: GuzzleHttp\Middleware::GuzzleHttp\{closure}("*** sensiti ... *")
	9	/var/www/vhosts/myhost.host/httpdocs/3rdparty/guzzlehttp/guzzle/src/Client.php - line 331: GuzzleHttp\HandlerStack->__invoke()
	10	/var/www/vhosts/myhost.host/httpdocs/3rdparty/guzzlehttp/guzzle/src/Client.php - line 168: GuzzleHttp\Client->transfer()
	11	/var/www/vhosts/myhost.host/httpdocs/3rdparty/guzzlehttp/guzzle/src/Client.php - line 187: GuzzleHttp\Client->requestAsync()
	12	/var/www/vhosts/myhost.host/httpdocs/lib/private/Http/Client/Client.php - line 289: GuzzleHttp\Client->request()
	13	/var/www/vhosts/myhost.host/httpdocs/apps/richdocuments/lib/Preview/Office.php - line 92: OC\Http\Client\Client->post()
	14	/var/www/vhosts/myhost.host/httpdocs/lib/private/Preview/ProviderV1Adapter.php - line 53: OCA\Richdocuments\Preview\Office->getThumbnail()
	15	/var/www/vhosts/myhost.host/httpdocs/lib/private/Preview/GeneratorHelper.php - line 65: OC\Preview\ProviderV1Adapter->getThumbnail()
	16	/var/www/vhosts/myhost.host/httpdocs/lib/private/Preview/Generator.php - line 335: OC\Preview\GeneratorHelper->getThumbnail()
	17	/var/www/vhosts/myhost.host/httpdocs/lib/private/Preview/Generator.php - line 159: OC\Preview\Generator->getMaxPreview()
	18	/var/www/vhosts/myhost.host/httpdocs/lib/private/Preview/Generator.php - line 111: OC\Preview\Generator->generatePreviews()
	19	/var/www/vhosts/myhost.host/httpdocs/lib/private/PreviewManager.php - line 212: OC\Preview\Generator->getPreview()
	20	/var/www/vhosts/myhost.host/httpdocs/core/Controller/PreviewController.php - line 169: OC\PreviewManager->getPreview()
	21	/var/www/vhosts/myhost.host/httpdocs/core/Controller/PreviewController.php - line 142: OC\Core\Controller\PreviewController->fetchPreview()
	22	/var/www/vhosts/myhost.host/httpdocs/lib/private/AppFramework/Http/Dispatcher.php - line 225: OC\Core\Controller\PreviewController->getPreviewByFileId()
	23	/var/www/vhosts/myhost.host/httpdocs/lib/private/AppFramework/Http/Dispatcher.php - line 133: OC\AppFramework\Http\Dispatcher->executeController()
	24	/var/www/vhosts/myhost.host/httpdocs/lib/private/AppFramework/App.php - line 172: OC\AppFramework\Http\Dispatcher->dispatch()
	25	/var/www/vhosts/myhost.host/httpdocs/lib/private/Route/Router.php - line 298: OC\AppFramework\App::main()
	26	/var/www/vhosts/myhost.host/httpdocs/lib/base.php - line 1030: OC\Route\Router->match()
	27	/var/www/vhosts/myhost.host/httpdocs/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 (
  'instanceid' => ‚anid‘,
  'passwordsalt' => ‚somesalt‘,
  'secret' => ‚asrecret‘,
  'trusted_domains' => 
  array (
    0 => 'myhost.host',
  ),
  'datadirectory' => '/var/www/vhosts/myhost.host/httpdocs/data',
  'overwrite.cli.url' => 'https://myhost.host',
  'dbtype' => 'mysql',
  'version' => '24.0.6.1',
  'dbname' => 'owncloud',
  'dbhost' => 'localhost',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'owncloud',
  'dbpassword' => 'dbpw‘,
  'logtimezone' => 'UTC',
  'installed' => true,
  'log_type' => 'file',
  'logfile' => '/var/www/vhosts/myhost.host/httpdocs/nextcloud.log',
  'loglevel' => 1,
  'maintenance' => false,
  'appstore.experimental.enabled' => true,
  'theme' => '',
  'filelocking.enabled' => true,
  'trashbin_retention_obligation' => 1,
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_from_address' => 'cloud',
  'mail_domain' => ‚myhost.host,
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => ‚server‘,
  'mail_smtpport' => '465',
  'mail_smtpname' => ‚smtpname‘,
  'mail_smtppassword' => ‚pass’word,
  'mail_sendmailmode' => 'smtp',
  'updater.release.channel' => 'stable',
  'app_install_overwrite' => 
  array (
    0 => 'social',
    1 => 'breezedark',
    2 => 'discoursesso',
    3 => 'spreed',
    4 => 'documentserver_community',
    5 => 'richdocuments',
  ),
  'encryption.key_storage_migrated' => false,
  'updater.secret' => ‚somecrecret',
  'allow_local_remote_servers' => true,
);

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

PASTE HERE

apache2 does not seem to throw any error logs while opening a document
nginx not installed on this server
PASTE HERE


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.

see above

here the errors from the dev console while opening a document:

1 Like

for me it sounds the components are not reaching each other in the proper way. Maybe this troubleshooting steps are helpful:
https://docs.nextcloud.com/server/latest/admin_manual/office/troubleshooting.html

from your config.php it looks the system is behind reverse proxy but you are missing overwritehost and overwriteprotocol settings. maybe worth double check reverse proxy

maybe this thread helps you as well:

Thanks for your suggestions @wwe .
How do you determine, there is a reverse proxy installed. Actually, I just double checked: I did not install nginx on the server (nginx -v), it is only apache.

The other two links seem to be relevant, if I hosted my own collabora outsinde of the nextcloud instance, like inside a docker container. But I use the one that comes within nextcloud, so I have no URL to curl and even if: that would be on localhost I guess :wink:

Or do I miss something here?

`‘overwrite.cli.url’ is usually used together with RP, this was my assumption.

It doesn’t matter how your Collabora/OnlyOffice/WOPI is installed, basic mechanics remain always the same - Collabora and NC must reach each other using public domain (I suppose with TLS/https) and the client must reach both of them using exactly the same domain names… I never used built-in CODE so I have no idea which is the right URL, but this definitely can’t be localhost - follow the thread and references for the reason, I would suppose CODE exists “inside” of NC e.g. https://myhost.host/hosting/discovery or https://myhost.host/code/hosting/discovery

that may be a relic from the time, when Nextcloud did not run on its own server and I indeed used nginx as reverse Proxy. But this is not the case for that installation. Thanks though, for pointing it out - i removed the line.

I am still not sure it is a connectivity issue, as NC tells me, that the instance is reachable in the settings:

the URL for the instance seems to be the following: https://myhost.host/apps/richdocumentscode/proxy.php?req=
how to find out: switch to “use your own server” and there the URL is shown for the integrated CODE server.

The URL (with my host of course) is reachable. It throws an error though:
image

I assume after req= the file path is missing, which will be added as soon as a file is clicked?

Oh, but what works is if I use a test instance of collabora (the last option in the settings). That does indeed work.

but does not and can’t tell you if CODE can reach Nextcloud! Please follow and understand the information’s I provided.

Had the same problem, found that the tmp path in the config file was not used by the office app. So i made the directories data and data/tmp in the nextcloud home directory (/var/www/nextcloud).
It solved the problem.

1 Like

Thanks for your suggestion. Could you tell me a bit more about your solution? Which config file (path & filename) did you look at?
And where exactly did you create the /data directory? Because in nc, there is a /data directory which is the main data dir for files of the users. So this dir should exist in most installs :wink:

Thanks, your solution has worked for me! Like Christoph_Geiser writes, the data-directory existed already, but I had to create the /tmp directory in it.