Errors while running git garbage collection
We are running Teamcity professional 2019.1.2 (build 66342) on a Windows Server 2012.
Wa are getting these warning.
git@github.com:my-company/my-repository (clone dir <TeamCity Data Directory>\system\caches\git\git-CE5A4270.git): Error while running garbage collection jetbrains.buildServer.vcs.VcsException: 'git repack' command failed. exception: Timeout exception: the process did not produce output longer than 1800 seconds; Process: git repack -a -d exit code: -1
I tried to run by myself the git gc <TeamCity Data Directory>\system\caches\git\git-CE5A4270.git but it failed because of the following error:
Rename from 'E:/TeamCity/Data/system/caches/git/git-CE5A4270.git/./packed-refs.new' to 'E:/TeamCity/Data/system/caches/git/git-CE5A4270.git/./packed-refs' failed.
Should I clean the git cache?
Any ideas?
Thanks in advance
Please sign in to leave a comment.
Hello Justin,
It looks like .packed-refs file is locked by some process running. I would suggest to check if lsof/lslk (Unix) or Process Explorer (Win) show anything of interest on the file first. The likely cause could be a Git client running which has referenced the file.
It is possible that the "jetbrains.buildServer.vcs.VcsException: 'git repack' command failed" could hint of the TeamCity server itself locking the file up during the attempts to collect garbage. As an option, you could try to stop the server temporarily - if this hypothesis is correct, process lock would be lifted and you could manually run "git gc", then start the server.
Should the issue reproduce and it would turn out that the server is locking up file, please send us teamcity-server.log and teamcity-cleanup.log files via "Submit a request" form.