【发布时间】:2016-06-19 08:27:26
【问题描述】:
错误不断重复出现,导致 TeamCity 中的构建无法成功完成。似乎无法将其 Git 存储库更新到最新版本。
这是错误消息:(我已对其进行了格式化以使其更易于阅读)
[Updating sources] Failed to build patch for build #119 {build id=620}, VCS root:
"MyApp Git"
{
instance id=1,
parent internal id=1,
parent id=MYAPP_GIT,
description:
"http://build-pc:1234/scm/MYAPP/myapp.git#refs/heads/master"
},
due to error:
Patch building failed:
jetbrains.buildServer.buildTriggers.vcs.git
.submodules.MissingSubmoduleEntryException:
The repository 'http://teamcity@build-pc:1234/scm/MYAPP/myapp.git'
has a submodule in the commit '5bb7870d294c719f61261f94510343abff65b789'
at a path 'MyApp/Submodules/MySubmodule',
but has no entry for this path in .gitmodules configuration
在此错误开始发生时,我查看了 TeamCity 构建代理本地存储库中的 .gitmodules 文件。它确实在那里:
[submodule "MyApp/Submodules/MySubmodule"]
path = MyApp/Submodules/MySubmodule
url = http://build-pc:1234/scm/MYSUB/mysub.git
可能有助于诊断此问题的详细信息:
- 在创建这个子模块的时候,我记得有 一些并发症最终得到了解决。我最 请记住,由于必须多次创建子模块 输入错误的 URL 和路径。尽管如此,子模块 现在“工作”,减去 TeamCity 的这个问题。
- 其他子模块已添加到我们的项目中,据报道没有一个存在此问题。
这是当前的构建日志
[17:58:04]Checking for changes
[17:58:05]Will perform clean checkout
[17:58:05]Clean checkout reasons
[17:58:05]Agent doesn't have any version of the project sources
[17:58:05]Checkout directory is empty or doesn't exist
[17:58:05]Publishing internal artifacts
[17:58:05]Sending using ArtifactsCachePublisher
[17:58:05]Sending using WebPublisher
[17:58:05]Clearing temporary directory: C:\TeamCity\buildAgent\temp\buildTmp
[17:58:05]Using vcs information from server. Reason: no revision information for buildtype Full Build and checkout directory C:\TeamCity\buildAgent\work\MyApp_Checkout on agent
[17:58:05]Clean build enabled: removing old files from C:\TeamCity\buildAgent\work\MyApp_Checkout
[17:58:05]Checkout directory: C:\TeamCity\buildAgent\work\MyApp_Checkout
[17:58:05]Updating sources: server side checkout (6m:36s)
[17:58:06]Building and caching clean patch for VCS root: MyApp Git
[18:04:42]Failed to build patch for build #122 {build id=623}, VCS root: "MyApp Git" {instance id=1, parent internal id=1, parent id=MYAPP_GIT, description: "http://build-pc:1234/scm/MYAPP/myapp.git#refs/heads/master"}, due to error: Patch building failed: jetbrains.buildServer.buildTriggers.vcs.git.submodules.MissingSubmoduleEntryException: The repository 'http://teamcity@build-pc:1234/scm/MYAPP/myapp.git' has a submodule in the commit '8e88b0760de96739bef3d77e8e99303a1d0c8296' at a path 'MyApp/Submodules/MySubmodule', but has no entry for this path in .gitmodules configuration
[18:04:42]Repository sources transferred
[18:04:42]Will repeat attempt when server will be available, number of attempts left: 2
[18:04:52]Updating sources: server side checkout (running for 4m:24s)
[18:04:52][Updating sources] Will perform clean checkout
[18:04:52][Updating sources] Clean checkout reasons
[18:04:52]Agent doesn't have any version of the project sources
[18:04:52]Checkout directory is empty or doesn't exist
[18:04:53][Updating sources] Building and caching clean patch for VCS root: MyApp Git
【问题讨论】:
-
也许这个问题的答案会对stackoverflow.com/questions/14724520/…有所帮助。
-
@Castrohenge 感谢分享,虽然我已经看过了 - 问题似乎很相似,但由于我提供的 URL 是正确的,因此解决方案不太适用。
-
特定提交 5bb7870d294c719f61261f94510343abff65b789 在 .gitmodules 配置中的路径是否正确?
-
我不是 100% 确定我理解了这个问题,但无论如何,这是我最好的回答:我使用“Go to commit”并进行了该提交 (5bb7870d294c719f61261f94510343abff65b789)。我在该提交的文件树中查看了 .gitmodules 文件。确实,正确的 URL 也在那里。
-
这正是我想知道的,谢谢。也许复杂性导致 teamcity 对更改的记录不正确。您是否尝试过彻底检查所有来源?您可以通过运行自定义构建并选择清理源代码并再次从版本控制中获取的选项来做到这一点。
标签: git teamcity git-submodules