An error is consistently reoccurring, preventing builds in TeamCity from completing successfully. It seems to fail at updating it's Git repo to the latest version.
Here is the error message: (I've formatted it to make it easier to read)
[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
At the time this error started to occur, I looked inside the .gitmodules file inside the TeamCity build agent's local repo. It was indeed in there:
[submodule "MyApp/Submodules/MySubmodule"]
path = MyApp/Submodules/MySubmodule
url = http://build-pc:1234/scm/MYSUB/mysub.git
Details that might help diagnose this problem:
- At the time this submodule was being created, I remember there were some complications that eventually were taken care of. The most I remember is that the submodule had to be created multiple times due to the wrong URL and Path being entered. Nonetheless the submodule "works" now, minus this issue with TeamCity.
- Other submodules have been added to our project, none of which reportedly have this issue.
Here is the current build log
[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