richdocuments
richdocuments copied to clipboard
Unable to open remote shared files
When trying to open a remotely shared file, the app hangs while the following error is logged:
"ownCloud version": "10.0.2.1",
"richdocuments version": "1.1.22",
"url": "/apps/richdocuments/wopi/token/544656_525fae5733169",
"user": "admin"
"Exception": "OCP\Files\NotFoundException"
"Message":"File with id "544656" has not been found."
"Trace":
#0 \/var\/www\/html\/owncloud\/apps\/richdocuments\/lib\/db\/wopi.php(62): OC\Files\View->getPath(544656)
#1 \/var\/www\/html\/owncloud\/apps\/richdocuments\/controller\/documentcontroller.php(498): A\Richdocuments\Db\Wopi->generateFileToken('544656', '0', 1, 'https:\/\/staging...')
#2 [internal function]: OCA\Richdocuments\Controller\DocumentController->wopiGetToken('544656')
(...)
#11 {main},File:\/var\/www\/html\/owncloud\/lib\/private\/Files\/View.php
We didn't notice this before upgrading to ownCloud 10, but we are currently only running Collabora on a test instance so maybe we just never tried to open a remote share with Collabora before.
A bit of digging around with the debugger gets us:
$this OCA\\Richdocuments\\Db\\Wopi
$fileId "569191"
$owner "[email protected]"
$path "/remote_shared/test.txt/"
$view OC\\Files\\View
fakeRoot "/[email protected]//files"
The issue seems to be in generateFileToken()around richdocuments/lib/db/wopi.php:60
$view = new \OC\Files\View('/' . $owner . '/files');
// Find the real path.
$path = $view->getPath($fileId);
which in case of a remote share leads to the above fakeRoot that resolves to the root storage, not the remote one. Which doesn't contain the file, hence leading to the "not found" exception.
Not sure if that's a bug / changed behaviour in ownCloud or the Collabora app, though.