The file “Document.docx” is locked for shared use by user in SharePoint Online

It is time for a classic SharePain today.

locked for shared use

You open a document in Office online and edit the document. Then you try to rename is and you get the following error message:

The file “Document.docx” is locked for shared use by username@tenant.onmicrosoft.com

I tried the same by renaming the file in the modern experience

 

When you try to open the document in word things just disappear in a black hole and Word is never opened.

After about 30 minutes my word suddenly opens the document as the lock seems to have expired now.

There seems to be an issue with document being locked when you open a document with Office Online

I haven’t got a real solution yet. If you do then please let me know. Otherwise watch this space as I’m still investigating.

 

Possible solution

Thanks to Olivier Collet for pointing out the following solutions on TechCommunity

  1. Make sure the “webclient service” on client side is running
  2. Find registry key: HKLM\SYSTEM\CurrentControlSet\Services\WebClient\Parameters on their machines.
  3. Find value: SupportLocking(if no, please add), set its value to 0, want to just disable lock feature.

 

 

 

 

Advertisements


Categories:Microsoft365, Office 365, Office Online

Tags:

20 replies

  1. Hi Pieter, would something like this work for you (I haven’t tested)? http://kennekro.net/2017/12/file-is-locked-for-shared-use-by-user/ . I guess you could write a flow to trigger the script when you get such a message.

    Like

    • Hi Noel,
      That solution would only work in on-premises environments. I don’t think that the unlock is available within CSOM. Also I’m not sure if this is something that I could get end users to do every time they edit a document in Office Online.

      Like

  2. Saw this today on two different tenants.
    Once as a flow had finished doing its thing the other when I created a brand ne document online using the new button.

    Definitely a bug has surfaced here

    Like

  3. It somestimes happened to me, re opening the doc in teams or word, then close docs & teams again, that fixed the issue

    Like

  4. When this happens I enforce checkout on the library so I can check out, edit and check in. Removing enforce check out on the library then leaves it all working as normal. This solution is ok in a training environment as its great for demonstrating the differences between libraries with and without enforced checkout but don’t think its a real world work around.

    Like

    • In your case does the document remain checked out? In my case the document is not checked out. It is just locked after it was edited in office online.

      Like

      • Pieter, the document is not and never has been checked out, just locked as you described. When this happens I then enforce Check Out on the library and the document is not shown as checked out. I can check it out and edit. The action of enforcing check out on the library seems to force SharePoint Online to realise the document is not actually locked in any way.

        I normally see this on training courses when creating a new document in SharePoint Online and after closing the document try to edit the properties. So the document is brand new. It seems to take between 30 mins and 24hrs to release the lock for me, unless I change the library settings as described. However I’ve only found this check out solution on a course last week and it worked again this week – twice isn’t really proof of a solid solution.

        Like

  5. Same here – started on Friday. Logged a support request with MS but even though I’ve given then step by step screenshots of how the error is caused, they insist on remotely accessing my computer before they’ll try to fix it. Which given I’m on a Mac is causing them problems…

    The different in my case is that I’m able to edit and view files, despite the lock, just not rename them, delete them, etc

    Like

  6. Hi Peter, I had similar problems like you describe. When we click new document on a library and it opens it in Office Online, you rename the document and afterwards would like to set some required meta data in the library itself, we get same error message that document is locked by yourself. We managed to ‘fix’ this by setting the following attributes on the library trough PnP provisioning: EnableVersioning=”true” EnableMinorVersions=”true” MinorVersionLimit=”100″ MaxVersionLimit=”500″ DraftVersionVisibility=”0″. Setting these options doesn’t lock the file anymore.

    Maybe this will give you some new insights or help you out.

    Liked by 1 person

    • Hi Robert, I think that that is similar to Sara’s comments. I have the feeling that something has changed to the out of the box library or Office Online is not able to deal with out of the box settings. Either way this should be fixed.

      I’ve reported this to Microsoft on twitter, but I’m still waiting for them to resolve the issue. I’m hesitant changing out of the box library settings as a workaround.

      I wonder if this is related to the changes currently made to document libraries and Office Online is assuming new settings.

      Like

  7. Hi,
    we have about 100 users who work’s online in SharePoint libraries. Many of us has this locked problems, even me admin. We have a case and Microsoft India is working on this huge problem.
    When a user open a document, edit it=locked by himself
    He can’t rename, delete, move or copy it for about 1-24 h
    When you open it in desktop Word, you can see that is locked by myself, sometimes 2, 3 or more instances of the same user or other users.
    It is a huge issue for us in our organisation and we need help NOW. Users are frustrating, and Microsoft tells us every second day to wait, “we are working on a solution”…..

    Like

  8. MS SharePoint Online Team have finaly updated the new version of SQL Tables and modyfied release times in the code(error 500 via https request).
    Info:
    HTTP/1.1 423 Locked
    Cache-Control: private, max-age=0
    Transfer-Encoding: chunked
    Strict-Transport-Security: max-age=31536000
    X-FRAME-OPTIONS: SAMEORIGIN
    X-Powered-By: ASP.NET
    MicrosoftSharePointTeamServices: 16.0.0.7806
    X-Content-Type-Options: nosniff
    X-MS-InvokeApp: 1; RequireReadOnly

    We have tested our SharePoint libraries via different users and verified Connection to SharePoint Online via software Fiddler Web Debuger.

    Everything seems OK, all users can copy, rename, move, edit same file over again aso…

    Like

  9. Peter:

    Did you ever resolve this? This happened to me with a document last month. A month passed, and I still cannot rename the document because it is “locked by another user” but the other user’s email address is my own.

    Like

    • Hi Francis,
      I found that when the locks last longer than a day that there were often background processes ( like Flow, SharePoint Workflows, PowerShell or anything else locking the files). i would be interested to see the version history on this document that is locked. Are you able to email that to me?

      Like

  10. Have seen this a lot lately I’m multiple tenants.
    Did you ever had a soloution to this?

    Like

    • Hi Per,
      I am suspecting background processes or forgotten locks but I havent been able to find an cause for it. Badly designed Flows or PowerShell script can cause these problems.
      Do you have any background processes running?

      Like

  11. Hi, a similar post speaks of the same problem https://techcommunity.microsoft.com/t5/SharePoint/Cannot-Release-Lock-on-SharePoint-Online-File/td-p/59694

    you have to change a registry key and it worked for me

    Like

Please leave a comment or feedback

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: