SOLVED

Cannot Release Lock on SharePoint Online File

Silver Contributor

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?

96 Replies
That worked for me! :)
This is very frustrating :( I've tried all the suggestions above, from Mac and Windows, no luck. There's this Word doc on SharePoint Online, locked by me, which I can't rename or move.

The problem with files getting locked still happening in April of 2019.  Found out the hard way after opening a file in Teams using "Open in Word", editing for 45 minutes only to notice it was "Read Only".  Found a file stuck in the upload center on Pending.  Removed it, fortunately I had saved the Read Only version to a local file and was able to copy and paste.

 

This seems to happen more often than not when editing files in SP Online.  As an admin I kinda get what's going on.  But this will drive users nuts.

I've just had the same problem @Brent Ellis but in a Modern Experience Library and none of the answers of this thread helped a bit. Anyway I've managed to "move" the item to my OneDrive using the new-ribbon option. That worked and allowed me to finally delete the document.

Probably not an solution for other use cases but it worked for me. I hope this helps to some other SharePointers. ;)

Thank you!  @Doug Powell  Had the same issue, but without the interface to Teams.  Was able to fix by checking out, checking in through the SharePoint document library.  Very Helpful!

Annotation 2019-05-01 084749.png

@AJWOODY  can you please add a screenshot of how you checked into the document library after checking out

 

Thanks

Is anyone having this same problem in Edge. Was having the same 'File is locked' issue in Chrome but not experienced it so far in edge?

@David DeKeizer that worked for SP2016 on-prem as well. Thank you so much!!

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 

@Doug Powell Thank you for your post 2 years ago! It just worked after many frustrating minutes of the same around and around with Sharepoint and moving a file because of a file lock. Very much appreciated you sharing your experiences--it helped me and hope it continues to help others. I hope MS fixes this with more helpful error dialogs, but in the meantime, thanks! :) 

Potential work-around - I had this issue specifically with a PowerPoint file - I simply opened the slide show again via PowerPoint (the same way I had it open before) then rather than just closing PowerPoint with the "X" - I used the File Menu and selected "Close" - this closes the slide show and leaves PowerPoint open.  as soon as I did this, the lock was released.

@carlSteffen 

 

Glad to hear that worked. That's not a workaround however, that's how the product works.

 

When you close out of a file stored in SharePoint , Exiting the file gracefully (File > Close, Red 'x', etc.) your machine sends information back to SharePoint telling SharePoint that you're done with the file and the lock can be released. Once SharePoint receives that Trigger, it releases the file's lock.

 

File locks will always happen when opening files from SharePoint, that is 100% how the product works. Where issues can be seen is releasing the lock states. If you're not co-authoring, (whether this is disabled for you somehow or if your Office client doesn't support it), then you'll set an exclusive file lock. This means only the user who opened the file from SharePoint (The user who sets the lock state) will be able to edit the file.

 

Unless the user exits the file gracefully, or the lock expires, no one else can edit the file. If the user does not exit from the file gracefully (Application crashed, unexpected Power Reset, etc), then the lock will be released via an expiration setting built into SharePoint. If the lock state doesn't expire, the user can re-open the file and exit gracefully to try and remove the lock.

 

If you're seeing the file lock does not release after a user exits gracefully from the file, you could be looking at an issue with SharePoint, your local machine, or your Office client. More often than not, these lock issues aren't actually bugs or errors and come down to understanding how these products work and how the Office files are being opened or used.

@Alan Umanos 

I get that, and agree with you that it should work regardless. 

 

What I'm experiencing is when closing via the "red x" in the top right corner PowerPoint doesn't seem to consistently release the locks.  It's as though it's firing some async process to release the lock and PowerPoint sometimes exits before the unlock is actually taken care of.  I obviously can't say for certain that this is what's happening, I'm only trying to illustrate/describe the behavior as I observe it. 

 

Call it what you want, I've not yet experienced the locked file issue (yet) when I close via the file menu.  Maybe it's a coincidence, maybe not. 

 

I wish there was a feature in SharePoint to forcefully remove the lock (maybe there is for admins but in this case it's the back end of MS Teams and I don't think we really have full admin rights) because sometimes the users with the locks have left for the day and I can't track them down to open/close a document.

 

Thanks for the full write up on locks etc in SharePoint - it is a great write-up of what I believed to be true (though didn't definitively know)

 

 

 

@carlSteffen

No worries! Glad I could be of help. There is likely a way to manually release the lock using CSOM for SharePoint online (it is 100% possible to release the lock manually in SharePoint on-Premise using PowerShell) though this would be a custom script that you'll need to write yourself.

Regarding MS teams, that actually shouldn't matter for File locks. The Office viewer in MS Teams is actually just a browser window that leverages Office for the Web. It's the same code used when opening Office files for editing in your browser (a WOPI frame). MS Teams administration will have no part in releasing file locks.
There is no way to release a lock via CSOM. The ask has been made to the PG, though.

@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.

Once I removed the document from the MS Office 2016 Upload Center Cache, I was able to add a new version to the document on Sharepoint(O365).
Thank you for this tp.

@Brent Ellis 

 

K so I had a similar situation where I wanted to rename a word doc and I kept getting an error that the file was locked by my own user account. I was not able to delete the document for the same reason.

I logged off and back on thinking that would clear... it never.

 

I finally opened the word doc on line then chose the open via desktop option. From there I did a "save as" and changed the name and re-saved it to the same SharePoint site.

At that point I was then I was allowed to delete the old file.

Not sure why this worked but it did.

Hope this helps someone else.

I'm glad you were able to save your document, but you killed the versioning by deleting the original file and upload a new one. Also realize that if you shared the doc, the original link will be broken.

@Doug Powell 

It totally works - thanks.

The file I was trying to edit was locked by me. Probably due to freeze at one point, which made me hard close the app.

I went to Start Menu and right click on Excel to open this file on desktop from history list.

Went, as you said, to "File->Info->Manage Workbook and check the file out from there. Worked perfectly!