My Pipeline is setup to run on a few branches and whenever code gets committed, it runs to copy the files to the dev web server. The task didn't used to fail this much but it seems that we have a ton of files (~30k) as it normally runs for 15-20 mins when it succeeds.

Because the task is assigned to the job in the stages of the pipeline, I can't add the retryCount option identified by Microsoft [here](https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/copy-files?view=azure-devops&tabs=yaml) as you can't modify the YAML code and can only use the DevOps web interface and that option is not displayed. Considering that we use UNC target paths on a remote host, it seems like a no brainer to add the retryCount variable to the task, but how can I achieve this if DevOps won't let me...

[![Agent Job Copy File Task](https://i.stack.imgur.com/xjpWp.png)](https://i.stack.imgur.com/xjpWp.png)

The error I get is `Failed cp: cp: copyFileSync: could not write to dest file (code=UNKNOWN)` and happens at random files every time.

I tried adding both available agents in the **agent job execution** to ease the workload but still getting the same instability. And now getting mkdir errors so I will revert this change.
[![Agent Job Execution](https://i.stack.imgur.com/yl0n4.png)](https://i.stack.imgur.com/yl0n4.png)

Basically all I can do is redeploy until it eventually succeeds. I can confirm that the files are not locked by other users or the web service.

The Agent Version we have is 2.196.2. on Azure DevOps Server 2020 Update 1.1