Collabora Online CODE not working - Exception: Could not find urlsrc in WOPI

I installed Nextcloud on my VPS server, with php7.3 and all the dependencies. During the installation with setup_nextcloud.php Collabora failed to install. I solved installing it manually with
sudo -u www-data php -d memory_limit=512M occ app:install richdocumentscode
But now, when I try to create a new file (odt) or open an existing one (docx) it simply load for some seconds, then fail and show a notification: “Try again later”.

I looked for hints in the logs, and I found:

[richdocuments] Error: GuzzleHttp\Exception\ConnectException: cURL error 28: Operation timed out after 45000 milliseconds with 0 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) at <<closure>>

 0. /var/www/nextcloud.samuelezappala.it/public/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php line 155
    GuzzleHttp\Handler\CurlFactory::createRejection(GuzzleHttp\Handl ... l}, {errno: 28,error ... "})
 1. /var/www/nextcloud.samuelezappala.it/public/3rdparty/guzzlehttp/guzzle/src/Handler/CurlFactory.php line 105
    GuzzleHttp\Handler\CurlFactory::finishError(GuzzleHttp\Handler\CurlHandler {}, GuzzleHttp\Handl ... l}, GuzzleHttp\Handler\CurlFactory {})
 2. /var/www/nextcloud.samuelezappala.it/public/3rdparty/guzzlehttp/guzzle/src/Handler/CurlHandler.php line 43
    GuzzleHttp\Handler\CurlFactory::finish(GuzzleHttp\Handler\CurlHandler {}, GuzzleHttp\Handl ... l}, GuzzleHttp\Handler\CurlFactory {})
 3. /var/www/nextcloud.samuelezappala.it/public/3rdparty/guzzlehttp/guzzle/src/Handler/Proxy.php line 28
    GuzzleHttp\Handler\CurlHandler->__invoke("*** sensitive parameter replaced ***", "*** sensitive parameter replaced ***")
 4. /var/www/nextcloud.samuelezappala.it/public/3rdparty/guzzlehttp/guzzle/src/Handler/Proxy.php line 51
    GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}("*** sensitive parameters replaced ***")
 5. /var/www/nextcloud.samuelezappala.it/public/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php line 37
    GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler\{closure}("*** sensitive parameters replaced ***")
 6. /var/www/nextcloud.samuelezappala.it/public/3rdparty/guzzlehttp/guzzle/src/Middleware.php line 29
    GuzzleHttp\PrepareBodyMiddleware->__invoke("*** sensitive parameter replaced ***", "*** sensitive parameter replaced ***")
 7. /var/www/nextcloud.samuelezappala.it/public/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php line 70
    GuzzleHttp\Middleware::GuzzleHttp\{closure}("*** sensitive parameters replaced ***")
 8. /var/www/nextcloud.samuelezappala.it/public/3rdparty/guzzlehttp/guzzle/src/Middleware.php line 59
    GuzzleHttp\RedirectMiddleware->__invoke("*** sensitive parameter replaced ***", "*** sensitive parameter replaced ***")
 9. /var/www/nextcloud.samuelezappala.it/public/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php line 71
    GuzzleHttp\Middleware::GuzzleHttp\{closure}("*** sensitive parameters replaced ***")
10. /var/www/nextcloud.samuelezappala.it/public/3rdparty/guzzlehttp/guzzle/src/Client.php line 361
    GuzzleHttp\HandlerStack->__invoke("*** sensitive parameter replaced ***", "*** sensitive parameter replaced ***")
11. /var/www/nextcloud.samuelezappala.it/public/3rdparty/guzzlehttp/guzzle/src/Client.php line 163
    GuzzleHttp\Client->transfer("*** sensitive parameter replaced ***", "*** sensitive parameter replaced ***")
12. /var/www/nextcloud.samuelezappala.it/public/3rdparty/guzzlehttp/guzzle/src/Client.php line 183
    GuzzleHttp\Client->requestAsync("get", GuzzleHttp\Psr7\Uri {}, {verify: true,ti ... }})
