CollaboraOnline / online

Collabora Online is a collaborative online office suite based on LibreOffice technology. This is also the source for the Collabora Office apps for iOS and Android.
https://collaboraonline.com
Other
1.77k stars 680 forks source link

"Document cannot be saved, please check your permissions" #9328

Open techadmin-localbit opened 2 months ago

techadmin-localbit commented 2 months ago

Describe the Bug

If I share a document/folder like .odt or .ods with an external user by link. After you open the shared link and modify the document (with full write permissions), it shows you the following message: "Document cannot be saved, please check your permissions". Even than, it saves the document.

Steps to Reproduce

  1. as Nextcloud user go to your folder you want share by link with external users.
  2. Click on Share button
  3. share link, add a password, with full write permissions
  4. use generated link in a different browser
  5. open your .ods file in the folder
  6. Change content and click on save button
  7. message: "Document cannot be saved, please check your permissions"

Expected Behavior

No error message, or save confirmation message

Actual Behavior

message: "Document cannot be saved, please check your permissions"

Screenshots

Screenshot from 2024-06-22 11-50-20

Desktop

thebearon commented 2 months ago

I've tried these exact steps, but have been unable to reproduce the issue. Is it consistently reproducible for you with the steps?

techadmin-localbit commented 2 months ago

I missed one important information. I use "External storage", where the file is saved. Only in this combination do I have this problem, otherwise it is working. I made some changes on the properties of "External storage", but no success.

techadmin-localbit commented 2 months ago

When I check the logs on Nextcloud, I see the following error:

Uncaught error: Call to a member function getUID() on null in file '/var/www/nextcloud/lib/private/FilesMetadata/FilesMetadataManager.php' line 125"

If I comment the line 125 in the file FilesMetadataManager.php the error seems to be gone away:

//$this->jobList->add(UpdateSingleMetadata::class, [$node->getOwner()->getUID(), $node->getId()]);

I guess that it could be a problem when you are an external user that hasn't a specific UID, since the error only shows when you are an external user and not one in the LDAP.

jonasgarstick commented 2 months ago

We receive the same error messages for all guest users, even if they have the appropriate permissions.

mmeeks commented 2 months ago

@juliushaertl Thoughts appreciated =) looks like an easy fix - superficially - thanks so much @jonasgarstick for the analysis & ticket !

juliushaertl commented 1 month ago

We had a fix for this scenario for upcoming Nextcloud 30 with https://github.com/nextcloud/server/pull/44294. I'll see if we can get a patch without the public API change backported.

thebearon commented 2 weeks ago

@juliushaertl As I can see, the fix is part of 29.0.5, is that correct?

juliushaertl commented 2 weeks ago

Yes

tatrapikao commented 1 week ago

This also affects group folders - will the fix work for this too?

tatrapikao commented 2 days ago

We now (NC 29.0.6 / COOLWSD 24.04.7.1) get the error also in some Folders that are shared from the same instance. This pretty much renders Collabora useless as the message appears on every autosave and makes it nearly impossible to edit the document.

Also it seems that not all group folders are affected. Those that have only one member (group or user) and don't use advanced permissions work fine. Also those with two members with different permission sets and no advanced permissions work fine. Group Folders that either use advanced permissions and or have two users or groups with identical permissions still throw the error.

mmeeks commented 2 days ago

@juliushaertl can we move this ticket to richdocuments somehow ? =)