Search code examples
tfstfs-2015

Deleted build agent workspaces assuming they would create new ones


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


Solution

  • 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.