13. /var/www/nextcloud.samuelezappala.it/public/lib/private/Http/Client/Client.php line 228
    GuzzleHttp\Client->request("get", "https://nextclo ... y", {verify: true,ti ... e})
14. /var/www/nextcloud.samuelezappala.it/public/apps/richdocuments/lib/WOPI/DiscoveryManager.php line 104
    OC\Http\Client\Client->get("https://nextclo ... y", {timeout: 45,nex ... e})
15. /var/www/nextcloud.samuelezappala.it/public/apps/richdocuments/lib/WOPI/DiscoveryManager.php line 78
    OCA\Richdocuments\WOPI\DiscoveryManager->fetchFromRemote()
16. /var/www/nextcloud.samuelezappala.it/public/apps/richdocuments/lib/WOPI/Parser.php line 41
    OCA\Richdocuments\WOPI\DiscoveryManager->get()
17. /var/www/nextcloud.samuelezappala.it/public/apps/richdocuments/lib/TokenManager.php line 210
    OCA\Richdocuments\WOPI\Parser->getUrlSrc("application/vnd.oasis.opendocument.text")
18. /var/www/nextcloud.samuelezappala.it/public/apps/richdocuments/lib/Controller/DocumentController.php line 245
    OCA\Richdocuments\TokenManager->getToken("*** sensitive parameters replaced ***")
19. /var/www/nextcloud.samuelezappala.it/public/lib/private/AppFramework/Http/Dispatcher.php line 170
    OCA\Richdocuments\Controller\DocumentController->index("*** sensitive parameter replaced ***", null)
20. /var/www/nextcloud.samuelezappala.it/public/lib/private/AppFramework/Http/Dispatcher.php line 100
    OC\AppFramework\Http\Dispatcher->executeController(OCA\Richdocument ... {}, "index")
21. /var/www/nextcloud.samuelezappala.it/public/lib/private/AppFramework/App.php line 137
    OC\AppFramework\Http\Dispatcher->dispatch(OCA\Richdocument ... {}, "index")
22. /var/www/nextcloud.samuelezappala.it/public/lib/private/AppFramework/Routing/RouteActionHandler.php line 47
    OC\AppFramework\App::main("OCA\\Richdocume ... r", "index", OC\AppFramework\ ... {}, {_route: "richdocuments.document.index"})
23. <<closure>>
    OC\AppFramework\Routing\RouteActionHandler->__invoke({_route: "richdocuments.document.index"})
24. /var/www/nextcloud.samuelezappala.it/public/lib/private/Route/Router.php line 297
    call_user_func(OC\AppFramework\ ... {}, {_route: "richdocuments.document.index"})
25. /var/www/nextcloud.samuelezappala.it/public/lib/base.php line 1007
    OC\Route\Router->match("/apps/richdocuments/index")
26. /var/www/nextcloud.samuelezappala.it/public/index.php line 37
    OC::handleRequest()

GET /index.php/apps/richdocuments/index?fileId=230&requesttoken=kbMtn0YZjhhbu8TohxmRxuSU%2FjDzLXL6d4YnKHrDd%2Fg%3D%3A3%2BBrtDZe%2BncB1rOE0ivB7dXsjHmBeUGPOMlsTh%2BgH5k%3D
from 87.13.237.127 by admin at 2020-06-23T14:05:38+00:00

I searched online and I found some php.ini suggestions for Wordpress, that I thought could be useful to Nextcloud too:
memory_limit = 256M
upload_max_size = 64M
post_max_size = 64M
upload_max_filesize = 64M
max_execution_time = 300
max_input_time = 1000

So I tried again and I got another error in the log:

[richdocuments] Error: Exception: Could not find urlsrc in WOPI

0. /var/www/nextcloud.samuelezappala.it/public/apps/richdocuments/lib/TokenManager.php line 210
   OCA\Richdocuments\WOPI\Parser->getUrlSrc("application/vnd.oasis.opendocument.text")
