Build agent hangs when checking out Git repository



We're running TeamCity Professional 9.1.6 (build 37459).

I've configured a new project with VCS checkout mode set to: Automatically on agent. Initially the build was failing due to Git not being installed on the agent so I installed the latest version of Git for Windows.

Once done I re-started the agent and ran the build. It's now been running for 20 minutes with the following log output:

[18:45:56]i: TeamCity server version is 9.1.6 (build 37459)
[18:45:56] : bt28 (running for 22m:18s)
[18:45:56] : Collecting changes in 1 VCS root (1s)
[18:45:56] : [Collecting changes in 1 VCS root] VCS Root details
[18:45:56] : [VCS Root details] "MyRepo" {instance id=53, parent internal id=4, parent id=Root_MyRepo, description: ""}
[18:45:57]i: [Collecting changes in 1 VCS root] Waiting for completion of current operations for the VCS root 'MyRepo'
[18:45:58]i: [Collecting changes in 1 VCS root] Detecting changes in VCS root 'MyRepo' (used in 'Develop', 'Develop' and 2 other configurations)
[18:45:58]i: [Collecting changes in 1 VCS root] Will collect changes for 'MyRepo' starting from revision 72cd3c40972f7032c88176e1e235b2c2cf733bc4
[18:45:58]i: Waiting for the agent to start the build
[18:45:59]i: Agent time zone: UTC
[18:45:59]i: Agent is running under JRE: 1.8.0_66-b17
[18:45:59] : Clearing temporary directory: C:\TeamCity\buildAgent\temp\buildTmp
[18:45:59] : Publishing internal artifacts
[18:45:59] : [Publishing internal artifacts] Publishing 1 file using [ArtifactsCachePublisher]
[18:45:59] : [Publishing internal artifacts] Publishing 1 file using [WebPublisher]
[18:46:00] : Using vcs information from server. Reason: no revision information for build configuration "develop" and checkout directory C:\TeamCity\buildAgent\work\Gateway_Develop on agent
[18:46:00] : Clean build enabled: removing old files from C:\TeamCity\buildAgent\work\Gateway_Develop
[18:46:00] : Checkout directory: C:\TeamCity\buildAgent\work\Gateway_Develop
[18:46:00] : Updating sources: agent side checkout (running for 22m:14s)
[18:46:00] : [Updating sources] Will perform clean checkout. Reason: Checkout directory is empty or doesn't exist (running for 22m:14s)
[18:46:00] : [Updating sources] Cleaning C:\TeamCity\buildAgent\work\Gateway_Develop
[18:46:05] : [Updating sources] VCS Root: MyRepo (running for 22m:09s)
[18:46:05] : [VCS Root: MyRepo] revision: 72cd3c40972f7032c88176e1e235b2c2cf733bc4
[18:46:05] : [VCS Root: MyRepo] [C:\TeamCity\buildAgent\system\git\git-4C12D8D2.git]: "C:\Program Files\Git\bin\git.exe" show-ref
[18:46:05] : [VCS Root: MyRepo] [C:\TeamCity\buildAgent\system\git\git-4C12D8D2.git]: "C:\Program Files\Git\bin\git.exe" show-ref refs/heads/develop
[18:46:05] : [VCS Root: MyRepo] [C:\TeamCity\buildAgent\system\git\git-4C12D8D2.git]: "C:\Program Files\Git\bin\git.exe" show-ref refs/heads/develop
Current time: 19:08:14

Is this normal? Is there any way of diagnosing this further?


Hello Ben,

Could you please attach teamcity-vcs.log from the agent machine?


The issue was that we have 2FA enabled on our GitHub accounts so I had to update the VCS root to use SSH key authentication.


Hello Ben,

Thank you for the updated. Glad that issue was resolved!


Please sign in to leave a comment.