Forum Discussion
"Error:The file is locked" when using Office Online within SharePoint Online
Guys, I do not know if any of you were able to figure out the resolution for this issue. But there seems to be a bug in Office Online Server. Office Online Server relies on the allow-sync-xhr-in-page-dismissal browser flag in EDGE and CHROME browsers to sync the check-in/check-our status of a document, Both browsers are built on Chromium OS. As of Oct 2020, chrome has updated their stance on disabling this flag for performance / security reason. More here : https://www.chromestatus.com/feature/4664843055398912.
So, the issue happens to be that OOS dependency on allow-sync-xhr-in-page-dismissal flag to sync back status updates back to SharePoint. Since, this flag is now disabled, users when they open documents in any chromium based browser, will see that the document is checked out every time they try to edit it. They will not be able to edit the metadata, since the document will never be checked in. And on top of that, You will see that when editing by the same user, it shows their names multiple times, indicating that someone else is co-authoring the document at the same time.
I have validated this behavior in Office Online Server On-Prem with SharePoint On-Prem.
MICROSOFT, you guys should fix this issue as this is hurting our production users and we seem to have no way to control it as some of the users are external and we do not manage their machines/browsers.
Here is a WORKAROUND : In Chrome or Edge, open applicable flags shown below
- Edge chromium: edge://flags
- Chrome: chrome://flags
Navigate to edge://flags/#allow-sync-xhr-in-page-dismissal flag, flip the flag from Disabled/Default to Enabled.
You will have to restart your browser for it take effect. Now, try editing the document in browser. Remember, you may still see that 1 or more of YOU are still co-authoring the document. To mitigate this, you will have to clear the Office Online Server cache.
Hope this helps some of you, who may be looking for a workaround.
Credits: https://dev.to/okms/office-online-the-file-is-locked-for-shared-use-error-15mh
- 1scaramAug 04, 2022Copper Contributor
NavinKanus - I cannot see that particular flag so unable to follow your advice, so out of exasperation I installed Firefox - with astonishing results - and good ones. I have thrown the kitchen sink at it and FIrefox has let me down once so far. Very satisfying. Thanks for the pointer to a browser issue.
- SjoerdVApr 28, 2022Iron ContributorGreat Stuff! Still seems weird that such a problem in a very common production scenario that already exists for 3 years, does not have some peeps at MS upping the prio on this.
Especially considering that the "Sync-XHR method while exiting a tab/page" has been deprecated a long time for a reason: security concerns.
Alternatives in the form of 'SendBeacon' and 'Fetch keep-alive' seem to exist btw. - ryangreenawayMay 27, 2021Copper Contributor
NavinKanus Thank you for this brilliant information.
This saves us hours of trying to figure out the root cause. Now, where's the permanent solution for SharePoint Server 2019 and OOS Microsoft!