cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Luve28
Regular Visitor

Move Folder/Document Set gives an error, flow stops but data is moved anyway

I have a flow that archives a Document Sets by moving selected ones from the Job folder to the Archive folder.

On my test site everything works perfectly.

Testing it on production sites the Move Action takes much longer to complete (around 10 minutes instead of few seconds) and then fails with this error:

 

 

	There was a problem deleting folder "/sites/123/Jobs/JobName". Folders that have subsites can't be deleted. CallStack --    at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx)
	   at Microsoft.SharePoint.Library.SPRequest.DeleteUrl(String bstrWebUrl, StorePath bstrItemUrl, DeleteFlags delFlags, String etagMatch, UInt32 dwDeleteOp, Guid& pgOriginatorId, Int32 iThreshold, Int32 iDeletedByUserId, Int64 lDeletedTime, Guid& pgDeleteTransactionId)
	   at Microsoft.SharePoint.SPFolder.DeleteCore(DeleteOp deleteOp, SPFolderDeleteParameters parameters)
	   at Microsoft.SharePoint.Deployment.SPDeploymentMoveUtil.CleanupFolders(Uri[] exportObjectUris, SPUserToken userToken, DeploymentRealtimeLogger realTimeLogger)
	clientRequestId: 105e22cb-1dfe-4fc5-867a-9c784dd03080
serviceRequestId: 105e22cb-1dfe-4fc5-867a-9c784dd03080

 

 

The flow stops and does not complete.

The most weird part is that the Document Set is actually moved to the Archive folder.

 

I tried to search for this error but could not find anything that relates to it.

 

This is how the Move action is configured

Luve28_0-1641354998319.png

 

Can anyone assist?

8 REPLIES 8
Vighough
Frequent Visitor

I have the same problem. The 'Move folder' action is failing, when the folder is actually moved and also deleted from the source directory. Despite the error given. 

 

Did you managed to find a solution?

Not yet, it does not seem to be related to the items in the Job Data Set or to the site collection:

  1. I moved the items from an old Job Data Set to a new one and the flow worked fine.
  2. I also created a new Data Set on an old site collection (one that gave me the issue) but the flow worked fine as well.

I will keep digging, hopefully I can narrow down the issue and give more details.

Luve28
Regular Visitor

I have not found a solution for this, but set up a workaround:

  1. I collect the error in a variable called message using the function @{body('Move_Folder_Action')?['Message']} 
  2. set the variable action to Run after failure as well
    Luve28_0-1642740266768.png
  3. I set a condition that continues the workflow if message matches the error mentioned above or message is blank

not perfect but does the job

 

DanielGAJohnson
Helper II
Helper II

I've got the same problem. I'm going to implement @Luve28's workaround, but would of course prefer to be able to use the Delete Item SharePoint action to its proper extent. Now I have to alert the user that an item wasn't deleted and ask them to delete it manually, somewhat defeating the purpose of an automate process. My flow was working up until 4 days ago. I'm not sure yet what would have changed to prompt the error.

DanielGAJohnson
Helper II
Helper II

Finally got around to trying @Luve28 workaround. Unfortuantely, it's not going to work for me. The next step after my Move Folder step is to create a sharing link that then gets sent into our CRM with an API POST step. In the outputs from the Move Folder step in a successful run the body element includes the item ID which is needed in the Create Sharing Link step in order to generate the URL that gets sent back into our CRM. The body of the Move Folder step for a failed run only has the status and message values. So, even if I configure the next step to run if the Move Folder step fails, the Create Sharing Link step is going to fail since there won't be any value behind the dynamic content in that step.

bf
Frequent Visitor

Also now having this issue on a 3 year old flow that has only ever worked perfectly

smogio
New Member

Hi,

 

Anyone has fixed this? Im having this issue suddenly in a couple of flows....

 

Se produjo un problema al eliminar la carpeta "XXX". No se puede eliminar carpetas que contengan subsitios. CallStack -- at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx)
at Microsoft.SharePoint.Library.SPRequest.DeleteUrl(String bstrWebUrl, StorePath bstrItemUrl, DeleteFlags delFlags, String etagMatch, UInt32 dwDeleteOp, Guid& pgOriginatorId, Int32 iThreshold, Int32 iDeletedByUserId, Int64 lDeletedTime, Guid& pgDeleteTransactionId)
at Microsoft.SharePoint.SPFolder.DeleteCore(DeleteOp deleteOp, SPFolderDeleteParameters parameters)
at Microsoft.SharePoint.Deployment.SPDeploymentMoveUtil.CleanupFolders(Uri[] exportObjectUris, SPUserToken userToken, DeploymentRealtimeLogger realTimeLogger)
clientRequestId: 9e0b2f2a-b748-426a-81e4-8a76de8ebb35
serviceRequestId: 9e0b2f2a-b748-426a-81e4-8a76de8ebb35

KarlH
Frequent Visitor

I too am using Flow to move buried sub-sub-sub folder data from site into another, flattening and tagging through the process. I also noted this error after I changed the source folder - odd that it wasn't happening on the others, but is now happening.

 

I'll see if capturing the error within a variable at least clears the error. 

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events happening this month - don't miss out!

 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (3,463)