【问题标题】:Visual Studio Team Services on-premises build serverVisual Studio Team Services 本地构建服务器
【发布时间】:2016-05-10 07:56:31
【问题描述】:

按照这些说明 (Deploy an agent on Windows),我已将 VSTS 构建代理配置为作为 Windows 服务运行。主机服务器配置为通过公司代理服务器访问 Internet。我可以通过 Internet Explorer 从服务器浏览到目标 VSTS 站点。

当我查看“池默认代理”时,我看到了我新配置的代理,但它的状态是“离线”并且它有一个红色块而不是绿色。如果我重新启动代理服务,则会在事件日志中收到以下错误:

vsoAgent 进程未能成功启动。它退出了代码 3. 检查 C:\VSTSBuild\agent_diag 中最新的代理日志文件以获取更多信息。等待 5 秒再重试。

但是,在检查 _diag 日志文件时,没有错误:

14:17:25.160120 将跟踪输出发送到日志文件:
C:\VSTSBuild\agent_diag 14:17:25.203125 VsoAgent.exe 使用
以下命令行:“C:\VSTSBuild\agent\agent\vsoagent.exe”
/runningAsService 14:17:25.345132 SettingsFileHelper.Load -
settings[AutoUpdate]=True 14:17:25.345132 SettingsFileHelper.Load -
设置[RootFolder]=C:\VSTSBuild\agent 14:17:25.345132
SettingsFileHelper.Load -
设置[WorkFolder]=C:\VSTSBuild\agent_work 14:17:25.346130
SettingsFileHelper.Load -
设置[ServerUrl]=https://XXXXappdevteam.visualstudio.com
14:17:25.346130 SettingsFileHelper.Load -
设置[代理名称]=代理-XXXX-NCC-BT001U 14:17:25.346130
SettingsFileHelper.Load - settings[PoolId]=1 14:17:25.346130
SettingsFileHelper.Load - settings[PoolName]=default 14:17:25.346130
SettingsFileHelper.Load - settings[AgentId]=5 14:17:25.346130
SettingsFileHelper.Load - 设置[RunAsWindowsService]=True
14:17:25.346130 SettingsFileHelper.Load -
设置[WindowsServiceName]=vsoagent.XXXXappdevteam.Agent-XXXX-NCC-BT001U
14:17:25.346130 SettingsFileHelper.Load -
设置[WindowsServiceDisplayName]=VSO 代理
(XXXXappdevteam.Agent-XXXX-NCC-BT001U) 14:17:25.381133
BaseLogger.LogStatus(scope.JobId =
00000000-0000-0000-0000-000000000000, scope.TimelineRecordId =
00000000-0000-0000-0000-000000000000,记录。名称 = 代理)
14:17:25.424136 BaseLogger.LogConsoleMessage(scope.JobId =
00000000-0000-0000-0000-000000000000,消息 = 对
进行身份验证 服务器https://XXXXappdevteam.visualstudio.com) 14:17:25.449133 exe
位置哈希 = ce01163e1787840dbffc06817bd93470

几分钟后,请求超时并在日志中添加以下内容:

System.Net.Http.HttpRequestException:发送时出错
请求。 ---> System.Net.WebException:无法连接到
远程服务器 ---> System.Net.Sockets.SocketException:一个连接
尝试失败,因为连接方没有正确响应
过了一段时间,还是因为建立连接失败
已连接主机未能响应 65.52.8.37:443

网络团队的一位同事对代理进行了跟踪,并确认他可以看到来自代理主机服务器的请求,但没有来自 visualstudio.com 的响应。

我尝试将以下内容添加到 VsoAgentService.exe.config 的 元素中

<system.net>
<defaultProxy>
  <proxy
    usesystemdefault="true"
    proxyaddress="proxy address here"
    bypassonlocal="true"
  />
</defaultProxy>

接下来我应该检查什么或者我哪里出错了?

【问题讨论】:

    标签: visual-studio-2013 build proxy azure-pipelines


    【解决方案1】:

    我不是作为服务运行,而是从 cmd 窗口运行 - 在 Git 中全局配置的代理后面。我在使用 VSTS 推荐的构建代理(您从 VSTS 中下载的那个)时遇到了连接问题,但是使用 GitHub 上的最新代理,它通过 PAT 进行身份验证,这些问题就消失了:

    https://github.com/Microsoft/vsts-agent

    【讨论】:

      【解决方案2】:

      尽管能够在浏览器中打开 URL,但我也遇到了类似的连接错误。我的问题最终与代理有关。如果您的代理需要身份验证,并且您的服务未作为具有代理权限的网络帐户运行,则您必须通过环境变量提供凭据。

      试试这些步骤:

      1. 打开 CMD 提示符
      2. 设置VSTS_HTTP_PROXY=http://yourproxy:80
      3. 设置 VSTS_HTTP_PROXY_USERNAME=proxyuser
      4. 设置 VSTS_HTTP_PROXY_PASSWORD=proxypassword
      5. 重启服务。

      【讨论】:

        猜你喜欢
        • 2016-11-18
        • 1970-01-01
        • 1970-01-01
        • 2013-03-18
        • 1970-01-01
        • 2014-11-21
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多