TeamCity-“;在.gitmodules配置中没有此路径的条目;

TeamCity-“;在.gitmodules配置中没有此路径的条目;,git,teamcity,git-submodules,Git,Teamcity,Git Submodules,错误不断地重复发生,从而阻止TeamCity中的构建成功完成。它似乎无法将它的Gitrepo更新到最新版本 下面是错误消息:(我已将其格式化以使其更易于阅读) 当这个错误开始发生时,我查看了TeamCity构建代理的本地repo中的.gitmodules文件。它确实在那里: [submodule "MyApp/Submodules/MySubmodule"] path = MyApp/Submodules/MySubmodule url = http://build

错误不断地重复发生,从而阻止TeamCity中的构建成功完成。它似乎无法将它的Gitrepo更新到最新版本

下面是错误消息:(我已将其格式化以使其更易于阅读)

当这个错误开始发生时,我查看了TeamCity构建代理的本地repo中的.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

我遇到了这个问题——整个问题的根源是我为SSH设置了主repo(和身份验证),子模块被HTTPS路径引用


因此,我需要做的是删除子模块,然后使用SSH路径而不是HTTPS再次添加它(只是更改.gitmodules中的路径不起作用,因为子模块上的源代码也很重要)。

在我的情况下,不是协议不匹配。问题是在.gitmodules中的最后一行之后没有新行。对于git/SourceTree来说,这很好,但TeamCity不喜欢它。解决方法是在文件末尾添加一个额外的空行。

也许这个问题的答案会有所帮助。@Castrohenge感谢分享,尽管我已经看过了,但问题似乎很相似,虽然由于我提供的URL是正确的,所以解决方案不会很好地应用。具体的提交5bb7870d294c719f61261f94510343abff65b789是否在.gitmodules配置中具有正确的路径?我不确定我是否100%理解这个问题,但下面是我在回答这个问题时的最佳尝试:我使用了“Go to commit”并进行了该提交(5BB7870D294C719F61261F94510343ABF65B789)。我在提交时查看了文件树中的.gitmodules文件。事实上,正确的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