I'm having the same trouble with both automatic and manual labeling. On the TeamCity website the following error is displayed:
Failed: Failed to set label 'xxxx': Labelling failed: java.net.SocketException: Connection reset
In the TeamCity logs the underlying error causing the above seems to be this:
https://username@hostname/tfs/DefaultCollection/_git/RepoName: cannot open git-receive-pack
Interestingly when I log onto the TeamCity server and check the local Git repository, the labels are being created and of course a different error message is obtained when trying to create the same again. The issue is that the labels never get pushed up to the remote repository in TFS.
Any suggestions would be appreciated. I recall seeing an issue about Git labeling in release notes for a particular TeamCity version but I can't track it down again.
Note: I get the same issue if I try it over HTTP as well. I believe the issue was related to labeling over HTTPS.