Bug 103679 - Session dropped on PutFile error
Summary: Session dropped on PutFile error
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice Online
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:5.3.0
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-03 13:45 UTC by Aleksander Machniak
Modified: 2017-04-21 12:34 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aleksander Machniak 2016-11-03 13:45:36 UTC
Two users open the editor. Now one of them click the "Save" button. WOPI PutFile request is send and it returns error 500. The result is that:

1. "No disk space" error message is displayed
2. The session is broken: document becomes readonly, users are "removed from the session", i.e. "No users" in the toolbar.

loolwsd-1.9.6-1.
Comment 1 Aleksander Machniak 2016-11-03 13:49:06 UTC
I forgot to say that the other user can work with the document, but the faulty user is removed from the users list.
Comment 2 Michael Meeks 2016-11-18 10:55:55 UTC
Any thoughts Tor ? also - Alek - what reasons is there for returning an internal server error ? and what do you suggest we do instead here ? if we can't save - stopping users from editing the document further (so they loose more data) seems reasonable - right ?
Comment 3 How can I remove my account? 2016-11-18 11:13:18 UTC
I think the problem here is that the message should say something about "or other server error", not just disk space?
Comment 4 Aleksander Machniak 2016-11-18 11:19:30 UTC
(In reply to Tor Lillqvist from comment #3)
> I think the problem here is that the message should say something about "or
> other server error", not just disk space?

Yes, but the error is only a part of the story. Also, if you check WOPI docs there's 413 error code specifically for "Entity too large", which is not exactly "No disk space", but close.

Anyway, in Kolab we have such scenario:
1. User A creates a document editing session on his file and invites User B
2. User B has no permission to that file (even read-only), just have no access to the file,
3. However, because he was invited he can join the session and edit the document with its owner,
4. But he has no permission to the file, he can't use the Save button. So, if he click Save and we send the PutFile request it will respond with 404 or 500, maybe 503.

In that scenario switching to read-only mode is not what we want. User B needs to still be able to edit the document but he needs to ask User A to save changes they both made.

I could consider disabling the Save button for User B on the host page, but this is not really a solution.

On the other hand if the error happens for User A, do we really want to broke the session? No. We should warn the user and give him possibility to download current document state or close the session.
Comment 5 Pranav Kant 2016-11-22 14:35:33 UTC
What happens if the document owner loses the connection for some reason ? Would no one be able to save the document, or all other sessions should also be terminated (Document owner didn't send a 'Close_Session', its just some connectivity issue).

What should ideally happen in such a case ?
Comment 6 Aleksander Machniak 2016-11-22 15:40:44 UTC
(In reply to Pranav Kant from comment #5)
> What happens if the document owner loses the connection for some reason ?

What happens if there's only one user and he loses connection?

> Would no one be able to save the document, or all other sessions should also
> be terminated (Document owner didn't send a 'Close_Session', its just some
> connectivity issue).
> 
> What should ideally happen in such a case ?

I think we should NOT close the session. We may wait for the owner (or other session member with write rights) to join again the session and save the document state. Anyway, users with no write rights can still use "Download as" feature to save the document current state locally, to not loose the data.
Comment 7 Commit Notification 2016-11-23 12:33:11 UTC
Pranav Kant committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/online/commit/?id=f8e0b8c11e94810fdde73f8b4d27b80a989670cb

tdf#103679: Handle storage diskfull & other PutFile errors
Comment 8 Commit Notification 2016-11-23 12:34:16 UTC
Pranav Kant committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/online/commit/?id=a149a0c2e164bd42677aec3a50c9a8a0421d1105

tdf#103679: Don't always change document permission on error
Comment 9 Xisco Faulí 2017-01-13 12:33:33 UTC
Hello,
Is this bug fixed?
If so, could you please close it as RESOLVED FIXED?