Let's say you have multiple build agents configured and you have a folder on the build agents that has some content in it that isn't from TFS (even specifying Output, some intermediate stuff like the obj folder might be generated in a project folder for example) and you deleted the folder in TFS.
Next time you'd build, you'd get an cannot be deleted because it is not empty.
error. When triggering the build, you could add the Build.Clean
variable as all
or source
to your next build to fix it. However, since you have multiple agent, only the next agent running will receive that command and clean, and any other builds you make that falls on another agent will fail again because they still have the folder.
Editing the whole build definition so they do a full clean every build would be overkill.
I am of course looking for something else than "Go in the actual folders and delete the folders manually". If it changes anything, the agents aren't hosted, but on premises.
Edit: Logs from the build server, starting with the last cannot be deleted
warning:
2017-03-14T20:23:24.2384009Z d:\vso\b1\_work\32\s\[Obfuscated] cannot be deleted because it is not empty.
2017-03-14T20:23:24.4964210Z ##[error]Exit code 1 returned from process: file name 'tf', arguments 'vc get /version:24617 /recursive /overwrite d:\vso\b1\_work\32\s /loginType:OAuth /login:.,******** /noprompt'.
2017-03-14T20:23:24.5124180Z ##[debug]Microsoft.VisualStudio.Services.Agent.ProcessExitCodeException: Exit code 1 returned from process: file name 'tf', arguments 'vc get /version:24617 /recursive /overwrite d:\vso\b1\_work\32\s /loginType:OAuth /login:.,******** /noprompt'.
at Microsoft.VisualStudio.Services.Agent.ProcessInvoker.<ExecuteAsync>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Services.Agent.Worker.Build.TfsVCCommandManager.<RunCommandAsync>d__26.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Services.Agent.Worker.Build.TFCommandManager.<GetAsync>d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Services.Agent.Worker.Build.TfsVCSourceProvider.<GetSourceAsync>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Services.Agent.Worker.Build.BuildJobExtension.<PrepareAsync>d__23.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Services.Agent.Worker.JobExtensionRunner.<RunAsync>d__30.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Services.Agent.Worker.StepsRunner.<RunAsync>d__0.MoveNext()
2017-03-14T20:23:24.5174212Z ##[section]Finishing: Get Sources