Collabora Online failing to connect WOPI - Nginx - Ubuntu 20.04

Nextcloud version (eg, 18.0.2): 19.03
Operating system and version (eg, Ubuntu 20.04): Ubuntu 20.04
Apache or nginx version (eg, Apache 2.4.25): nginx 1.18.0 Ubuntu
PHP version (eg, 7.1): 7.4.3

The issue you are facing:

Collabora app installed, I click the CODE option and it fails, I tried the OCC method but Nextcloud states that the Collabora fails to load.

So I tried setting up a server, I’ve been navigating the various tutorials (linux babe, nextcloud and another random one that also basically said it should be a one click process) using the Docker.

Unfortunately I get
Could not establish connection to the Collabora Online server.

I’ve adjusted the nextcloud.conf to account for needing the extra access (nginx!). I’ve made sure that the ports are open… for what it is worth the Collabora server is on the same server. Both sites have their own LetsEncrypt certs and I can access the site from the web, proudly displaying a ‘Welcome to Nginx’ …

I’m missing something blindingly obvious but I’ve been here for three days, I need help! :smile:

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

Steps to replicate it:

  1. See above.

The output of your Nextcloud log in Admin > Logging:

{"reqId":"xS6GbM7mwtxTGExav73F","level":3,"time":"2020-09-18T17:56:55+00:00","remoteAddr":"212.102.52.105","user":"Commander","app":"richdocuments","method":"GET","url":"/apps/richdocuments/index?fileId=1975&requesttoken=D8B9YjPSvUbeeDct9Fx1okjSyGR2LHeervk9JBrFgOQ%3D%3AfIs%2FDn%2BTigS3KlweoWpe6xmxm1EmAxjtyINbVVWGzIk%3D","message":{"Exception":"GuzzleHttp\\Exception\\ConnectException","Message":"cURL error 28: Connection timed out after 45000 milliseconds (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)","Code":0,"Trace":[{"file":"/usr/share/nginx/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php","line":155,"function":"createRejection","class":"GuzzleHttp\\Handler\\CurlFactory","type":"::"},{"file":"/usr/share/nginx/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php","line":105,"function":"finishError","class":"GuzzleHttp\\Handler\\CurlFactory","type":"::"},{"file":"/usr/share/nginx/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlHandler.php","line":43,"function":"finish","class":"GuzzleHttp\\Handler\\CurlFactory","type":"::"},{"file":"/usr/share/nginx/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/Proxy.php","line":28,"function":"__invoke","class":"GuzzleHttp\\Handler\\CurlHandler","type":"->"},{"file":"/usr/share/nginx/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/Proxy.php","line":51,"function":"GuzzleHttp\\Handler\\{closure}","class":"GuzzleHttp\\Handler\\Proxy","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/share/nginx/nextcloud/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php","line":37,"function":"GuzzleHttp\\Handler\\{closure}","class":"GuzzleHttp\\Handler\\Proxy","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/share/nginx/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":29,"function":"__invoke","class":"GuzzleHttp\\PrepareBodyMiddleware","type":"->"},{"file":"/usr/share/nginx/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php","line":70,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/share/nginx/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":59,"function":"__invoke","class":"GuzzleHttp\\RedirectMiddleware","type":"->"},{"file":"/usr/share/nginx/nextcloud/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php","line":71,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/share/nginx/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":361,"function":"__invoke","class":"GuzzleHttp\\HandlerStack","type":"->"},{"file":"/usr/share/nginx/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":163,"function":"transfer","class":"GuzzleHttp\\Client","type":"->"},{"file":"/usr/share/nginx/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":183,"function":"requestAsync","class":"GuzzleHttp\\Client","type":"->"},{"file":"/usr/share/nginx/nextcloud/lib/private/Http/Client/Client.php","line":228,"function":"request","class":"GuzzleHttp\\Client","type":"->"},{"file":"/usr/share/nginx/nextcloud/apps/richdocuments/lib/WOPI/DiscoveryManager.php","line":106,"function":"get","class":"OC\\Http\\Client\\Client","type":"->"},{"file":"/usr/share/nginx/nextcloud/apps/richdocuments/lib/WOPI/DiscoveryManager.php","line":78,"function":"fetchFromRemote","class":"OCA\\Richdocuments\\WOPI\\DiscoveryManager","type":"->"},{"file":"/usr/share/nginx/nextcloud/apps/richdocuments/lib/WOPI/Parser.php","line":41,"function":"get","class":"OCA\\Richdocuments\\WOPI\\DiscoveryManager","type":"->"},{"file":"/usr/share/nginx/nextcloud/apps/richdocuments/lib/TokenManager.php","line":210,"function":"getUrlSrc","class":"OCA\\Richdocuments\\WOPI\\Parser","type":"->"},{"file":"/usr/share/nginx/nextcloud/apps/richdocuments/lib/Controller/DocumentController.php","line":245,"function":"getToken","class":"OCA\\Richdocuments\\TokenManager","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/share/nginx/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":170,"function":"index","class":"OCA\\Richdocuments\\Controller\\DocumentController","type":"->"},{"file":"/usr/share/nginx/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":100,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/usr/share/nginx/nextcloud/lib/private/AppFramework/App.php","line":137,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/usr/share/nginx/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->"},{"file":"/usr/share/nginx/nextcloud/lib/private/Route/Router.php","line":297,"function":"call_user_func"},{"file":"/usr/share/nginx/nextcloud/lib/base.php","line":1012,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/usr/share/nginx/nextcloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::"}],"File":"/usr/share/nginx/nextcloud/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php","Line":200,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0","version":"19.0.3.1","id":"5f64f63255863"}

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

  GNU nano 4.8                                                                                           config.php                                                                                                      
<?php
$CONFIG = array (
  'instanceid' => 'ocg9y191ol44',
  'passwordsalt' => 'jjjjjj',
  'secret' => 'jjjjjjj/2k4VSjjjjjjjjGxqb73tGRtt3SR',
  'trusted_domains' => 
  array (
    0 => 'harbour.ydns.eu',
  ),
  'datadirectory' => '/usr/share/nginx/nextcloud-data',
  'dbtype' => 'mysql',
  'version' => '19.0.3.1',
  'overwrite.cli.url' => 'https://bbbb',
  'dbname' => 'nextclouddb',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'jjjjjj',
  'dbpassword' => 'jjjjjjjjj',
  'installed' => true,
  'config_is_read_only' => false,
  'memcache.distributed' => '\OC\Memcache\Redis',
  'memcache.local' => '\OC\Memcache\Redis',
  'memcache.locking' => '\OC\Memcache\Redis',
  'redis' => array(
        'host' => 'localhost',
        'port' => 6379,
        ),

);

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

-- Nextcloud
2020/09/18 17:44:26 [error] 53008#53008: *57140 upstream timed out (110: Connection timed out) while reading response header from upstream 

--nginx
no errors, except a favicon issue.

Hey
CODE Built in server doesnt work with Nginx.
Can you display your nginx conf of collabora online for docker version ?

Hi @bastien, is this information written somewhere in the docs? I am going through the same process right now.

Hi @ma-lalonde,
It is an old topic. I tried to install Collabora at the beginning of built in Code server and there were some issues with it. Look at this page : Connecting Collabora Online built-in CODE Server with Nginx - Collabora Office and Collabora Online . Look at the comments too, it may help you. I think that built in code server works now with Nginx. Try and give me your feedback !
Goo Luck :wink:

1 Like

Thanks for the info. I never got the built-in server to work, nor the docker project, as I mentioned here. After two full days, I am giving up and switching to OnlyOffice, which worked right off the bat. I’m a little sad to go back to .xlsx files, but the show must go on!