本地代理设置 TFS 2017 失败
Posted
技术标签:
【中文标题】本地代理设置 TFS 2017 失败【英文标题】:On-Premise Agent Setup TFS 2017 Fails 【发布时间】:2018-10-10 07:05:55 【问题描述】:我们的代码库基于 TFS 2017。我们正在尝试在不同的机器上设置本地测试代理,以便它们在运行测试时可以分担负载。不幸的是,在运行 ./config 命令时,我们遇到了以下错误消息。
[2018-04-30 07:35:21Z INFO RSAEncryptedFileKeyManager] Loading RSA key parameters from file C:\agent\.credentials_rsaparams
[2018-04-30 07:35:22Z ERR VisualStudioservices] POST request to https://tfs-dev.cebglobal.com/tfs/_apis/oauth2/token failed. HTTP Status: MethodNotAllowed
[2018-04-30 07:35:22Z ERR VisualStudioServices] OAuth issued token provider instance 16345490 failed to retrieve a token.
Reason: Microsoft.VisualStudio.Services.WebApi.VssServiceResponseException: "count":1,"value":"Message":"The requested resource does not support http method 'GET'."
at Microsoft.VisualStudio.Services.OAuth.VssOAuthTokenHttpClient.<GetTokenAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Services.OAuth.VssOAuthTokenProvider.<OnGetTokenAsync>d__14.MoveNext()
[2018-04-30 07:35:22Z WARN VisualStudioServices] Authentication failed with status code 401.
Date: Mon, 30 Apr 2018 07:35:22 GMT
P3P: CP="CAO DSP COR ADMa DEV CONo TELo CUR PSA PSD TAI IVDo OUR SAMi BUS DEM NAV STA UNI COM INT PHY ONL FIN PUR LOC CNT"
Server: Microsoft-IIS/8.5
WWW-Authenticate: Bearer, Basic realm="tfs-dev.cebglobal.com", Negotiate, NTLM
X-TFS-ProcessId: 6ff0ab0f-5bc4-4756-bf8b-f1e2d9aec72d
ActivityId: cc1dfe13-8178-4102-984c-dc5587ffe193
X-TFS-Session: 2fbb527d-d145-4ffd-934b-44ab2bf4a0c9
X-VSS-E2EID: 22cf0b80-4ec5-4f2d-8730-aaaa26fe96fa
X-FRAME-OPTIONS: SAMEORIGIN
X-TFS-SoapException: %3c%3fxml+version%3d%221.0%22+encoding%3d%22utf-8%22%3f%3e%3csoap%3aEnvelope+xmlns%3asoap%3d%22http%3a%2f%2fwww.w3.org%2f2003%2f05%2fsoap-envelope%22%3e%3csoap%3aBody%3e%3csoap%3aFault%3e%3csoap%3aCode%3e%3csoap%3aValue%3esoap%3aReceiver%3c%2fsoap%3aValue%3e%3csoap%3aSubcode%3e%3csoap%3aValue%3eUnauthorizedRequestException%3c%2fsoap%3aValue%3e%3c%2fsoap%3aSubcode%3e%3c%2fsoap%3aCode%3e%3csoap%3aReason%3e%3csoap%3aText+xml%3alang%3d%22en%22%3eTF400813%3a+Resource+not+available+for+anonymous+access.+Client+authentication+required.%3c%2fsoap%3aText%3e%3c%2fsoap%3aReason%3e%3c%2fsoap%3aFault%3e%3c%2fsoap%3aBody%3e%3c%2fsoap%3aEnvelope%3e
X-TFS-ServiceError: TF400813%3a+Resource+not+available+for+anonymous+access.+Client+authentication+required.
X-Powered-By: ASP.NET
Lfs-Authenticate: NTLM
X-Content-Type-Options: nosniff
我已经阅读了很多文章,并遵循了所有以前建议的更改 1. Windows 和 Basic Authentication 在 TFS IIS 级别启用
非常感谢任何帮助。
【问题讨论】:
目标机器是否与您的 TFS 实例在同一个域中? 【参考方案1】:首先确保目标机器在同一个域中,并且与你的 TFS 服务器有良好的连接。
根据错误信息“HTTP Status: MethodNotAllowed
”,一般应该是HTTP 405 Errors
,这是由于Web服务器不允许HTTP方法用于请求的URL。当为特定动词定义了特定的处理程序,并且该处理程序覆盖了您希望处理请求的处理程序或 URL 出现问题时,通常会出现这种情况。
因此,请尝试检查您的 TFS 服务器设置并解决以下文章中的问题:
Resolving HTTP 405 Errors
其他相关主题供您参考:
OAuth2, Using POST and Yet... Method Not Allowed? 405 POST method not allowed【讨论】:
以上是关于本地代理设置 TFS 2017 失败的主要内容,如果未能解决你的问题,请参考以下文章
构建失败并在 TFS 中出现 COMPILETODALVIK 错误,但它在我的本地计算机中正确构建
TFS 2017 - 从 TFS 服务器而不是代理运行 powershell 脚本
为啥添加 Microsoft.CodeAnalysis.NetAnalyzers 时 TFS 2015 SP3 构建代理会失败?