【问题标题】:Issue on installing a build agent for TFS 2017为 TFS 2017 安装构建代理的问题
【发布时间】:2017-04-07 23:35:41
【问题描述】:

我在 SQL Express 上安装了独立的单服务器 TFS 2017 RTM。它不在任何域中,而是在我的笔记本电脑上。已经提出来供我自己使用(也用于学习)。将其设置为在 SSL 的自签名证书上运行。

考虑在同一台机器上设置一个 vNext 构建代理。我记得在我大脑的某个地方,构建机器不应该在 TFS 应用程序层中,以减少表面攻击。好吧,我现在并不真正关心表面攻击。但我还需要一个带有构建设置的工作 TFS。

在输入 URL(https URL)后进行配置时,系统会提示我输入身份验证类型。我输入了协商。输入凭据后,出现以下错误。

TF400813: Resource not available for anonymous access. Client authentication required.

在使用集成作为身份验证类型时,出现以下错误。

An error occurred while sending the request.
Failed to connect.  Try again or ctrl-c to quit

当我使用 http 站点作为 URL 时,两种身份验证类型都出现以下错误。

Connecting to server ...
Found
Failed to connect.  Try again or ctrl-c to quit

我可以 ping 我的网址。

以下是 _diag 文件夹中的错误日志。

[2016-11-23 19:53:40Z INFO CredentialManager] Creating type Integrated
[2016-11-23 19:53:40Z INFO CredentialManager] Creating credential type: Integrated
[2016-11-23 19:53:40Z INFO IntegratedCredential] GetVssCredentials
[2016-11-23 19:53:40Z INFO ConfigurationManager] cred retrieved
[2016-11-23 19:53:40Z INFO Terminal] WRITE LINE: Connecting to server ...
[2016-11-23 19:53:41Z INFO CommandSettings] Flag 'unattended': 'False'
[2016-11-23 19:53:41Z ERR  Terminal] WRITE ERROR (exception):
[2016-11-23 19:53:41Z ERR  Terminal] Microsoft.VisualStudio.Services.WebApi.VssServiceResponseException: Found
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponse(HttpResponseMessage response)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__45.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__42`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at Microsoft.VisualStudio.Services.Location.Client.LocationHttpClient.<GetConnectionDataAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at Microsoft.VisualStudio.Services.WebApi.Location.VssServerDataProvider.<ConnectAsync>d__41.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.Agent.AgentServer.<ConnectAsync>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.Agent.Listener.Configuration.ConfigurationManager.<TestConnectAsync>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.Agent.Listener.Configuration.ConfigurationManager.<ConfigureAsync>d__7.MoveNext()

【问题讨论】:

  • 你能通过 Web 访问 TFS 吗?
  • 是的 - 我可以通过网络访问它。

标签: tfs tfsbuild azure-pipelines


【解决方案1】:

尝试禁用匿名身份验证并为您的 TFS 启用 Windows 身份验证。

由于您为自己的用途设置了 TFS,因此您可以考虑使用 Visual Studio Team Service 而不是本地 TFS。 VSTS 对 5 位用户免费。

【讨论】:

  • 是的,我也有 VSTS。尝试使其也可以与本地安装一起使用。我在身份验证中没有看到 Windows 身份验证,我可能需要在 IIS 中将其解锁。将尝试该选项并通知您。
  • 让我们知道您的测试结果。
  • 当然。它在我的笔记本电脑上。所以会在几天内完成并通知您。
  • 我的 Win 10 版本是“Windows 10 Home Single Language”,根据page,我需要专业版或企业版。如果没有 Windows 身份验证,我无法进一步进行构建设置?我可以在同一台机器上为 VSTS 设置构建!
  • 使用 NTLM 怎么样?
【解决方案2】:

尝试使用 PAT 作为身份验证类型,并从您的个人资料菜单的“安全”页面获取个人访问令牌。使用选定范围 - 代理池(读取、管理)

http://go.microsoft.com/fwlink/?LinkID=825113

个人访问令牌用于注册代理。最后一步是为代理服务提供凭据。

【讨论】:

  • 我试过这个,我得到以下错误.. System.Net.Http.HttpRequestException:发送请求时发生错误。 ---> System.Net.Http.WinHttpException: System.Net.Http.WinHttpAuthHelper 的 System.Net.Http.WinHttpAuthHelper.SetWinHttpCredential(SafeWinHttpHandle requestHandle, ICredentials credentials, Uri uri, UInt32 authScheme, UInt32 authTarget) 的参数不正确.CheckResponseForAuthentication(WinHttpRequestState state, UInt32& proxyAuthScheme, UInt32& serverAuthScheme) 在 System.Net.Http.WinHttpHandler.d__101.MoveNext()
  • 您在配置代理的哪一步收到此错误?似乎是 TFS 的一般身份验证问题。
  • 我可以在 web 中打开 tfs .. 在我提供 tfs URL 后进行配置时,我得到了错误..
【解决方案3】:

有一些事情可能出错了。

按照 Remko 的回答并继续“PAT”切换到“协商”方法后,如果由于“发送请求时发生错误”仍然无法使其正常工作,则可能是由于证书问题。在这种情况下,您可以通过传递参数 -sslskipcertvalidaion 来跳过 curl 内部发生的证书验证步骤,如下所示。

./config.sh --sslskipcertvalidation

这里是参考文档:running agent with self-signed certificate

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-04-30
    • 2021-10-30
    • 2018-06-19
    • 2018-09-14
    • 2017-08-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多