Forum Discussion
Cannot Release Lock on SharePoint Online File
- Jul 17, 2018
Locks is a complex topic and technically a client or network issue. SharePoint supports co-authoring locks unless you have Check In/Out enabled on the library. Client side locks will occur if Office cannot negotiate a co-author lock falling back to an exclusive lock. As others have pointed out, the upload center can contribute to locking and is one of the first things you should check. You can trace the calls via Fiddler on the client.
This is the technical explanation from PSS:
When a user attempts to open an Office file hosted on SharePoint in the Office client, there is an expected set of network calls we should be seeing unless there is a problem. Once a user clicks that Office file to open in client, code on the SharePoint page and (if using Internet Explorer) the Office 365 browser addon sends a command to initialize the client application (Word, Excel, PowerPoint). Once the Office client application starts launching, Office will start a HTTP conversation with SharePoint. If the Office call is already authenticated, the Office will be returned the file content. However, if not already authenticated, which is usually expected to be the case, Office will negotiate for Authentication with SharePoint. This process happens through two networking calls called OPTIONS calls. The first OPTIONS call is anonymous and expected to be rejected by SharePoint as to establish what types of authentication SharePoint will accept. The second options call will include the requested authentication information to SharePoint. If SharePoint accepts the second options, call, it will return a METHOD call, identifying what network verbs can be used to communicate with it (OPTIONS, GET, LOCK, PROPFIND, and POST are all examples of verbs for this process). Once the verbs are established the Office client will make a POST network call that requests the metadata for the file, adds the user’s session lock state (coauthor lock or exclusive lock) and to request to open the file from the CellStorage web service in SharePoint. If the Office client has never accessed the document before, the entire document will be downloaded from SharePoint and cached in the Office Document Cache. If the Office client has opened the file before, then it is already cached and only the changes will be downloaded. At this point, the Office file will open in the Office client. This entire process happens between a few milliseconds to a few seconds.
Doesn't work for me.
I'm on a Mac. Using Chrome. A file I opened and edited is still locked by me. No one else has worked on it. I closed the browser. I shut Word. There is no unlock option. Does someone have step-by-step instructions to close a file that a ghost of myself has locked?
Charles Boisseau Just experienced the same issue with a user. To remedy I cleared the cache in Microsoft Upload Centre, no luck. Then I cleared the cache in Microsoft Upload Centre 2013, no luck. Then I cleared the internet history and cache, no luck. Then I stopped the users One Drive Sync, Success!
The user had accidentally clicked on the "Sync" button at the top of the library which had created a folder in One Drive which had not yet synced with SharePoint. I removed the synced folder from one drive to prevent this recoccuring.
Not sure if any of the actions I took prior to stopping the One Drive sync had any effect, but the above resolved the issue.
- MattStOngeMay 15, 2020Copper Contributor
2020 baby yeah!
I have tried every singe suggestion in this thread.
I go to Sharepoint and go to the excel file. All good Now it's time to open in excel. Nah mate! Locked by another user.
Then I ask myself... Why and now? This is Sharepoint and I can work away just find when on the document in Sharepoint. It's not locked and I can open in excel with any other user without an issue.
I can't check it out- I get an error and it only allows me to see a portion of the error
This is just stupid. Why isn't this fixed yet?
Why do we have to mess around with a bunch of workarounds that don't even work?- Alan UmanosMay 15, 2020Brass Contributor
MattStOnge The error you're seeing is expected. Anytime you open an Office file from SharePoint (any version, SharePoint 2010, 2013, 2016, 2019, Online, etc) using Office (2010, 2013, 2016, 2019, 365 Pro Plus, Office for Mac, etc), you are guaranteed to set a file lock. That's how the product works.
There are two types of locks that can be set, and Exclusive file lock, and a Co-authoring file lock. Which lock type is set is dependent on a few key factors. When opening Office files, SharePoint will always attempt to set a co-authoring lock first. If a co-authoring lock cannot be set, SharePoint falls back to an exclusive file lock.
Exclusive file locks act exactly as their name implies. User opens the file, because of certain factors (addressed below), an exclusive file lock is set by the user's session in SharePoint. As long as that lock is in place only the user who set the lock can edit the file. If the user saves the file when they're done and properly exits the file (doesn't put the PC in sleep mode with the file open, doesn't just close the laptop lid and walk away, doesn't leave the file open for hours on end, and instead either uses file > Close, or waits for the file to completely save, then closes out of the client), then Office can send the proper network traffic to indicate it's done with the file and SharePoint will release the lock. This is known as exiting gracefully from the file, and applies to both file lock types.
Co-Authoring file locks are applied when the file is in a state that allows co-authoring and if the user is in a client that supports co-authoring. Whenever a file is opened in Office Web Apps, Office Online Server, or Office for the web, where the file can be edited in the browser, a Co-authoring file lock will always be set.
Certain Office clients (installed on your Windows or Mac machines) do not fully support Co-Authoring. For example, Co-Authoring in Excel is only supported on Office 365 Pro Plus version 1808 and newer. All other Office desktop clients do not allow for Excel co-authoring, and will always try to set an exclusive file lock.
Outside of the Office clients, there are other factors specific to the file and where the files stored that determine what file lock type is set. For example, all of the following to cause only Exclusive file locks to be set:
- The SharePoint library where the files are stored has "Checked required for editing" enabled. Even if opened in the browser, only exclusive file locks can be set for files within such a document library.
- IRM controls on the SharePoint library or the file.
- Setting the registry key "fsshttpoff" to a value of 1 (this is NEVER recommended)
- Turning off the OneDrive Sync client "Use Office applications to sync Office files that I open" setting (this should be left 'On' by default).
- Using the legacy Office file formats (*.doc, *.xls, *.ppt) instead of the current XML based file formats (*.xlsx, *.docx, *.pptx)
- Syncing files with the old and deprecated groove.exe OneDrive for Business sync client.
- And a few other, rarer factors.
MattStOnge, for you, it sounds like other users have set a co-authoring lock on the file, but your machine can only set exclusive file locks. Since the file is Excel, check that your Office client actually supports Excel Co-authoring. If you're not on the Office 365 Pro Plus client on https://docs.microsoft.com/en-us/officeupdates/update-history-microsoft365-apps-by-date then you're never expected to be able to edit the Excel file in the excel client app in near real time with your colleagues. I would compare what version of Office you're using with that of your colleagues. If it's the same version, then your machine has another factor at play preventing you from joining the Excel file's Co-authoring session.
This functionality is more than just SharePoint or Office, there is a lot more in play. What settings are set in the SharePoint Document library, on the file itself, in the Office client, on your windows/mac machine, what group policy settings are set (if your local user account and machine are domain managed), all of these matter and can affect what type of file lock your Office client can set, and by direct relation, what can be done with said file.- MPalomaresApr 18, 2023Copper Contributor
The Problem of this issue is that the lock persists on the web version on File creation and file editing... even in SharePoint online.
in the past it would even say "File locked for edition" but today again we experienced this issue and now it just says "Error: the server was unable to save the form at this time".
We tried a few other options and then we got it.... the infamous File locked for edition....
the file was locked for me to edit... but I'm not able to edit it's metadata... nor can I unlock the file.
And it is a hard, impossible to fix Lock.
Escenario: the user opens the file by accident (they wanted to edit the metadata, not the file), they quickly close the tab and boom, the file is locked in a limbo and no matter what you do, you cannot unlock the file until the session dies off.
and just like that you're doom to wait until the sessions decides to drop the lock.