Search code examples
teamcity

TeamCity Unable to collect changes


Out of the blue, our TeamCity 2023.11.1 has started to fail builds because it is Unable to collect changes

Failed to collect changes, error: Error collecting changes for VCS repository '"vcsour-app2024-2" {instance id=146, parent internal id=33, parent id=our-company_Vcsour-app20242, description: "[email protected]:our-company/our-app.git#master"}'
'git fetch' command failed (repository dir: <TeamCity data dir>/system/caches/git/git-E920A8B4.git).
stderr: Failure updating tracking ref refs/heads/hotfix/pr-7175: Not a ref: refs/heads/feature/pr-6408:
elapsed time: 9s,015ms
exit code: 1, VCS root: "vcsour-app2024-2" {instance id=146, parent internal id=33, parent id=our-company_Vcsour-app20242, description: "[email protected]:our-company/our-app.git#master"}
Failed to collect changes, error: Error collecting changes for VCS repository '"vcsour-app2024-2" {instance id=146, parent internal id=33, parent id=our-company_Vcsour-app20242, description: "[email protected]:our-company/our-app.git#master"}'
'git fetch' command failed (repository dir: <TeamCity data dir>/system/caches/git/git-E920A8B4.git).
stderr: Failure updating tracking ref refs/heads/hotfix/pr-7175: Not a ref: refs/heads/feature/pr-6408:
elapsed time: 9s,015ms
exit code: 1, VCS root: "vcsour-app2024-2" {instance id=146, parent internal id=33, parent id=our-company_Vcsour-app20242, description: "[email protected]:our-company/our-app.git#master"}

The problem is local to this TeamCity instance, we have another independent instance that has no issue.

This error is happening on the server before it sends the build to the agent.


Solution

  • Tried a few different rain dances including changing VCS settings, recreating the VCS but what fixed it was purging the cache folder at

    <TeamCity data dir>/system/caches/git