Skip to main content


 

Symptoms


K2 workflow in SharePoint on a Document library (With versioning enabled). The Document is checked in and it goes through a approval process but while it goes through a approval I have users changing the File (e.g. Adding values) but suddenly my workflow went in error state with the following error message:

The File SharePoint Doc Lib URL]..File name].docx is locked for shared use by User Name]

 

Diagnoses


The issue was casued by SP locking the file:
http://www.sharepointindepth.com/the-file-is-locked-for-shared-use-by/


 

Resolution

Provided PS script to release to document lock. (https://sharepointobservations.wordpress.com/2013/09/10/remove-sharepoint-client-side-file-lock/)
Client used the Powershell script to release the lock, then re-tried the instance in the error profile and it worked. This means you must execute the Powershell script before each client event....
 




 

How is this possible when standard PS needs to be run on the SharePoint box and the WF is executing on the K2 box?

 

Looking at PnP to run this remotely - the client object model doesn't extend to record locks, so wondering how you execute that PS?


OK - I accomplished this using a REST query in PowerShell


Reply