3
votes

I always used to be able to safely delete a TFS Build agents workspace to combat issues of locked files and all sorts of things. Now in TFS 2015 Update 1 I have deleted and they will not automatically re-create, it insists on using the same one. It actually seems like it cannot create a workspace but is able to be assigned one. I say this because I have created a new build definition to build a new branch and I receive the same error:

2016-01-04T10:47:06.0521586Z Syncing repository: IsdDev (TFVC)
2016-01-04T10:47:06.0521586Z workspaceName=ws_7_14
2016-01-04T10:47:06.8832305Z ##[error]TF14061: The workspace ws_7_14;Project Collection Build Service does not exist.
2016-01-04T10:47:06.9342371Z ##[error]Prepare repository failed with exception.

How can I tell TFS to create a new workspace? I don't want to manually re-create them as there are many. I deleted using TFS Sidekicks (for 2013)

Thanks

5
Is the XAML or Task based build?DaveShaw
Try editing the build definition and going to the Repository tab and setting Clean to true.DaveShaw
Or maybe try restarted the build agent / Host Process.DaveShaw
I have done the opposite as it it was already set to true and I changed to false (and back to true) with no luck. Also restarted and sent updates to all build agents :(Rodders
Maybe a restart of the controller (or TFS itself)?Rodders

5 Answers

3
votes

For us, deleting everything in the TFS cache folder solved the problem:

C:\Users\<>\AppData\Local\Microsoft\Team Foundation

2
votes

You need to create a new Workspace with the following parameters :

  • Owner : Project Collection Build Service (TEAM FOUNDATION)
  • Permissions : Public workspace
  • Name : same name as the deleted workspace
1
votes

So I managed to get this working. It's a bit overkill but I deleted all my build agents and all workspaces associated with them. Then I re-installed and re-configured using the PowerShell scripts. The Agents now have a new Id and subsequently creates new workspaces. Along with this, I had to delete the working directories so that the new workspaces didn't attempt to use the same ones.

I actually reconfigured my agents when I updated from TFS 2015 Update 1 RC 1 to full Update 1. I think that during this transition I have muddled things up a bit.

0
votes

TFS created a new workspace for me when I chose to copy the existing build definition. I simply deleted the original and then renamed the copied version back to the original name.

0
votes

As DaveShaw mentioned. Go to Repository tab and set clean to true, this will fix the issue.