You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
File is still locked after removing or updating share #8273
@wkloucek I noticed that the lock has been changed before an error. It could be a reason for the issue. {"time": "2024-01-29T12:51:55.110", "host": "80a14cbac9e3", "level": "DEBUG", "process": "wopiserver", "module": "wopiutils", "msg": "compareLocks", "lock1": "T8Enq4RumCgayb8jExBTpw==", "lock2": "/QIUhlilCFbTvLfgCzyn5Q==", "strict": "True", "result": "False"}
admin changed the bob's permission to 'editor' until bob keeps the file opened
bob closed the file but the file can not be unlocked by onlyOffice/wopi {"time": "2024-01-29T12:51:36.156", "host": "80a14cbac9e3", "level": "ERROR", "process": "wopiserver", "module": "cs3iface", "msg": "Failed to unlock", "filepath": "9bb608d6-cb9b-4d4d-adf8-14f39506c714/nwe.odt", "trace": "2f3a2d4f1c32f12571f8192215817b3e", "code": "8", "reason": "unlock: error: permission denied: a4015be1-c82c-4ade-b6e3-9187b9bad9ba$9bb608d6-cb9b-4d4d-adf8-14f39506c714!9bb608d6-cb9b-4d4d-adf8-14f39506c714/nwe.odt"}
admin can not open the file and we can see the new lock base64 digest that is not match with old one. "lock1": "T8Enq4RumCgayb8jExBTpw==", "lock2": "/QIUhlilCFbTvLfgCzyn5Q=="
'Sorry, editor could not be loaded. Please contact your administrator.' {"time": "2024-01-29T12:51:55.110", "host": "80a14cbac9e3", "level": "DEBUG", "process": "wopiserver", "module": "wopiutils", "msg": "compareLocks", "lock1": "T8Enq4RumCgayb8jExBTpw==", "lock2": "/QIUhlilCFbTvLfgCzyn5Q==", "strict": "True", "result": "False"} {"time": "2024-01-29T12:51:55.110", "host": "80a14cbac9e3", "level": "WARNING", "process": "wopiserver", "module": "wopiutils", "msg": "Returning conflict", "lockop": "Lock", "user": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJyZXZhIiwiZXhwIjoxNzA2NjE5MTE0LCJpYXQiOjE3MDY1MzI3MTQsImlzcyI6Imh0dHBzOi8vb2Npcy5vd25jbG91ZC50ZXN0IiwidXNlciI6eyJpZCI6eyJpZHAiOiJodHRwczovL29jaXMub3duY2xvdWQudGVzdCIsIm9wYXF1ZV9pZCI6IjliYjYwOGQ2LWNiOWItNGQ0ZC1hZGY4LTE0ZjM5NTA2YzcxNCIsInR5cGUiOjF9LCJ1c2VybmFtZSI6ImFkbWluIiwibWFpbCI6ImFkbWluQGV4YW1wbGUub3JnIiwiZGlzcGxheV9uYW1lIjoiQWRtaW4iLCJ1aWRfbnVtYmVyIjo5OSwiZ2lkX251bWJlciI6OTl9LCJzY29wZSI6eyJ1c2VyIjp7InJlc291cmNlIjp7ImRlY29kZXIiOiJqc29uIiwidmFsdWUiOiJleUp3WVhSb0lqb2lMeUo5In0sInJvbGUiOjF9fX0.AAk4GxDPc44FAX9OesB-ZQ6fqp_HYDGxwl3VnQ4KvCs", "filename": "9bb608d6-cb9b-4d4d-adf8-14f39506c714/nwe.odt", "token": "v1rtk66XCS4BNvg6AOKs", "sessionId": "None", "lock": "/QIUhlilCFbTvLfgCzyn5Q==", "oldlock": "None", "retrievedlock": "T8Enq4RumCgayb8jExBTpw==", "fileage": "173.1", "reason": "The file is locked by OnlyOffice"}
After some more testing and debugging we seem to understand that the root cause is that the wopiserver manages the locks in the scopes of users instead of applications. We also created a wopiserver issue to discuss the matters there.
The options moving forward seem to be:
Implement service accounts in the wopiserver to not scope locks to the user anymore. That would prevent the current issue of locks becoming stuck, but requires bigger changes in the wopiserver.
Allow revoking locks unconditionally of the user permissions on the files. That fixes the problem (after some smaller changes to the wopiserver like not statting the file before unlocking and not locking and comparing the lock before unlocking) but seems to violate the webdav spec and generally doesn't sound like a good idea.
Additionally we could change our business logic - at least until a proper solution is in place - to allow adding grants (which doesn't trigger that issue and is probably the more common case) but prevent removing grants while a lock is in place. That at least makes sure that there won't be stale locks, but makes it impossible to revoke permissions while a wopi session is open.
The same error happens if user A working with a document in Collabora and user B tries to open the same document in Onlyoffice.
So, we have a lot of edge cases with locking.
@micbar To avoid annoying behavior with the locks, can we prevent removing or changing grants while a lock is in place for the ocis v5 until we implement the better solution?
Activity
2403905 commentedon Jan 25, 2024
The same behavior occurs when the permission has been changed from
edittoview. #8060[-]File is still locked after removing share[/-][+]File is still locked after removing or updating share[/+]2403905 commentedon Jan 29, 2024
The logs are from a local setup.
@wkloucek I noticed that the lock has been changed before an error. It could be a reason for the issue.
{"time": "2024-01-29T12:51:55.110", "host": "80a14cbac9e3", "level": "DEBUG", "process": "wopiserver", "module": "wopiutils", "msg": "compareLocks", "lock1": "T8Enq4RumCgayb8jExBTpw==", "lock2": "/QIUhlilCFbTvLfgCzyn5Q==", "strict": "True", "result": "False"}2403905 commentedon Jan 29, 2024
Update:
{"time": "2024-01-29T12:51:36.156", "host": "80a14cbac9e3", "level": "ERROR", "process": "wopiserver", "module": "cs3iface", "msg": "Failed to unlock", "filepath": "9bb608d6-cb9b-4d4d-adf8-14f39506c714/nwe.odt", "trace": "2f3a2d4f1c32f12571f8192215817b3e", "code": "8", "reason": "unlock: error: permission denied: a4015be1-c82c-4ade-b6e3-9187b9bad9ba$9bb608d6-cb9b-4d4d-adf8-14f39506c714!9bb608d6-cb9b-4d4d-adf8-14f39506c714/nwe.odt"}"lock1": "T8Enq4RumCgayb8jExBTpw==", "lock2": "/QIUhlilCFbTvLfgCzyn5Q=="'Sorry, editor could not be loaded. Please contact your administrator.'
{"time": "2024-01-29T12:51:55.110", "host": "80a14cbac9e3", "level": "DEBUG", "process": "wopiserver", "module": "wopiutils", "msg": "compareLocks", "lock1": "T8Enq4RumCgayb8jExBTpw==", "lock2": "/QIUhlilCFbTvLfgCzyn5Q==", "strict": "True", "result": "False"} {"time": "2024-01-29T12:51:55.110", "host": "80a14cbac9e3", "level": "WARNING", "process": "wopiserver", "module": "wopiutils", "msg": "Returning conflict", "lockop": "Lock", "user": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJyZXZhIiwiZXhwIjoxNzA2NjE5MTE0LCJpYXQiOjE3MDY1MzI3MTQsImlzcyI6Imh0dHBzOi8vb2Npcy5vd25jbG91ZC50ZXN0IiwidXNlciI6eyJpZCI6eyJpZHAiOiJodHRwczovL29jaXMub3duY2xvdWQudGVzdCIsIm9wYXF1ZV9pZCI6IjliYjYwOGQ2LWNiOWItNGQ0ZC1hZGY4LTE0ZjM5NTA2YzcxNCIsInR5cGUiOjF9LCJ1c2VybmFtZSI6ImFkbWluIiwibWFpbCI6ImFkbWluQGV4YW1wbGUub3JnIiwiZGlzcGxheV9uYW1lIjoiQWRtaW4iLCJ1aWRfbnVtYmVyIjo5OSwiZ2lkX251bWJlciI6OTl9LCJzY29wZSI6eyJ1c2VyIjp7InJlc291cmNlIjp7ImRlY29kZXIiOiJqc29uIiwidmFsdWUiOiJleUp3WVhSb0lqb2lMeUo5In0sInJvbGUiOjF9fX0.AAk4GxDPc44FAX9OesB-ZQ6fqp_HYDGxwl3VnQ4KvCs", "filename": "9bb608d6-cb9b-4d4d-adf8-14f39506c714/nwe.odt", "token": "v1rtk66XCS4BNvg6AOKs", "sessionId": "None", "lock": "/QIUhlilCFbTvLfgCzyn5Q==", "oldlock": "None", "retrievedlock": "T8Enq4RumCgayb8jExBTpw==", "fileage": "173.1", "reason": "The file is locked by OnlyOffice"}aduffeck commentedon Jan 31, 2024
After some more testing and debugging we seem to understand that the root cause is that the wopiserver manages the locks in the scopes of users instead of applications. We also created a wopiserver issue to discuss the matters there.
The options moving forward seem to be:
Additionally we could change our business logic - at least until a proper solution is in place - to allow adding grants (which doesn't trigger that issue and is probably the more common case) but prevent removing grants while a lock is in place. That at least makes sure that there won't be stale locks, but makes it impossible to revoke permissions while a wopi session is open.
/cc @butonic
2403905 commentedon Feb 2, 2024
The same error happens if user A working with a document in Collabora and user B tries to open the same document in Onlyoffice.
So, we have a lot of edge cases with locking.
micbar commentedon Feb 8, 2024
@2403905 is that "in progress" or "to do" ?
2403905 commentedon Feb 8, 2024
@micbar I moved back to the
to dobecause as I understand you are working on a similar issue, aren't you?2403905 commentedon Feb 8, 2024
I mean the issue with the locks in a wopi
2403905 commentedon Feb 14, 2024
@micbar To avoid annoying behavior with the locks, can we prevent removing or changing grants while a lock is in place for the ocis v5 until we implement the better solution?
micbar commentedon Feb 14, 2024
Reading the wopi docs from Microsoft it says that locks should be done on an application level, not bound to a user.
micbar commentedon Feb 19, 2024
We should take the workaround here, disallow remove grants or update grants.