Nextcloud Office Bug. Document fails to load on share

Nextcloud v 23.0.2
Collabora/Code docker container. Latest version

Everything works great when I’m logged in. I can open, edit, save documents. I can create new documents. I can access the collabora admin site just fine. However,

I tested a share and it broke. Nextcloud Office is marketed as a collaboration platform having the ability to share and collaborate office documents. Respectfully, this is a high priority issue as it defeats the purpose to have a collaborative platform which breaks when sharing/collaborating.

How to replicate the error:

  1. From browser within nextcloud, create a new office document or spreadsheet

  2. Share it via link

  3. Switch to user shared with and click on link to open in a different browser

  4. Dialog pops up with error connecting
    Screenshot 2022-03-07 215430

  5. Dialog goes away and on screen shows connecting, but doc doesn’t load.
    Screenshot 2022-03-07 215455

  6. Nextcloud log shows error. Argument #1 ($uid) must be of type string, null given

Exception: 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 in file '/var/www/nextcloud/lib/private/Group/Manager.php' line 333

    /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()

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()

I found an old issue.
Can you testable deactivate the app Deck?

I deactivated Deck and tested again. Same. No difference.

Ok another idea.

Please open browser developer mode (e.g. F12) and go to network analysis. Please post messages with HTTP code not 200.

There are many 304 and a few 101 messages, but unsure how to extract and post?

I made some tests short time ago and it definitely works for anonymous users - I see no reason why it should not work for other authenticated users.

In my tests I hit an issue when I tried to open exactly the same document within short time frame from different devices - I looks like the docs are blocked/accessed for some time after the previous device stops editing… but it is definitely possible that different users collaborate on same file at the same time (see referenced screenshot) maybe there is some logic issue when you access same file as same user from different devices…

Update, before I didn’t check “allow editing” so I go back and check “allow editing”. Then as shared user I open link in diff browser and this time it prompts me for a guest name. I enter a name and click “set” and then get same dialog with loading error, which again disappears and then the connecting message appears, but doc doesn’t load. Identical error shows in nextcloud log.

Then shared entire folder. Same no load and same error in log.

I did some more tests. It looks like sharing works in all combinations: public link (anonymous guest), another NC user. Open, edit works for owner and user with shared access (shared folder, group folder and direct share)

But in my installation I can’t create new documents - after I created and edited a doc (even if I manually “save” the doc before closing with :x:) - the docs can’t be open after it, and if I download the doc the file opens empty in local LibreOffice. the result is the same for ods and odt files. Everything works if I upload new file and edit them using Collabora…

Maybe somebody could review and confirm my testing. (NC23.0.2, collabora 21.11.2.4 both docker)

UPDATE: it takes little time - when you create new doc you must wait until it reaches “saved” state

image

  • should be not a problem with real docs but first automatic save occurs maybe 1-2 Minutes after you start editing, so testing with really short edits might result in corrupt files. If you press save and wait 10-20 seconds you should be safe and the file is valid and can be open but the author and user with share…

floppy disk icon shown “unsaved” state
checkmark shows “saved” state

Interesting. What version of nextcloud are you running? Also, what image of collabora/code are you running? X86 or arm64?

I’m on nextcloud 23.0.2 (latest) and collabora/code arm64 (latest)

I have the opposite. I can create new doc, spreadsheets, etc, no problem. They auto save perfectly. I can open previously created docs just fine. Issue is when sharing. I believe it’s a bug since I posted the actual error in the nextcloud log.

TypeError: Argument #1 ($uid) must be of type string, null given

image: nextcloud:23.0.2
image: collabora/code:21.11.2.4.1

running on x86. It worked with 21.11.1 as well.

You’re running the x86 collabora image and I’m running the arm64 image so our setup is using different images. Perhaps there is a bug in the arm64 image that is not in the x86 image?

Maybe - hopefully someone can verify with arm64

Every office doc I share cannot be loaded. Same error appears in the nextcloud log. The bug appears due to anonymous share recipient not having a valid UserId, I love the office integration, but am disappointed that upon my first share test it breaks and share recipients are unable to load and edit documents. This severely cripples the user experience and makes the entire office integration of much less value. I hope the bug receives high priority attention.

TypeError: Argument #1 ($uid) must be of type string, null given

[index] Error: 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 in file ‘/var/www/nextcloud/lib/private/Group/Manager.php’ line 333

GET /index.php/apps/richdocuments/wopi/files/?access_token=&access_token_ttl=0&permission=edit
from 192.xxx.xx.xx at 2022-03-08T10:31:48-08:00

I’m not experiencing this. Docs open fast and auto saves happen instantaneously. But, I can only share with users who have a guest account. Anonymous link shares will not load.

I"m happy with the performance. Everything is great, but of limited value if I’m unable to share/collaborate which is the whole point of having office integration.