Unable to setup git in a mixed environment Windows server and Ubuntu agent

Hi all,
  I'm having some issues I could use a hand with.  We're running mixed environment until with EOL our .NET projects.  As a results, our teamcity 6.0.2 server is running on Windows 2008 Server.  Our agent is an Ubutu 10.10 server.  Everything has been working perfectly, and we switched from SVN to git.  Given the windows compoennt, it's causing some headaches.  Here is my issue.


We use client checkout, as a result, I can't use the "Private Key" method, but I have to use the "Default Private Key".  This is fine.  I've set up the public/private keys properly, and on the agent I can switch to the user (teamcity) that runs the teamcity agent and execute "ssh git@github.com".  I'm successfully authenticated, and no issues occur.


On the server side, I've set up msysgit and configured my keys.  In the git console I can execute the command "ssh git@github.com" and authenticate succesfully.


However, because our server is windows, the server runs under the Local System account.  Is there a system property I can give the server to tell it which key file to use without effecting the client checkout?  I'm also receiving this on the client, which is very surprising since the user "teamcity" can authenticate as outline above.  This is my stacktrace.

Caused by: jetbrains.buildServer.vcs.VcsException: 'git fetch' command failed. stderr: Exception in thread "main" org.eclipse.jgit.errors.TransportException: git@github.com:Spidertracks/Aviator.git: Auth fail      at org.eclipse.jgit.transport.SshTransport.initSession(SshTransport.java:140)      at org.eclipse.jgit.transport.TransportGitSsh.exec(TransportGitSsh.java:150)      at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:247)      at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:100)      at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:121)      at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:111)      at org.eclipse.jgit.transport.Transport.fetch(Transport.java:880)      at jetbrains.buildServer.buildTriggers.vcs.git.Fetcher.fetch(Fetcher.java:67)      at jetbrains.buildServer.buildTriggers.vcs.git.Fetcher.main(Fetcher.java:43) Caused by: com.jcraft.jsch.JSchException: Auth fail      at com.jcraft.jsch.Session.connect(Session.java:452)      at org.eclipse.jgit.transport.SshTransport.initSession(SshTransport.java:133)      ... 8 more



Thanks,
Todd

2 comments
Comment actions Permalink

Solved this one myself.  Here is how I got it working.

  1. Create a new user account teamcity.  I gave it SERVICE ACCOUNT permissions and remote desktop
  2. Log in as the teamcity user and use msysgit to set up your ssh keys.  Test you can ssh into github.
  3. Log in as administrator, set the teamcity service user to the "teamcity" user you created.
  4. Set the key method to "Default Private Key"
  5. Log in as the agent's runtime user
  6. Ensure your ssh keys work.
0
Comment actions Permalink

Hi Todd, sorry for delay in replying.

Unfortunately at the moment there is no system property you asked for. On the agent we support only default location of ssh keys and both server and agent use same settings.
The only way to solve it is to create appropriate default ssh keys for the user who run TeamCity server - exactly what you've done.

0

Please sign in to leave a comment.