1. /var/www/nextcloud.samuelezappala.it/public/apps/richdocuments/lib/Controller/DocumentController.php line 245
   OCA\Richdocuments\TokenManager->getToken("*** sensitive parameters replaced ***")
2. /var/www/nextcloud.samuelezappala.it/public/lib/private/AppFramework/Http/Dispatcher.php line 170
   OCA\Richdocuments\Controller\DocumentController->index("*** sensitive parameter replaced ***", null)
3. /var/www/nextcloud.samuelezappala.it/public/lib/private/AppFramework/Http/Dispatcher.php line 100
   OC\AppFramework\Http\Dispatcher->executeController(OCA\Richdocument ... {}, "index")
4. /var/www/nextcloud.samuelezappala.it/public/lib/private/AppFramework/App.php line 137
   OC\AppFramework\Http\Dispatcher->dispatch(OCA\Richdocument ... {}, "index")
5. /var/www/nextcloud.samuelezappala.it/public/lib/private/AppFramework/Routing/RouteActionHandler.php line 47
   OC\AppFramework\App::main("OCA\\Richdocume ... r", "index", OC\AppFramework\ ... {}, {_route: "richdocuments.document.index"})
6. <<closure>>
   OC\AppFramework\Routing\RouteActionHandler->__invoke({_route: "richdocuments.document.index"})
7. /var/www/nextcloud.samuelezappala.it/public/lib/private/Route/Router.php line 297
   call_user_func(OC\AppFramework\ ... {}, {_route: "richdocuments.document.index"})
8. /var/www/nextcloud.samuelezappala.it/public/lib/base.php line 1007
   OC\Route\Router->match("/apps/richdocuments/index")
9. /var/www/nextcloud.samuelezappala.it/public/index.php line 37
   OC::handleRequest()

GET /index.php/apps/richdocuments/index?fileId=230&requesttoken=1HSaR9oAUMJW%2BVeS8YCtcT%2FHiySu%2B2uiK3eQaFz6igM%3D%3AmifcbKpHJK0MlCD%2BpLL9Wg6%2F%2BW3cr1jXZDjbDjmZ4mI%3D
from 87.13.237.127 by admin at 2020-06-23T14:11:40+00:00

I googled “Exception: Could not find urlsrc in WOPI” but it seems everyone has a different problem.

I post the Virtual Host where I set Nextcloud:

<IfModule mod_ssl.c>
<VirtualHost *:443>

        ServerAdmin samuele.zappala@mail.com
        DocumentRoot /var/www/nextcloud.samuelezappala.it/public
        ServerName nextcloud.samuelezappala.it
        ServerAlias www.nextcloud.samuelezappala.it

        <Directory /var/www/nextcloud.samuelezappala.it/public>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
                # Uncomment this directive is you want to see apache2's
                # default start page (in /apache2-default) when you go to /
                #RedirectMatch ^/$ /apache2-default/
        </Directory>
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLCertificateFile /etc/letsencrypt/live/samuelezappala.it/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/samuelezappala.it/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>

    <IfModule mod_headers.c>
      Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
    </IfModule>

</IfModule>

No idea if same issue, but just updated CODE from the app store today and now it doesn’t work. Was working flawlessly, so I think the current version released in the last day is borked.

Admin settings for CODE say all is good, but it isn’t. “Collabora Online server is reachable.” it says.

But trying to open any file gives the incredibly unhelpful “Failed to load Collabora Online Development Edition - please try again later”

That doesn’t work at all for me, I get “Could not open input file: occ”

So I just went to the OCCWeb thing, and tried: app:install richdocumentscode
Error: Could not download app richdocumentscode

So something’s not right at nextcloud.

What do you see in the log?

Where are the logs? Not sure where to look.

Just checked the “app store” thing, there was another Collabora release today, installed that and everything works fine again. Must have known that the previous version was broken. :slight_smile:

Updated, now it works.
Someone is talking about this issue here, but I use Apache and not Nginx, so I don’t know if it’s useful.