Git checkout 'Automatically on agent ' fetch only first level folder sources

It may be related to the fact that I just upraded from 9.1.3 to 9.1.4 but I'd be surprised.

Basically builds that were working perfectly before are not building anymore because a part of the necessary sources is missing.

It works for the build that can be run with code 'checkout on Server.'

What is even more surprising is that since we use a single agent on the server machine, all the checkouts are done in the same repo: /opt/TeamCity/buildAgent/work

Here's an excerpt form the log:

Updating sources: agent side checkout (4s)
[16:52:14][Updating sources] Will perform clean checkout. Reason: Checkout directory is empty or doesn't exist
[16:52:14][Updating sources] Cleaning /opt/TeamCity/buildAgent/work/a8897a6c33eb499
[16:52:14][Updating sources] Using vcs information from agent file: a8897a6c33eb499.xml
[16:52:14][Updating sources] VCS Root: scm:git:git@server/system-payment (4s)
[16:52:14][VCS Root: scm:git:git@server/system-payment] revision: eafa526cb0b29a1fffa2399d9a7184a0c1ab235d
[16:52:14][VCS Root: scm:git:git@server/system-payment] [/opt/TeamCity/buildAgent/system/git/git-E13C2909.git]: /usr/bin/git show-ref
[16:52:14][VCS Root: scm:git:git@server/system-payment] [/opt/TeamCity/buildAgent/system/git/git-E13C2909.git]: /usr/bin/git ls-remote origin
[16:52:16][VCS Root: scm:git:git@server/system-payment] [/opt/TeamCity/buildAgent/system/git/git-E13C2909.git]: /usr/bin/git show-ref refs/heads/develop
[16:52:16][VCS Root: scm:git:git@server/system-payment] [/opt/TeamCity/buildAgent/system/git/git-E13C2909.git]: /usr/bin/git show-ref refs/heads/develop
[16:52:16][VCS Root: scm:git:git@server/system-payment] Cleaning /opt/TeamCity/buildAgent/work/a8897a6c33eb499
[16:52:16][VCS Root: scm:git:git@server/system-payment] The .git directory is missing in '/opt/TeamCity/buildAgent/work/a8897a6c33eb499'. Running 'git init'...
[16:52:16][VCS Root: scm:git:git@server/system-payment] [/opt/TeamCity/buildAgent/work/a8897a6c33eb499]: /usr/bin/git init
[16:52:16][VCS Root: scm:git:git@server/system-payment] [/opt/TeamCity/buildAgent/work/a8897a6c33eb499]: /usr/bin/git remote add origin git@server/system-payment
[16:52:16][VCS Root: scm:git:git@server/system-payment] [/opt/TeamCity/buildAgent/system/git/git-E13C2909.git]: /usr/bin/git pack-refs --all
[16:52:16][VCS Root: scm:git:git@server/system-payment] [/opt/TeamCity/buildAgent/work/a8897a6c33eb499]: /usr/bin/git config core.sparseCheckout true
[16:52:16][VCS Root: scm:git:git@server/system-payment] [/opt/TeamCity/buildAgent/work/a8897a6c33eb499]: /usr/bin/git show-ref
[16:52:16][VCS Root: scm:git:git@server/system-payment] [/opt/TeamCity/buildAgent/work/a8897a6c33eb499]: /usr/bin/git ls-remote origin
[16:52:17][VCS Root: scm:git:git@server/system-payment] [/opt/TeamCity/buildAgent/work/a8897a6c33eb499]: /usr/bin/git show-ref refs/remotes/origin/develop
[16:52:17][VCS Root: scm:git:git@server/system-payment] [/opt/TeamCity/buildAgent/work/a8897a6c33eb499]: /usr/bin/git log -n1 --pretty=format:%H%x20%s eafa526cb0b29a1fffa2399d9a7184a0c1ab235d --
[16:52:17][VCS Root: scm:git:git@server/system-payment] Commit 'eafa526cb0b29a1fffa2399d9a7184a0c1ab235d' is not found in repository. Running 'git fetch'...
[16:52:17][VCS Root: scm:git:git@server/system-payment] [/opt/TeamCity/buildAgent/work/a8897a6c33eb499]: /usr/bin/git fetch --progress origin +refs/heads/develop:refs/remotes/origin/develop (1s)
[16:52:19][VCS Root: scm:git:git@server/system-payment] [/opt/TeamCity/buildAgent/work/a8897a6c33eb499]: /usr/bin/git log -n1 --pretty=format:%H%x20%s eafa526cb0b29a1fffa2399d9a7184a0c1ab235d --
[16:52:19][VCS Root: scm:git:git@server/system-payment] [/opt/TeamCity/buildAgent/work/a8897a6c33eb499]: /usr/bin/git branch
[16:52:19][VCS Root: scm:git:git@server/system-payment] [/opt/TeamCity/buildAgent/work/a8897a6c33eb499]: /usr/bin/git update-ref refs/heads/develop eafa526cb0b29a1fffa2399d9a7184a0c1ab235d
[16:52:19][VCS Root: scm:git:git@server/system-payment] [/opt/TeamCity/buildAgent/work/a8897a6c33eb499]: /usr/bin/git checkout -q -f develop
[16:52:19][VCS Root: scm:git:git@server/system-payment] Cleaning scm:git:git@server/system-payment in /opt/TeamCity/buildAgent/work/a8897a6c33eb499 the file set ALL_UNTRACKED
[16:52:19][VCS Root: scm:git:git@server/system-payment] [/opt/TeamCity/buildAgent/work/a8897a6c33eb499]: /usr/bin/git clean -f -d -x


I repeated those steps manually and I could get all the source.
But if I let the agent do it, I don't get directory, I only get files in the root folder of the git repo

This is very weird, and annoying. It feels very strage that it could be a bug, people would have noticed by now I guess.

Any tips to further isolate the source of the problem are welcome!

Git version on the server is 1.7.1

2 comments

Hello,

It's a known issue in TeamCity 9.1.4 integration with Git client versions 1.7.0-1.7.4. It's fixed in 9.1.5 which is going to be released in few weeks. As of now please use the workaround.
Sorry for the inconvenience.

0

Thanks for acknowledging and directing me to the workaround !

0

Please sign in to leave a comment.