简体   繁体   English

配置TFS2015构建代理失败,因为找不到代理池。 为什么?

[英]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. 使用由现场TFS2015提供的PowerShell脚本配置构建代理时,脚本会因为无法在服务器上找到代理池而出错。

However, the agent pool 'default' definitely exists. 但是,代理池'default'肯定存在。 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. 安装Visual Studio 2015具有最少的功能。
  • 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 PS C:\\ Windows \\ system32> E:\\ Build \\ agentConfigureAgent.ps1
Enter the name for this agent (default is Agent-SRV001): BUILD002 输入此代理的名称(默认为Agent-SRV001):BUILD002
Enter the URL for the Team Foundation Server (default is: http://[ip-address]:8080/tfs 输入Team Foundation Server的URL(默认为: http:// [ip-address]:8080 / tfs
Configure this agent against which agent pool? 针对哪个代理池配置此代理? (default pool name is 'default'): (默认池名称为'default'):
Enter the path of work folder for this agent (default is 'E:\\Build\\agent_work'): E:\\Build\\Work 输入此代理的工作文件夹路径(默认为'E:\\ Build \\ agent_work'):E:\\ Build \\ Work
Would you like to install the agent as a Windows Service (Y/N) (default is Y): n 是否要将代理安装为Windows服务(Y / N)(默认为Y):n
Would you like to unconfigure any existing agent (Y/N) (default is N; the agent will be updated): 是否要取消配置任何现有代理(Y / N)(默认为N;代理将更新):
Configuring agent 配置代理
Unblocking files Calling agent configure without /RunningAsService 取消阻止文件调用代理在没有/ RunningAsService的情况下进行配置
Calling agent configure without /Force 呼叫代理配置没有/ Force
Unable to find a agent pool with the name: default 无法找到名称为default的代理程序池
WARNING: Configure agent failed, but you might fix this problem by configure with /Force. 警告:配置代理失败,但您可以通过使用/ Force配置来解决此问题。
Would you like to try agent configure again with parameter -Force (Y/N): y 您是否想尝试使用参数-Force(Y / N):y再次进行代理配置
Calling agent configure without /RunningAsService 呼叫代理配置没有/ RunningAsService
Calling agent configure with /Force 呼叫代理配置/ Force
Unable to find a agent pool with the name: default 无法找到名称为default的代理程序池
E:\\Build\\agent\\ConfigureAgent.ps1 : Configure agent failed. E:\\ Build \\ agent \\ ConfigureAgent.ps1:配置代理失败。 At line:1 char:1 在行:1个字符:1
+ E:\\Build\\agent\\ConfigureAgent.ps1 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + E:\\ Build \\ agent \\ ConfigureAgent.ps1 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + CategoryInfo:NotSpecified:(:) [Write-Error],WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,ConfigureAgent.ps1 + FullyQualifiedErrorId:Microsoft.PowerShell.Commands.WriteErrorException,ConfigureAgent.ps1

The user account running the build process script, needs to be part of the Agent Pool Administrator Accounts . 运行构建过程脚本的用户帐户需要是Agent Pool Administrator Accounts

The error message from the script is misleading. 脚本中的错误消息具有误导性。

To resolve this error, I had to add the Windows user which is running the TFS build agent to the "Advanced" access level. 要解决此错误,我必须将运行TFS构建代理的Windows用户添加到“高级”访问级别。 This can be done under the root TFS Administer Server (top right gear) > Access levels UI. 这可以在根TFS管理服务器(右上角)>访问级别UI下完成。 ( http://your-tfs-server-here:8080/tfs/_admin/_licenses ) My default access level for the server is set to Stakeholder. http:// your -tfs-server-here:8080 / tfs / _admin / _licenses )我的服务器默认访问级别设置为Stakeholder。

The answer from @RoeIF worked for me, but I had a bit of trouble finding the page needed to add the account. @RoeIF的答案对我有用,但我在找到添加帐户所需的页面时遇到了一些麻烦。 Here's a screen grab to help: 这是一个屏幕抓取帮助:

在此输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM