Symptoms
Build fails during the collecting changes step with an error message similar to:
Failed to collect changes, error: Error collecting changes for VCS repository '"<...>" {instance id=4, parent internal id=5, parent id=<...>, description: "git@github.com:<...>/<...>.git#refs/heads/master"}'
git -c credential.helper= -c credential.helper=/opt/teamcity/temp/credHelper....sh fetch --progress --no-tags --recurse-submodules=no git@github.com:<...>/<...>.git +refs/heads/master:refs/heads/master command failed.
exit code: 1
stderr: error: cannot lock ref 'HEAD': Unable to create '/storage/data/system/caches/git/git-<...>.git/./HEAD.lock': File exists.
Another git process seems to be running in this repository... remove the file manually to continue.
Cause
The Git cache of this repository on the TeamCity Server's side has the HEAD.lock file, indicating to Git that it is locked by another Git process.
The probable cause is that the previous fetch from the remote was interrupted and not completed, so the HEAD.lock file was not properly removed.
Resolution
The HEAD.lock file must be deleted from the cache.
TeamCity Cloud users don't have access to the caches on the TeamCity Server or the file system.
Contact TeamCity Support for assistance in deleting this file and resolving the issue.
Comments
0 comments
Please sign in to leave a comment.