File being used by another process error with moving and deleting files

You are cmg to a conclusion to move to a particular folder after reading the pdf, i can give you a workaround , try to log the file names which matched your logic and which have not matched, then you move the files once you have the list of all the files you have to move.

I attempted these before and just did a double check. The only process that comes up as using the file is the UiPath Executor and ending that process kills the bot. The files are also not read only.

That is what I am currently doing. When processing the PDF, there is an if statement that adds the file name to a list if it does not match the logic. Then, after the Process sequence, there is a For Each to loop through the Move File list and move the files, where the error is occurring.

I am going to add the Movement sequence as a separate part of the bot workflow and see if this changes any of my results.

how about all the variables used in the reading, are those in the scope as narrow as possible? that could be holding the files too…

There are a decent amount of variables required to process the PDF information once it is read so that could be contributing. It still does not explain why the Movement works when the full process is run but not when it is run without the download. Or the Delete sequence not working.

Is there a way to ensure the variables are not holding the files? Could creating a separate node for the Movement component help?

I added the file movement as an invoked workflow with a 30 second delay and still no luck.

I then ran the process with the download from the internet and it got through the Movement sequence but again errored out on the Delete sequence. I am pretty lost as to what could be causing this issue if no other programs outside of UiPath are using these files.

just make sure that all resources used to process the files are disposed before moving the files, this is not about time or delays… in uipath that is concerned about the variables and activities we are using. Maybe also consider doing the file download and reading in a separate file and invoke in isolation mode.

1 Like

I was finally able to get it working after separating the Processing, Moving, and Deleting sequences and invoking their workflow files in isolation.

All variables and activities in these sequences involve reading and parsing values from PDF and text, creating folders and lists of files. I am not sure why invoking them in isolation worked, but I am happy it did. Do you know why this property would have fixed it, for future reference?

Thank you very much for your help! This was a tricky error to troubleshoot, but this knowledge will greatly help in future projects.

to be honest, i think working in isolation in your case, just helped to prevents those variables or activities to keep holding those files… but it could work well without it as well, unless maybe for some uipath bug that i dont know of…

That may be the best solution moving forward as this process reads lengthy text files and requires a lot of variables to correctly process them. I will do a detailed review to see if I can find the bottlenecks and use the isolation solution for now.

Thanks again!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.