Cannot delete document, error: The file is currently checked out or locked for editing by another user

sharepoint.stackexchange https://sharepoint.stackexchange.com/questions/112640

문제

I am using SP 2013 on-premise. I have an document library named Documents. I have added a new Word document. I try to remove this document, but it gives me an error:

Het bestand is momenteel uitgecheckt of vergrendeld om te worden bewerkt door een andere gebruiker

Translated to English:

The file is currently checked out or locked for editing by another user

In uls I found these errors:

1) =i:0).w|s-1-5-21-2290183699-4262213786-291648712-56877, AppPrincipalName= ,bstrUrl=http://aintranet.myCompany.com/Project ,bstrListName={C0C600AD-327A-4AF1-AA6E-1A280EC93796} ,lID=4 ,dwDeleteOp=4 ,bUnRestrictedUpdateInProgress=True

2) Exception occured in scope Microsoft.SharePoint.SPListItem.Recycle. Exception=Microsoft.SharePoint.SPException: Het bestand is momenteel uitgecheckt of vergrendeld om te worden bewerkt door een andere gebruiker. ---> System.Runtime.InteropServices.COMException: Het bestand is momenteel uitgecheckt of vergrendeld om te worden bewerkt door een andere gebruiker.0x80070021
at Microsoft.SharePoint.Library.SPRequestInternalClass.DeleteItem(String bstrUrl, String bstrListName, Int32 lID, UInt32 dwDeleteOp, Boolean bUnRestrictedUpdateInProgress, Guid& pgDeleteTransactionId) at Microsoft.SharePoint.Library.SPRequest.DeleteItem(String bstrUrl, String bstrListName, Int32 lID, UInt32 dwDeleteOp, Boolean bUnRestrictedUpdateInProgress, Guid& pgDeleteTransactionId) - -- End of inner exception stack trace --- at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx)
at Microsoft.SharePoint.Library.SPRequest.DeleteItem(String bstrUrl, String bstrListName, Int32 lID, UInt32 dwDeleteOp, Boolean bUnRestrictedUpdateInProgress, Guid& pgDeleteTransactionId) at Microsoft.SharePoint.SPListItem.DeleteCore(DeleteOp deleteOp) at Microsoft.SharePoint.ServerStub.SPListItemServerStub.InvokeMethod(Object target, String methodName, XmlNodeList xmlargs, ProxyContext proxyContext, Boolean& isVoid) at Microsoft.SharePoint.Client.ServerStub.InvokeMethodWithMonitoredScope(Object target, String methodName, XmlNodeList args, ProxyContext proxyContext, Boolean& isVoid)

3) Original error: Microsoft.SharePoint.SPException: Het bestand is momenteel uitgecheckt of vergrendeld om te worden bewerkt door een andere gebruiker. ---> System.Runtime.InteropServices.COMException: Het bestand is momenteel uitgecheckt of vergrendeld om te worden bewerkt door een andere gebruiker.0x80070021
at Microsoft.SharePoint.Library.SPRequestInternalClass.DeleteItem(String bstrUrl, String bstrListName, Int32 lID, UInt32 dwDeleteOp, Boolean bUnRestrictedUpdateInProgress, Guid& pgDeleteTransactionId) at Microsoft.SharePoint.Library.SPRequest.DeleteItem(String bstrUrl, String bstrListName, Int32 lID, UInt32 dwDeleteOp, Boolean bUnRestrictedUpdateInProgress, Guid& pgDeleteTransactionId) - -- End of inner exception stack trace --- at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx)
at Microsoft.SharePoint.Library.SPRequest.DeleteItem(String bstrUrl, String bstrListName, Int32 lID, UInt32 dwDeleteOp, Boolean bUnRestrictedUpdateInProgress, Guid& pgDeleteTransactionId) at Microsoft.SharePoint.SPListItem.DeleteCore(DeleteOp deleteOp) at Microsoft.SharePoint.ServerStub.SPListItemServerStub.InvokeMethod(Object target, String methodName, XmlNodeList xmlargs, ProxyContext proxyContext, Boolean& isVoid) at Microsoft.SharePoint.Client.ServerStub.InvokeMethodWithMonitoredScope(Object target, String methodName, XmlNodeList args, ProxyContext proxyContext, Boolean& isVoid)

What is wrong?

도움이 되었습니까?

해결책

If you examine the item using PowerShell you can get a better idea of what is going on. In all the cases where I have seen it the lock expires after short period(20 minutes) and has been caused by word setting a lock when a user has selected to edit the file:

$web = Get-SpWeb http://somesite.net
$item = $web.GetListItem("/relative/url/to/item.doc")
$item.file.LockType
$item.file.LockedByUser
$item.file.LockExpires

다른 팁

If you are facing this error while deleting empty folder "The file is currently checked out or locked for editing by another user.", Then it might be because of there are documents in the library that don't have a major version published.

Yo can go into the Library Settings and take ownership of the files. Then delete the entries, and the folder can be deleted.

Library Tools > Library > Library Settings > Permissions and Management > Manage files which have no checked in version

Just connect from SharePoint Designer using the farm account. Checkout the document. (The one it already says as checked out). Then checkin back. Now you will be able to delete.

This is an error I have overcome many times.

It is very likely the document is opened in Microsoft Office Word, therefor locked exclusively by the client.

'Locked' is a different state than 'Checked Out' as highlighted in 'Bunzab' response.

I have similar issue with users, It is very likely the document is opened in Microsoft Office Word by one user with checkout and edit.

They have not properly closed it and checkin.

If you look on file in document library it will have 'Locked' is a different state than 'Checked Out' as highlighted. you need to select it and discard checkout

I had the same problem. What I eventually discovered was that when I used the "+New" option to create a new Word Document, that it must have been Shared automatically. I turned off sharing for the file, and I was able to delete it immediately.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top