Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configuring a TFS2015 build agent fails because agent pool not found. Why?

When configuring a build agent with the use of a PowerShell script, provided by an on-site TFS2015, the script errors out because it cannot find the agent pool on the server.

However, the agent pool 'default' definitely exists. On another server the same script works as expected, and builds run. See the script output below.

I have tried to following:

  • Create a new agent pool on the server, and reference that in the script. Same problem "Agent pool not found".
  • Installed Visual Studio 2015 with minimal features.
  • The user running the script is member of 'Build Administrators' and 'Build Service Accounts' security groups.

What is causing the script to fail on agent pool verification?

PS C:\Windows\system32> E:\Build\agentConfigureAgent.ps1
Enter the name for this agent (default is Agent-SRV001): BUILD002
Enter the URL for the Team Foundation Server (default is: http://[ip-address]:8080/tfs
Configure this agent against which agent pool? (default pool name is 'default'):
Enter the path of work folder for this agent (default is 'E:\Build\agent_work'): E:\Build\Work
Would you like to install the agent as a Windows Service (Y/N) (default is Y): n
Would you like to unconfigure any existing agent (Y/N) (default is N; the agent will be updated):
Configuring agent
Unblocking files Calling agent configure without /RunningAsService
Calling agent configure without /Force
Unable to find a agent pool with the name: default
WARNING: Configure agent failed, but you might fix this problem by configure with /Force.
Would you like to try agent configure again with parameter -Force (Y/N): y
Calling agent configure without /RunningAsService
Calling agent configure with /Force
Unable to find a agent pool with the name: default
E:\Build\agent\ConfigureAgent.ps1 : Configure agent failed. At line:1 char:1
+ E:\Build\agent\ConfigureAgent.ps1 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,ConfigureAgent.ps1

like image 422
RoelF Avatar asked Jun 15 '15 09:06

RoelF


People also ask

Why does configuring a tfs2015 build agent fail?

- Stack Overflow Configuring a TFS2015 build agent fails because agent pool not found. Why? Bookmark this question. Show activity on this post. When configuring a build agent with the use of a PowerShell script, provided by an on-site TFS2015, the script errors out because it cannot find the agent pool on the server.

How to open agent pool in TFS 2015?

TFS 2015: http:// {your_server}:8080/tfs/_admin/_AgentPool To configure the agent in an agent pool you should have administrator rights. Here, I am using TFS 2015 so to open agent pool, enter the URL as specified: This will open the agent pool for the project collection. Click on the download agent link on the left side to download the zip file.

Is there a default agent pool in Visual Studio 2015?

However, the agent pool 'default' definitely exists. On another server the same script works as expected, and builds run. See the script output below. Create a new agent pool on the server, and reference that in the script. Same problem "Agent pool not found". Installed Visual Studio 2015 with minimal features.

How to see the agent version on TFS 2015?

How to see the agent on TFS 2015. You can view the version of an agent by navigating to the Agent pools hub and selecting the Capabilities tab for the desired agent. TFS 2015: http://{your_server}:8080/tfs/_admin/_AgentPool.


2 Answers

The user account running the build process script, needs to be part of the Agent Pool Administrator Accounts.

The error message from the script is misleading.

like image 94
RoelF Avatar answered Oct 21 '22 11:10

RoelF


To resolve this error, I had to add the Windows user which is running the TFS build agent to the "Advanced" access level. This can be done under the root TFS Administer Server (top right gear) > Access levels UI. (http://your-tfs-server-here:8080/tfs/_admin/_licenses) My default access level for the server is set to Stakeholder.

like image 28
Jonathan Little Avatar answered Oct 21 '22 09:10

Jonathan Little