【发布时间】:2017-10-03 01:03:02
【问题描述】:
我们正在使用 TFS 2015 并在尝试构建存储库时遇到错误。我们有两个 TeamProject,A 中是我们要构建的主存储库,B 中是 A 中引用的子模块。
构建失败并显示以下消息:
2017-05-17T14:16:37.9148422Z Checked out branch refs/heads/develop for repository A at commit 8bece3e87781f4064c61ff8ce750f6dbd17bca02
2017-05-17T14:16:39.2898443Z ##[error]LibGit2Sharp.LibGit2SharpException: Response status code does not indicate success: 404 (Not Found).
2017-05-17T14:16:39.2898443Z ##[error] bei LibGit2Sharp.Core.Ensure.HandleError(Int32 result)
2017-05-17T14:16:39.2898443Z ##[error] bei LibGit2Sharp.Core.Proxy.git_submodule_update(SubmoduleHandle submodule, Boolean init, GitSubmoduleOptions& options)
2017-05-17T14:16:39.2898443Z ##[error] bei LibGit2Sharp.SubmoduleCollection.Update(String name, SubmoduleUpdateOptions options)
2017-05-17T14:16:39.2898443Z ##[error] bei Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.GitHelper.DoUpdateSubmodules(Repository repository, Int32 maxRecursionDepth, Int32 currentRecursionDepth, String username, String password, CancellationToken cancellationToken)
2017-05-17T14:16:39.2898443Z ##[error] bei Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.GitHelper.UpdateSubmodules(ITaskEndpoint endpoint, Repository repository, Int32 maxRecursionDepth, CancellationToken cancellationToken)
2017-05-17T14:16:39.2898443Z ##[error] bei Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.GitHelper.SyncAndCheckout(Boolean cleanRepository, String sourceBranch, String sourceVersion, Boolean checkoutSubmodules, CancellationToken cancellationToken)
2017-05-17T14:16:39.2898443Z ##[error] bei Microsoft.TeamFoundation.DistributedTask.Plugin.Build.GitSourceProvider.<>c__DisplayClass3_0.<PrepareRepositoryAsync>b__0()
执行构建的用户有权读取所有需要的存储库,还有什么问题?
.gitmodules 的 A
[submodule "custom/plugins/B"]
path = custom/plugins/B
url = https://tfs/Root/Project/_git/B
触发构建时的日志。
******************************************************************************
Wird gestartet: Quellen abrufen
******************************************************************************
Syncing repository: shopware (Git)
Klonen wird gestartet
ee22f3ff7951b579e57b8d9b65f14d6c382ca25a bis C:\Webteam-Agent\_work\9\s mit Submodulen ausgecheckt
revparsing ee22f3ff7951b579e57b8d9b65f14d6c382ca25a
grabbed ref , obj ee22f3ff7951b579e57b8d9b65f14d6c382ca25a
dereferenced to commit ee22f3ff7951b579e57b8d9b65f14d6c382ca25a
Checked out branch refs/heads/develop for repository shopware at commit ee22f3ff7951b579e57b8d9b65f14d6c382ca25a
LibGit2Sharp.LibGit2SharpException: Response status code does not indicate success: 404 (Not Found).
bei LibGit2Sharp.Core.Ensure.HandleError(Int32 result)
bei LibGit2Sharp.Core.Proxy.git_submodule_update(SubmoduleHandle submodule, Boolean init, GitSubmoduleOptions& options)
bei LibGit2Sharp.SubmoduleCollection.Update(String name, SubmoduleUpdateOptions options)
bei Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.GitHelper.DoUpdateSubmodules(Repository repository, Int32 maxRecursionDepth, Int32 currentRecursionDepth, String username, String password, CancellationToken cancellationToken)
bei Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.GitHelper.UpdateSubmodules(ITaskEndpoint endpoint, Repository repository, Int32 maxRecursionDepth, CancellationToken cancellationToken)
bei Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.GitHelper.SyncAndCheckout(Boolean cleanRepository, String sourceBranch, String sourceVersion, Boolean checkoutSubmodules, CancellationToken cancellationToken)
bei Microsoft.TeamFoundation.DistributedTask.Plugin.Build.GitSourceProvider.<>c__DisplayClass3_0.<PrepareRepositoryAsync>b__0()
Microsoft.TeamFoundation.DistributedTask.Agent.Common.AgentExecutionTerminationException: Fehler beim Vorbereiten des Repositorys mit einer Ausnahme. ---> LibGit2Sharp.LibGit2SharpException: Response status code does not indicate success: 404 (Not Found).
bei LibGit2Sharp.Core.Ensure.HandleError(Int32 result)
bei LibGit2Sharp.Core.Proxy.git_submodule_update(SubmoduleHandle submodule, Boolean init, GitSubmoduleOptions& options)
bei LibGit2Sharp.SubmoduleCollection.Update(String name, SubmoduleUpdateOptions options)
bei Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.GitHelper.DoUpdateSubmodules(Repository repository, Int32 maxRecursionDepth, Int32 currentRecursionDepth, String username, String password, CancellationToken cancellationToken)
bei Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.GitHelper.UpdateSubmodules(ITaskEndpoint endpoint, Repository repository, Int32 maxRecursionDepth, CancellationToken cancellationToken)
bei Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.GitHelper.SyncAndCheckout(Boolean cleanRepository, String sourceBranch, String sourceVersion, Boolean checkoutSubmodules, CancellationToken cancellationToken)
bei Microsoft.TeamFoundation.DistributedTask.Plugin.Build.GitSourceProvider.<>c__DisplayClass3_0.<PrepareRepositoryAsync>b__0()
--- Ende der internen Ausnahmestapelüberwachung ---
bei Microsoft.TeamFoundation.DistributedTask.Plugin.Build.GitSourceProvider.<>c__DisplayClass3_0.<PrepareRepositoryAsync>b__0()
bei System.Threading.Tasks.Task.Execute()
Der Worker Worker-b7f0b104-abc3-4af8-a305-6a3e93d9a72e hat die Ausführung des Auftrags b7f0b104-abc3-4af8-a305-6a3e93d9a72e abgeschlossen.
******************************************************************************
Build wird abgeschlossen
******************************************************************************
【问题讨论】:
-
您的子模块是否正确指向其他团队项目中的存储库?跨团队项目边界存储依赖项是个坏主意。
-
我添加了配置,为什么跨团队项目存储 repos 是个坏主意?
-
@Knerd 您能否发布更多有关您的获取源步骤的日志并测试此问题是否在其他构建定义中发生?尝试在其他存储库中测试
-
@Tingting0929-MSFT 只要所有存储库都在同一个 TeamProject 中,它就可以工作,如果它是不同的 TeamProject 则失败。
-
@Tingting0929-MSFT 我添加了更多日志,安装的 Visual Studio 版本是 2015 Enterprise。