richdocumentscode: Could not find urlsrc in WOPI

Hi,

have Update to 6.4.705 an have a error when try to open a document:

I am on a CentOS 7 installation, PHP 8 and Apache. No Docker Image.

[richdocuments] Error: Exception: Could not find urlsrc in WOPI at <<closure>>

0. ******/apps/richdocuments/lib/TokenManager.php line 217
   OCA\Richdocuments\WOPI\Parser->getUrlSrc("application/vnd ... t")
1. ******/apps/richdocuments/lib/Controller/DocumentController.php line 256
   OCA\Richdocuments\TokenManager->getToken("*** sensitive parameters replaced ***")
2. ******/lib/private/AppFramework/Http/Dispatcher.php line 218
   OCA\Richdocuments\Controller\DocumentController->index("*** sensitive parameter replaced ***", null)
3. ******/lib/private/AppFramework/Http/Dispatcher.php line 127
   OC\AppFramework\Http\Dispatcher->executeController(OCA\Richdocument ... {}, "index")
4. ******/lib/private/AppFramework/App.php line 157
   OC\AppFramework\Http\Dispatcher->dispatch(OCA\Richdocument ... {}, "index")
5. ******/lib/private/Route/Router.php line 302
   OC\AppFramework\App::main("OCA\\Richdocume ... r", "index", OC\AppFramework\ ... {}, {_route: "richdocuments.document.index"})
6. ******/lib/base.php line 993
   OC\Route\Router->match("/apps/richdocuments/index")
7. ******/index.php line 37
   OC::handleRequest()

GET /apps/richdocuments/index?fileId=19121&requesttoken=jRd3y0CoWLcTBxakWricr3nu%2FiSZLT0S23weF5TaFSY%3D%3Apjg2nBfyKJhqdlXDIt391S2evFb%2FGFRrlTRpb9uLbVU%3D

Manual Downgrade to 6.4.608 Fixed it.

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 2
  • Comments: 56 (2 by maintainers)

Most upvoted comments

Ok, I got it working!

Turns out, adding the line RequestHeader set X-Forwarded-Proto https had nothing to do with my problem, it was instead a problem with fontconfig not configured on my Ubuntu Server 20.04.

The url https://<my.domain.address>/extra-apps/richdocumentscode/proxy.php?status was responding with a no_fontconfig error, so I tried to install a bunch of packages to pull in some fontconfig dependencies (I don’t know exactly which are the correct ones):

sudo apt install fontconfig-config build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev

After installing the libraries the proxy responds with {"status":"OK"} and everything works as expected.

The no_fontconfig error is also mentioned in #162 and #145

Probably the error message in Nextcloud logs Could not find urlsrc in WOPI was misleading in this case, it should have returned the real proxy error no_fontconfig.

yes, I made that and I got it working on nextcloud-snap 😃

To answer my own question, with the snap it is enough to add @Verhoeckx’s solution at the .htaccess file, at /var/snap/nextcloud/current/nextcloud/config 😃

Indeed the problem seems to be related to some caching inside of the Nextcloud infrastructure. In my case the WOPI discovery went wrong for some reasons here with the following server response:

<html><body>
<h1>Socket proxy error</h1>
<p>Error: Timed out opening local socket: 99 - Cannot assign requested address</p>
</body></html>

I was only able to figure that out by adding appropriate logging to the mentioned line of code.

$this->logger->debug('discovery: {discovery}', ['discovery' => $discovery]);

It seems that this faulty response is cached for 1 hour in the Nextcloud cache. So I commented out this line to force the NC app to always fetch a fresh server response for the discovery. Now it seems to work.

Unfortunately I’m not able to tell where this error response was coming from or why it happend but in my case it was clearly a problem in combination with the Nextcloud infrastructure, which caches the error response. Hope this helps!

this is mine, and it works for me:

# Section for Apache 2.4 to 2.6
<IfModule mod_authz_core.c>
  Require all denied
</IfModule>
<IfModule mod_access_compat.c>
  Order Allow,Deny
  Deny from all
  Satisfy All
</IfModule>

# Section for Apache 2.2
<IfModule !mod_authz_core.c>
  <IfModule !mod_access_compat.c>
    <IfModule mod_authz_host.c>
      Order Allow,Deny
      Deny from all
    </IfModule>
    Satisfy All
  </IfModule>
</IfModule>

# Section for Apache 2.2 to 2.6
<IfModule mod_autoindex.c>
  IndexIgnore *
</IfModule>

RequestHeader set X-Forwarded-Proto https

What was the reason that you thought is also had something to due with SELinux?

I got tons of AVC denial messages in journalctl after installing setroubleshoot. Then I disabled selinux temporally, edited a document and did a ausearch | audit2allow

Would you mind sharing what exactly you have changed in your proxy config? I’m suspecting that I have the same problem, but it’s quite hard to reproduce (only some users see it).

Here my settings (Apache/2.4). The important thing was the line with ‘RequestHeader’

<VirtualHost *:443>
ServerName nextcloud.xxxxx.de:443

ProxyRequests Off
ProxyPreserveHost On

ProxyPass "/" "http://192.168.111.222/"
ProxyPassReverse "/" "http://192.168.111.222/"

RequestHeader set X-Forwarded-Proto https

Hi again, sorry for this mutch reporting, but the constalation “Collabora Online 4.0.3 an Built-in CODE Server 6.4.705” dont work today anymore. The only one konstalation thats work for longer time ist for me: “Collabora Online 4.0.4, Collabora Online - Built-in CODE Server 6.4.608”