Integrate TeamCity with Kiln (Git)?

I've created a VCS Root for a Kiln Git repositoy with the following settings:


When I test the connection (or try to run a build using this root), TeamCity reports the following:

Test connection failed in My Repository :: Release. List remote refs failed: org.eclipse.jgit.errors.NoRemoteRepositoryException: https://kiln-teamcity-user@my-company.kilnhg.com/Code/Repositories/Group/MyRepository.git: https://kiln-teamcity-user@my-company.kilnhg.com/Code/Repositories/Group/MyRepository.git/info/refs?service=git-upload-pack not found

I can't find the original info (because the makers of Kiln effectively deleted a large part of their online documentation), but I recall that Kiln requires a password – really any password (literally any password is accepted) – and I'm guessing that it needs to be included in the Git repository URL. Is there anyway to force the Git plugin (assuming that's what's trying to connect in this case) to include the password in the URL?

10 comments
Comment actions Permalink

I can confirm that this issue exists. Both TeamCity and Kiln developers have been notified. As a temporary workaround, consider using Hg instead of Git.

0
Comment actions Permalink

Did you add a Kiln's ssl certificate to the truststore used by TeamCity?

0
Comment actions Permalink

+1. I think it's to do with the TeamCity Git plugin (built on JGit) not finding the git-upload-pack executable.
I've added C:\Program Files (x86)\Git\libexec\git-core path to my %PATH% variable ($PATH$ in MingW32 / Cygwin), and tested that I can clone via command line just fine, but this issue persists in TeamCity.

0
Comment actions Permalink

I don't think this is the issue, as using HTTPS to access the same repo with Mercurial works fine (unless Git is using a separate trust store)

0
Comment actions Permalink

I bet you were able to clone from the command line before adding upload-pack to the PATH. Adding it to the PATH matters for ssh, but not for https. I still think the problem is in ssl certificate. Try adding it to the trust store and run TeamCity with appropriate options (-Djavax.net.ssl.trustStore=/path/to/keystore -Djavax.net.ssl.trustStorePassword=pwd). Also since TeamCity does git fetch in a separate process additional steps required for that to work, see http://youtrack.jetbrains.com/issue/TW-31655 for details.

0
Comment actions Permalink

Thanks Dmitri for the info. You're right, I was able to clone fine from a regular Windows command prompt and from Cygwin.
So, I set up a keystore, added the parameters, and now it's giving me this error:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
I pulled down Kiln's certificate, saved to a .cer file, also saved both the intermediate and the root to .cer files, imported all (root first, then intermediate, then Kiln cert) using keytool -trustcacerts switches, but still no joy.

So basically Kiln's SSL certificate is broken, or Java can't read it properly? Good to know...

0
Comment actions Permalink

Does a Test Connection work for this VCS root?

0
Comment actions Permalink

Nope... stuck to HG for now, and I've since finished with the client who has this setup, but I know their guys are watching this forum thread.

0
Comment actions Permalink

Kiln had a bug which prevented it from working with java git implementation used by TeamCity via http(s) protocol. A workaround was to use an ssh protocol. Recently they shipped a release with a fix of the bug, now TeamCity connects to Kiln via http.

0
Comment actions Permalink

Thanks Dmitri, I'll pass this on to my old team.

0

Please sign in to leave a comment.