richdocuments
richdocuments copied to clipboard
Collabora not loading when trying to open document from not logged in user
Describe the bug Im trying to use VDR functionlity. I set up collabora online to display watermarks for some tagged files and user groups. When trying to share a folder with a public share link (so its the only option where i can hide download button) and the anonymous user try to open the files, collabora online starts loading but only loads the header and a grey content screen. No errors displayed.
To Reproduce Steps to reproduce the behavior:
- Go to the folder that contains the documents you want to share
- Click on share link
- Enable hide downloads button
- Open the link in a private window in some browser
- Try to open the file
Expected behavior Collabora opens the file with the watermarking
Screenshots
Client details:
- OS: [e.g. iOS] PopOS
- Browser [e.g. chrome, safari] Firefox 90
- Version [e.g. 22] 22
- Device: Multiple browsers and devices tested
Server details
Operating system: Debian 10
Web server: Apache
Database: MariaDB
PHP version: 7.4
Nextcloud version: 22
Version of the richdocuments app 6.4.1004
Version of Collabora Online 4.2.1
Logs
Nextcloud log (data/nextcloud.log)
Exception: Argument 1 passed to OC\Group\Manager::getUserIdGroupIds() must be of the type string, null given, called in /home/cloud.xxxx.com/public_html/lib/private/Group/Manager.php on line 316
Browser log
Uncaught TypeError: docLayer is undefined
_handleKeyEvent https://cloud.biobide.com/apps/richdocumentscode/proxy.php?req=/loleaflet/2afbc52/bundle.js:1
_onKeyDown https://cloud.biobide.com/apps/richdocumentscode/proxy.php?req=/loleaflet/2afbc52/bundle.js:1
handler https://cloud.biobide.com/apps/richdocumentscode/proxy.php?req=/loleaflet/2afbc52/bundle.js:1
proxy.php:1:1786242
Uncaught TypeError: docLayer is undefined
_handleKeyEvent https://cloud.biobide.com/apps/richdocumentscode/proxy.php?req=/loleaflet/2afbc52/bundle.js:1
_onKeyDown https://cloud.biobide.com/apps/richdocumentscode/proxy.php?req=/loleaflet/2afbc52/bundle.js:1
handler https://cloud.biobide.com/apps/richdocumentscode/proxy.php?req=/loleaflet/2afbc52/bundle.js:1
</details>
Looks similar to https://github.com/nextcloud/deck/issues/3247
Could you share the full error message from the nextcloud.log file as that would give a better hint on where exactly the error occurs.
From the forum trace it looks like it could be related to watermarking https://help.nextcloud.com/t/nextcloud-office-bug-document-fails-to-load-on-share/135192
Caused by TypeError: OC\Group\Manager::getUserIdGroupIds(): Argument #1 ($uid) must be of type string, null given, called in /var/www/nextcloud/lib/private/Group/Manager.php on line 316
/var/www/nextcloud/lib/private/Group/Manager.php - line 316:
OC\Group\Manager->getUserIdGroupIds()
/var/www/nextcloud/apps/richdocuments/lib/Controller/WopiController.php - line 334:
OC\Group\Manager->isInGroup()
/var/www/nextcloud/apps/richdocuments/lib/Controller/WopiController.php - line 223:
OCA\Richdocuments\Controller\WopiController->shouldWatermark()
/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 217:
OCA\Richdocuments\Controller\WopiController->checkFileInfo()
/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 126:
OC\AppFramework\Http\Dispatcher->executeController()
/var/www/nextcloud/lib/private/AppFramework/App.php - line 157:
OC\AppFramework\Http\Dispatcher->dispatch()
/var/www/nextcloud/lib/private/Route/Router.php - line 302:
OC\AppFramework\App::main()
/var/www/nextcloud/lib/base.php - line 1006:
OC\Route\Router->match()
/var/www/nextcloud/index.php - line 36:
OC::handleRequest()
The relevant code part has been moved and now has a proper null check already at
https://github.com/nextcloud-releases/richdocuments/blob/2056dfdb6971cad28d9c0eaf85cca7cfc36ee0b4/lib/PermissionManager.php#L175-L178