We have a flow which create a new file as follow (this will create a new version of the file, by replacing existing file):-
and we set the following setting for the create a new file action:-
when the flow run, sometimes it raise this error "The file ***** is locked for shared use by ***"
:-
{"statusCode":400,"headers":{"Vary":"Origin","X-SharePointHealthScore":"3","X-MS-SPConnector":"1","X-SP-SERVERSTATE":"ReadOnly=0","DATASERVICEVERSION":"3.0","SPClientServiceRequestDuration":"35","X-DataBoundary":"None","X-1DSCollectorUrl":"https://mobile.events.data.microsoft.com/OneCollector/1.0/","X-AriaCollectorURL":"https://browser.pipe.aria.microsoft.com/Collector/3.0/","SPRequestGuid":"c4f55cdf-f772-45fc-b018-3abf500128cc","request-id":"c4f55cdf-f772-45fc-b018-3abf500128cc","MS-CV":"31z1xHL3/EWwGDq/UAEozA.0","Strict-Transport-Security":"max-age=31536000","X-FRAME-OPTIONS":"SAMEORIGIN","Content-Security-Policy":"frame-ancestors 'self' teams.microsoft.com *.teams.microsoft.com *.skype.com *.teams.microsoft.us local.teams.office.com *.powerapps.com *.yammer.com *.officeapps.live.com *.office.com .stream.azure-test.net .microsoftstream.com .dynamics.com .microsoft.com;","MicrosoftSharePointTeamServices":"16.0.0.22713","X-Content-Type-Options":"nosniff","X-MS-InvokeApp":"1; RequireReadOnly","Timing-Allow-Origin":"","x-ms-apihub-cached-response":"true","x-ms-apihub-obo":"true","Cache-Control":"max-age=0, private","Date":"Tue, 26 Jul 2022 14:44:44 GMT","P3P":"CP="ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI"","X-AspNet-Version":"4.0.30319","X-Powered-By":"ASP.NET","Content-Length":"348","Content-Type":"application/json","Expires":"Mon, 11 Jul 2022 14:44:44 GMT","Last-Modified":"Tue, 26 Jul 2022 14:44:44 GMT"},"body":{"status":400,"message":"The file https://********.sharepoint.com/sites/CMS/Contracts/612/-Entity Consultancy Contract.docx is locked for shared use by hahmed@.org [membership].\r\nclientRequestId: c4f55cdf-f772-45fc-b018-3abf500128cc\r\nserviceRequestId: c4f55cdf-f772-45fc-b018-3abf500128cc"}}
any advice how we can avoid this error permanently ? For example, can we force unlock the file before creating a new version of it?