Teamcity and git repository, connection fails
I am getting this error when doing a test connection against my git repository (located on AppHarbor) from TeamCity 6.5. Can anybody explain this error more closely?
invalid advertisement of 001E# service=git-upload-pack
- Nuget Packages exclude version in folder naming
- Hudson or Teamcity for continuous integration?
- TeamCity, how to get names of the files edited
- Parameterized Checkout Rules in Teamcity discards parameter when using svn+ssh
- Is it possible to select a branch just before the build in TeamCity?
- Trigger Snapshot Dependency to Build Specific Branch in TeamCity
3 Solutions collect form web for “Teamcity and git repository, connection fails”
This is most likely caused by a bad interaction between the TeamCity JGit-based client and AppHabor’s WebGitNet-based Git-implementation. The same symptoms are mentioned here. I’m going to try and see if we can back-port that patch.
Edit: As rarouš mentions, using the Github integration (or a git repository at Bitbucket) is also a really good option.
I checked network interaction with Wireshark and I found that JGit which TeamCity uses treats this packet as incorrect:
HTTP/1.1 200 OK Cache-Control: private Content-Type: application/x-git-upload-pack-advertisement; charset=utf-8 Server: Microsoft-IIS/7.5 X-AspNet-Version: 4.0.30319 X-Powered-By: ASP.NET Date: Thu, 05 Jan 2012 09:56:30 GMT Content-Length: 255 001d# service=git-upload-pack ... <other stuff>
Precisely it is confused by
charset=utf-8 part (which was added when call to
response.Write(string) is performed). msysgit handles such packet correctly, though.
This fixes the issue by replacing
Write(string) with binary write. Other option is to specify
response.Charset = null; explicitly.
I tested info on GitWebAccess which has similar problems and made pull request with fix here.
I got the same error when trying to checkout a project from Eclipse with EGit. In my case I simply gave the wrong project path. If you come here because you got this error -> check your repository path first