Problems with ssh + Git VCS with gitolite

Hi All,

Im trying to setup TeamCity 6.5.3 to work with our gitolite frontend for git and have ran into a few issues.  The only supported authentication mechanism is ssh.  I am trying to use the Default Private Key, but repeatedly get authentication errors.

Team City is running on Windows, with Java 1.6 & Msysgit 1.7.0

Test connection failed in X :: X Connection test failed: org.eclipse.jgit.errors.UnsupportedCredentialItem: ssh://username@host:22: Password for username@host


If i use the Private Key, and directly reference my private key - it works fine.  When running git clone user@password:repo from the command line, again it works fine.  I have created a ~/.ssh/config which contains the path to the keyfile, but still no luck.

Running the Test Connection option produces the following output in teamcity-vcs.log

[2012-08-14 17:47:56,430]   WARN [on=editVcsRoot ] -      jetbrains.buildServer.VCS - Error occurred in test connection jetbrains.buildServer.vcs.VcsException: Connection test failed: org.eclipse.jgit.errors.UnsupportedCredentialItem: ssh://username@host:22: Password for username@host      at jetbrains.buildServer.buildTriggers.vcs.git.OperationContext.wrapException(OperationContext.java:136)      at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.testConnection(GitVcsSupport.java:1150)      at jetbrains.buildServer.controllers.admin.projects.EditVcsRootsController.doPost(EditVcsRootsController.java:173)      at jetbrains.buildServer.controllers.BaseFormXmlController$1.handleRequest(BaseFormXmlController.java:54)      at jetbrains.buildServer.controllers.AjaxRequestProcessor.processRequest(AjaxRequestProcessor.java:45)      at jetbrains.buildServer.controllers.BaseFormXmlController.doHandle(BaseFormXmlController.java:52)      at jetbrains.buildServer.controllers.BaseController.handleRequestInternal(BaseController.java:73)      at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)      at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)      at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)      at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)      at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)      at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)      at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.service(TeamCityDispatcherServlet.java:263)      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)      at jetbrains.buildServer.web.DiagnosticFilter.runChainWithModifiedThreadName(DiagnosticFilter.java:13)      at jetbrains.buildServer.web.DiagnosticFilter.doFilter(DiagnosticFilter.java:55)      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)      at jetbrains.buildServer.web.ResponseFragmentFilter.doFilter(ResponseFragmentFilter.java:18)      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)      at java.lang.Thread.run(Unknown Source) Caused by: org.eclipse.jgit.errors.UnsupportedCredentialItem: ssh://username@host:22: Password for username@host      at jetbrains.buildServer.buildTriggers.vcs.git.Settings$AuthSettings$1.get(Settings.java:271)      at org.eclipse.jgit.transport.CredentialsProviderUserInfo.promptPassword(CredentialsProviderUserInfo.java:109)      at com.jcraft.jsch.UserAuthPassword.start(UserAuthPassword.java:52)      at com.jcraft.jsch.Session.connect(Session.java:425)      at org.eclipse.jgit.transport.SshTransport.initSession(SshTransport.java:134)      at org.eclipse.jgit.transport.TransportGitSsh$JschConnection.exec(TransportGitSsh.java:183)      at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:361)      at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:104)      at jetbrains.buildServer.buildTriggers.vcs.git.TestConnectionCommand.checkFetchConnection(TestConnectionCommand.java:83)      at jetbrains.buildServer.buildTriggers.vcs.git.TestConnectionCommand.testConnection(TestConnectionCommand.java:63)      at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.testConnection(GitVcsSupport.java:1148)      ... 33 more



I need to be able to use the Checkout on Agent, as the build scripts will uprev a version file / re-generate files, and check them back in, so it needs the .git directory.

I have checked that Java is picking up the right $HOME directory, but its ok.  I suspect its something to do with the clone url, as the error ssh://username@password:22: seems strange, and doesnt include the repo name.

Is this something anyone has encountered before?  Any help is much appreciated.
2 comments
Comment actions Permalink

It seems the BuildAgent's git / ssh was using a combination of $HOMEDRIVE + $HOMEPATH, rather than $HOME (which I had changed to the correct paths)

0
Comment actions Permalink

Hello Andrew,

Can you switch to password-less authentication on your gitolite server? at the moment TeamCity doesn't support password authentication with agent-side checkout. You can use Anonymous and Default Public Key authentications. Also you get the errors during "Test connection" because you used "Default Private Key" authentication, it doesn't support password, but your gitolite server asks for it.

0

Please sign in to leave a comment.