Forum Discussion
Cannot Release Lock on SharePoint Online File
SharePoint thinks a user still has a lock on. I can't adminsitratively do anything with the file online. This has been going on for almost a day.
We've cleared cache, closed Excel on his computer, cleared out some local cashe directories, rebooted, etc.
Nothing is clearing up this lock.
All I want to do is delete the file at this point, and I can't even do that.
What are my options as a Global Admin?
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.
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.
- Brian SarloCopper Contributor
Hello!
I just went through this whole situation with a user who had created a file last night, edited it and shared it with two other employees who also edited the file last night.
This morning no one could edit the file due to multiple locks.
When trying to delete it said user had the file locked for offline editing.
When opening the file in local Word, the file showed it was being edited offline by said user on 4 different devices.
I found that there is a document cache in the Upload Center.
Once we logged the user in to every device they use and deleted the troublesome file from his Upload Center document cache, the file was able to be deleted.
I hope that helps someone.
Brian
- SFWA_KPCopper Contributor
Brian Sarlo THANK YOU! Teams/SharePoint locked two key files that I was working on and would not release the lock. Your solution of clearing cache in the upload center solved the problem.
- Alan UmanosMicrosoftTo add to Trevor's post, any time a file is opened from SharePoint, regardless of using Office Online or the Office client, a lock state will be set. If we're only looking at opening files using the Office client, and file check out is not required in the SharePoint doc library, then the lock state is determined by the end user's Office client. If the user has Office 365 Pro Plus Click to Run, and is on the Monthly update channel, then the user will always set a co-authoring lock unless checking out a file. If on say, the Office 365 Pro Plus MSI client, then any time a user opens an Excel file from SharePoint, the lock state will ALWAYS be an exclusive lock since Office 2016 / Office 365 Pro Plus MSI cannot co-author with Excel files in the client. Because a lock state will always be applied when opening files, if a file has an exclusive lock set and SharePoint is never told the end user is done editing said file, the file lock will remain until the lock either expires or SharePoint is told the user who set the lock is done with the file. Regardless of lock type (Co-authoring or Exclusive), If a lock is applied to a file, it cannot be renamed, moved, or deleted. However It can still be copied or downloaded locally. If the Office client crashes while saving the file, or the internet connection drops, the pending file information will show up in the MS upload center where it can be pushed back to SharePoint, thus releasing the lock.
- John LathburyBrass Contributor
I particularly love this error combination.
Excel says I'm the only one here, but I can't make changes since I'm not alone...
- Andrew SilcockSteel ContributorWe're getting the locked out issue again today, by restoring a previous version and then restoring the correct version, this resolves the problem.
Microsoft needs to fix this permanently though.- Deleted
it seems my PC is smarter than yours and won't be bluffed - that didn't work for me :(
- Susan McClementsIron ContributorThis is funny but also frustrating!
- Martin_HamersBrass ContributorSame issues here with several users. Upload Center seems to be out of control. There is clearly something wrong. I found this old post http://robertgreiner.com/2014/12/fixing-pending-upload-issues-with-microsoft-office-upload-center/. Anyone here having experience with virus scanner software interfering?
- Martinus HamersCopper ContributorFor Microsoft Teams MS aknowledged a global issue with the Teams vs SharePoint vs OneDrive vs security services integration. Development team is looking at it. Solution can only be expected at a new update what can take still months. (On Office365)
When someone opens an Office file in the Office Online feature --> the file is locked!
Very nasty when supporting automated processes...
Its very ugly:
Its very user unfriendly:
Maybe an idea to support = https://sharepoint.uservoice.com/forums/330318-sharepoint-administration/suggestions/15681144-solution-for-the-file-filename-is-locked-for-ex
- Karl ØgaardCopper Contributor
I have the same problem on a wordfile. SP Online, Library has major versions enabled but no check-out required. I'm getting "the file is locked for shared use by....myself".
I opened the document in word browser and wrote some stuff. It saved and I navigated back, when I try to change a property in a choice column, I get that error message.
I think it is a very misleading error message because I thought that co-authoring would also not work when I read "locked for shared use..". But co-authoring works, no problem.
Solution for me is to open document in client and close it. Then I can change properties without any problems.
Don't like this....
- Stewart HarrisCopper Contributor
Hello
We have the same issue but in our case, its Sharepoint 2013, On-premise.
User has opened a doc in a library, made changes to word doc, tried to save and close.
The document is not able to be checked back in by domainname\user.
We then notice that the file is in th Upload Centre as "Upload failed" .. and says check out for editing by the above user.
The impact is that other users have gon in and made changes after, so versioning is turned on which means the file has been overwritten. We resolve this by comparing the document with the current versions in SP.
We have tried all of the usual fixes, like clearing the cache etc.,
We have also noticed that even though Microsoft say that the file is locked after closing for 10 mins, in one instance it took more than 30 minutes, but most cases not at all.
Thanks
- Deleted
"...and Close it" That was the ticket for me. Gracefully close the document using File->Close in the client app. Previously, I was just X'ing out of the client and still could not delete the file from SP. Thanks!
- Stephen SnellCopper Contributor
Your description is exactly what I've been getting. The file cannot be checked out or checked in with or without versioning and require check out. Frustrating. I need to run a Power Automate flow on the file and it throws the error.
- Michael ButterfieldIron Contributor
The solution I found was to Restore the locked out file to a previous version. That essentially kicks the user (who the file thinks is editing) out and allows you to then rename/ delete/ move etc the file again.
This is a persistent issue with something fundamental to Office 365 and seriously needs looking in to by Office Microsoft !!
- Andrew SilcockSteel ContributorThanks for the fix, I will try this next time! Be nice for a permanent fix by Microsoft though........
- Charles BoisseauCopper Contributor
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?
- David DeKeizerCopper Contributor
This problem is a result of Office Client setting a 'lock'.. that isn't a SharePoint check-out lock, and a network glitch misses clearing the lock. SharePoint usually notices within 15 or 20 minutes.. but not always.
I found a way to release this lock on-premises using PowerShell. I would think there is a PnP version that does the same on SPO.
I neglected to document where I plagiarized this from, so I cannot credit the original author
====================#this script overrides a file lock that occasionally occurs when a file is opened in the client, but is closed unexpectantly.
# locks are supposed to expire after 10 minutes, but that doesn't always happen
# in this case, the file looks like it is checked in, but is locked for editing$url = "https://WEBSITE/URL/HERE"
$fileurl = "https://WEBSITE/URL/HERE/LockedFileName.xlsx"
$web = Get-SPWeb $url
if($web -ne $null)
{
$item = $web.GetListItem($fileurl)if($item -ne $null)
{
Write-Host "Found file " $item.Title
$item.File.CheckOutStatus$item.ReleaseLock
#$item.File.ReleaseLock($item.File.LockId)$userId = $item.File.LockedByUser.ID
$user = $web.AllUsers.GetById($userId)$impSite = New-Object Microsoft.SharePoint.SPSite($web.Url, $user.UserToken);
$impWeb = $impSite.OpenWeb();
$impItem = $impWeb.GetListItem($fileurl)$impItem.File.ReleaseLock($impItem.File.LockId)
$impWeb.Dispose()
$impSite.Dispose()
$item.File.CheckOutStatus
}
$web.Dispose()}
=============
- TerriHamiltonCopper Contributor
This is also what I usually have to do is open a previous version. I usually get lucky and it shows me having opened one earlier that day when it locked. But on the rare occasion it does not, and I am forced to open an older one and loose data. Michael Butterfield
- Jacob WintherCopper Contributor
I just discovered a strange variation of this issue:
When clicking a document, Word Online will open the document in a new browser tab.
If you close that tab before Word Online has completed loading, a document lock has already been set.
But not released. Even if you open the same document with the same user again.
Users are able to edit the document, because of the co-authoring feature.
But you cannot rename / delete or restore versions.
You will get the error "The file ... is locked for shared use by <the last user who edited the document>"
Until the lost lock has been kicked by some cloud-service job. Normally means next morning...
- Charles BoisseauCopper Contributor
The Word file in OneDrive/sharepoint doesn't open in a new browser. It is locked by the ghost of me. I can't unlock it. I'm stymied.
- GustavCCopper Contributor
SharePoint Online, had this issue with a word file with "abc" written in it. Because I had locked it I could not edit the file in word online, edit the properties in Sharepoint online or delete it. And I had no idea where to deactivate the "Lock".
I found the solution for my case in this thread somewhere- Open it in word local on PC and there i could edit the files.
Cause of the issue: I was testing some list features with a lot of basically empty word files in it. And I might have had word online open in that word document when I added another column to the list that was mandatory to be filled out..
But I'm not 100% sure on this because I'm old and some times I set of to do something just to end up looking into the fridge realizing I'm not hungry I struggle to remember what I was supposed to do..
- Salvatore BiscariSilver Contributor
Do you mean that the file is stuck on checked out state?
- Brent EllisSilver Contributor
No checked out, "locked by user"
Kinda like they opened it in Excel and still have it open so no one can else can open/save it.
- Brent EllisSilver ContributorUgh, it self resolves itself shortly after posting on here...