繁体   English   中英

在TFS 2017中创建的内部版本无法克隆在另一台TFS 2017服务器上创建的Git存储库,并出现以下错误:重定向或身份验证重放过多

[英]Build created in TFS 2017 fails to clone Git repository created on another TFS 2017 server with error: Too many redirects or authentication replays

我在Prem TFS 2017 Update 1安装中有两个。

TFS1:它位于我公司的Intranet上。 只有我们的开发人员可以访问它。

TFS2:它位于公共互联网上。 这是为外部提供商和供应商向我们推送代码的目的。

TFS1可以连接到TFS2,但反之则不能。

我在TFS2(HTTPS)中有一个Git存储库。

我可以从Intranet克隆存储库。 使用来自TFS2的正确凭据,我可以毫无问题地提取和推送代码。 我正在使用在TFS2上本地创建的帐户。

我在TFS1中创建了一个从外部TFS2获取的内部版本。 我使用在开发环境中使用的相同凭据创建了一个新的服务端点(外部Git)。

生成版本无法克隆存储库,并显示以下错误:

2017-05-18T22:34:28.2542280Z Syncing repository: Header TfsGit external (Git)
2017-05-18T22:34:28.3323346Z Starting clone
2017-05-18T22:34:40.3485989Z ##[error]LibGit2Sharp.LibGit2SharpException: Too many redirects or authentication replays
2017-05-18T22:34:40.3485989Z ##[error]   at LibGit2Sharp.Core.Ensure.HandleError(Int32 result)
2017-05-18T22:34:40.3485989Z ##[error]   at LibGit2Sharp.Core.Proxy.git_clone(String url, String workdir, GitCloneOptions& opts)
2017-05-18T22:34:40.3642360Z ##[error]   at LibGit2Sharp.Repository.Clone(String sourceUrl, String workdirPath, CloneOptions options)
2017-05-18T22:34:40.3642360Z ##[error]   at Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.GitHelper.CloneRepository(String repositoryPath, Uri repositoryUrl, Boolean checkoutSubmodules, String username, String password)
2017-05-18T22:34:40.3642360Z ##[error]   at Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.GitHelper.SyncRepository(Uri repositoryUrl, String rootPath, Boolean cleanRepository, Boolean checkoutSubmodules, String sourceVersion, String username, String password)
2017-05-18T22:34:40.3642360Z ##[error]   at Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.GitHelper.SyncRepository(ITaskEndpoint endpoint, String rootPath, Boolean cleanRepository, Boolean checkoutSubmodules, String sourceVersion)
2017-05-18T22:34:40.3642360Z ##[error]   at Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.GitHelper.SyncAndCheckout(Boolean cleanRepository, String sourceBranch, String sourceVersion, Boolean checkoutSubmodules, CancellationToken cancellationToken)
2017-05-18T22:34:40.3642360Z ##[error]   at Microsoft.TeamFoundation.DistributedTask.Plugin.Build.GitSourceProvider.<>c__DisplayClass3_0.<PrepareRepositoryAsync>b__0()

我在詹金斯(Jenkins)中创建了一个构建,它成功获取了Git存储库。

我尝试了一些在网上找到的解决方案。 我在TFS2(IIS服务器)上启用了基本身份验证,我在TFS2中尝试了两种身份验证模式:NTLM和协商。

如何在TFS中使用位于另一个TFS服务器上的存储库进行构建?

好的,问题已解决。

我们正在使用一年多以前为TFS 2015平台安装的TFS代理。我们删除并安装了最新版本的TFS代理( https://go.microsoft.com/fwlink/?linkid=842100

配置花费了一段时间,我不得不应用此链接上建议的修复程序: https : //github.com/Microsoft/vsts-agent/issues/759

底线,如果使用的是TFS 2017,请使用最新版本的TFS代理。

我认为您应该从问题的第3行开始:“ TFS1可以连接到TFS2,但是反之亦然。” 该错误消息指示身份验证失败,因此听起来TFS1上的构建在定义中具有某些组件,其中TFS2正在检索TFS1的凭据。 关于这可能是什么,我首先想到的是,尝试在单个构建中混合(我假设)TFS1的AD和非AD用户可能会导致著名的“未记录功能”。 我是网络基础架构方面的新手,所以如果我距离不远,请保持谦虚。 希望它至少会为您引发一些其他想法。

编辑因为它确实在詹金斯工作,所以很可能与IIS有关。

暂无
暂无

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

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