Git VCS root configuration with SSH

Hi!

First of all, all my machines are windows boxes. Git is msysgit 1.7.6 and ssh is CopSSH.

I have git repository on my server and 'git clone' command finishes successfully (git uses PuTTY's plink.exe with pageant.exe for key management):
idanilov@IDANILOV /e/test
$ git clone ssh://git@my-server:4837/test.git
Cloning into test...
warning: You appear to have cloned an empty repository.


When I try to configure TeamCity to do the same - it fails both with 'Default Private Key' and 'Private Key' options (I don't have passphrase on my key).

  1. Default Private Key
    1. TeamCity service is executed under my account and I have file c:\Users\idanilov\.ssh\config with these lines:
      Host my-server
      User git
      Port 4837
      PreferredAuthentications publickey
      IdentityFile private_key.ppk
      StrictHostKeyChecking no

      File private_key.ppk is located just beside it, at c:\Users\idanilov\.ssh\private_key.ppk
    2. Error message: "Test connection failed in ProjName :: BuildConfName. Connection test failed: org.eclipse.jgit.errors.NoRemoteRepositoryException: ssh://git@my-server:4837/test.git: not found."
  2. Private Key
    1. For simplicity I copied private_key.ppk to c:\private_key.ppk and set 'Private Key Path' to 'c:\private_key.ppk'.
    2. Error message: "Test connection failed in ProjName :: BuildConfName. Repository 'ssh://git@my-server:4837/test.git': Unable to load identity file: c:\private_key.ppk"



What could I try to get it up? What other information do you need to identify the problem?

Thanks for your time!

18 comments
Comment actions Permalink

I tried to set teamcity.git.use.native.ssh option as described here but without success.

P.S. Keys are generated with PuTTYgen - SSH-2 (RSA) option, 4096 bits length.

0
Comment actions Permalink

Hi Ivan,

to collect changes on the server we use jsch - java implementation of ssh and it supports only keys in OpenSSH format. Could you please convert you keys into this format and check if it helps? You can do it using Conversions in PuttyGen.

0
Comment actions Permalink

After key was converted with Private Key option TC no longer says 'Unable to load identity file', but 'NoRemoteRepositoryException' - same as point #1 described in first post.

I checked again that git clone ssh://git@my-server:4837/test.git works, so SSH config of the server is ok.

0
Comment actions Permalink

The only reason for this error I can think of is that your repository is empty. Could you please create an initial commit there and see if it helps?

0
Comment actions Permalink

Nothing changed. I also tried to experiment with other folders and created another repository in the git user's home, so repository URL is ssh://git@my-server:4837/~/test.git - but result is the same. Cloning from MSysgit console is successful and commits retrieved, but TC still reports 'NoRemoteRepositoryException' and message 'not found'.

0
Comment actions Permalink

I found these 2 threads:

http://stackoverflow.com/questions/1499279/how-can-i-get-git-and-copssh-to-look-in-the-correct-directory-for-keys
http://stackoverflow.com/questions/2523523/copssh-git-path-issue

It seems like CopSsh calculates the root of the filesystem not as Cygwin does. Let's try to copy your test.git repository to the <CopSsh installation dir>/test.git and check if it helps.

0
Comment actions Permalink

I have altered somewhat default CopSSH mount points specifically for git to work. To be concrete I added this line to /etc/fstab file:
C:/Program\040Files\040(x86)/Git/home /home ntfs override,binary,noacl 0 0

Thus /home refers to git's home where I have everything configured (.gitconfig mainly).

And yet one observation. When I launched Procmon from SysInternals and filter by 'test.git' in the path field - I can see many accesses when cloned from MSysgit console. But there's no single line when I hit 'Test Connection' button in the TC. But sshd.exe process is launched and does something on TC call - so TC connects to SSH service but can't proceed to the point where it requests specific path..

I have an impression that there's still some problems with private keys. When I forgot to launch pageant.exe and/or add my private key there - I have following results from MSysgit console:
idanilov@IDANILOV /e/t
$ git clone -v ssh://git@my-server:4837/~/test.git
Cloning into test...
fatal: The remote end hung up unexpectedly

Maybe TC faces same problem? Does TC provides a way to access logs for SSH interaction or something like that?

0
Comment actions Permalink

Here is the log from CopSSH on TC's Test Connection:

2011.10.20 17:26:02 -  Received disconnect from 172.30.83.130: 13: Unable to authenticate
2011.10.20 17:26:02 -  debug1: kbdint_alloc: devices ''
2011.10.20 17:26:02 -  debug1: auth2_challenge: user=git devs=
2011.10.20 17:26:02 -  debug1: keyboard-interactive devs
2011.10.20 17:26:02 -  debug1: attempt 1 failures 0
2011.10.20 17:26:02 -  debug1: userauth-request for user git service ssh-connection method keyboard-interactive
2011.10.20 17:26:02 -  debug1: user git matched 'User *' at line 24
2011.10.20 17:26:02 -  debug1: user git matched 'User git' at line 17
2011.10.20 17:26:02 -  debug1: attempt 0 failures 0
2011.10.20 17:26:02 -  debug1: userauth-request for user git service ssh-connection method none
2011.10.20 17:26:02 -  debug1: KEX done
2011.10.20 17:26:02 -  debug1: SSH2_MSG_NEWKEYS received
2011.10.20 17:26:02 -  debug1: expecting SSH2_MSG_NEWKEYS
2011.10.20 17:26:02 -  debug1: SSH2_MSG_NEWKEYS sent
2011.10.20 17:26:02 -  debug1: SSH2_MSG_KEX_DH_GEX_REPLY sent
2011.10.20 17:26:01 -  debug1: expecting SSH2_MSG_KEX_DH_GEX_INIT
2011.10.20 17:26:01 -  debug1: SSH2_MSG_KEX_DH_GEX_GROUP sent
2011.10.20 17:26:01 -  debug1: SSH2_MSG_KEX_DH_GEX_REQUEST_OLD received
2011.10.20 17:26:01 -  debug1: kex: server->client aes256-ctr hmac-sha1 none
2011.10.20 17:26:01 -  debug1: kex: client->server aes256-ctr hmac-sha1 none
2011.10.20 17:26:01 -  debug1: SSH2_MSG_KEXINIT received
2011.10.20 17:26:01 -  debug1: SSH2_MSG_KEXINIT sent
2011.10.20 17:26:01 -  debug1: list_hostkey_types: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256
2011.10.20 17:26:01 -  debug1: Local version string SSH-2.0-OpenSSH_5.8
2011.10.20 17:26:01 -  debug1: Enabling compatibility mode for protocol 2.0
2011.10.20 17:26:01 -  debug1: no match: PuTTY_Release_0.61
2011.10.20 17:26:01 -  debug1: Client protocol version 2.0; client software version PuTTY_Release_0.61
2011.10.20 17:26:01 -  Connection from 172.30.83.130 port 26757



And here is the one from MSysgit's console:

2011.10.20 17:29:36 -  Closing connection to 172.30.83.188 port 5789
2011.10.20 17:29:36 -  Transferred: sent 3952, received 3312 bytes
2011.10.20 17:29:36 -  debug1: do_cleanup
2011.10.20 17:29:36 -  Connection closed by 172.30.83.188
2011.10.20 17:29:36 -  debug1: channel 0: free: server-session, nchannels 1
2011.10.20 17:29:36 -  debug1: session_close: session 0 pid 0
2011.10.20 17:29:36 -  debug1: session_close_by_channel: channel 0 child 0
2011.10.20 17:29:36 -  debug1: session_by_channel: session 0 channel 0
2011.10.20 17:29:36 -  debug1: session_exit_message: release channel 0
2011.10.20 17:29:36 -  debug1: session_exit_message: session 0 channel 0 pid 3304
2011.10.20 17:29:36 -  debug1: session_by_pid: pid 3304
2011.10.20 17:29:36 -  debug1: Received SIGCHLD.
2011.10.20 17:29:35 -  debug1: permanently_set_uid: 11022/10513
2011.10.20 17:29:35 -  debug1: session_input_channel_req: session 0 req exec
2011.10.20 17:29:35 -  debug1: session_by_channel: session 0 channel 0
2011.10.20 17:29:35 -  debug1: server_input_channel_req: channel 0 request exec reply 1
2011.10.20 17:29:35 -  debug1: server_input_channel_open: confirm session
2011.10.20 17:29:35 -  debug1: session_open: session 0: link with channel 0
2011.10.20 17:29:35 -  debug1: session_open: channel 0
2011.10.20 17:29:35 -  debug1: session_new: session 0
2011.10.20 17:29:35 -  debug1: channel 0: new [server-session]
2011.10.20 17:29:35 -  debug1: input_session_request
2011.10.20 17:29:35 -  debug1: server_input_channel_open: ctype session rchan 256 win 16384 max 16384
2011.10.20 17:29:35 -  debug1: server_init_dispatch_20
2011.10.20 17:29:35 -  debug1: Entering interactive session for SSH2.
2011.10.20 17:29:35 -  debug1: monitor_child_preauth: git has been authenticated by privileged process
2011.10.20 17:29:35 -  Accepted publickey for git from 172.30.83.188 port 5789 ssh2
2011.10.20 17:29:35 -  debug1: ssh_rsa_verify: signature correct
2011.10.20 17:29:35 -  debug1: restore_uid: 11017/10513
2011.10.20 17:29:35 -  Found matching RSA key: 82:01:f5:37:90:07:c1:80:ae:5a:df:4f:fa:7d:40:c0
2011.10.20 17:29:35 -  debug1: matching key found: file /home/git/.ssh/authorized_keys, line 1
2011.10.20 17:29:35 -  debug1: fd 4 clearing O_NONBLOCK
2011.10.20 17:29:35 -  debug1: trying public key file /home/git/.ssh/authorized_keys
2011.10.20 17:29:35 -  debug1: temporarily_use_uid: 11022/10513 (e=11017/10513)
2011.10.20 17:29:35 -  debug1: attempt 2 failures 0
2011.10.20 17:29:35 -  debug1: userauth-request for user git service ssh-connection method publickey
2011.10.20 17:29:35 -  Postponed publickey for git from 172.30.83.188 port 5789 ssh2
2011.10.20 17:29:35 -  debug1: restore_uid: 11017/10513
2011.10.20 17:29:35 -  Found matching RSA key: 82:01:f5:37:90:07:c1:80:ae:5a:df:4f:fa:7d:40:c0
2011.10.20 17:29:35 -  debug1: matching key found: file /home/git/.ssh/authorized_keys, line 1
2011.10.20 17:29:35 -  debug1: fd 4 clearing O_NONBLOCK
2011.10.20 17:29:35 -  debug1: trying public key file /home/git/.ssh/authorized_keys
2011.10.20 17:29:35 -  debug1: temporarily_use_uid: 11022/10513 (e=11017/10513)
2011.10.20 17:29:35 -  debug1: test whether pkalg/pkblob are acceptable
2011.10.20 17:29:35 -  debug1: attempt 1 failures 0
2011.10.20 17:29:35 -  debug1: userauth-request for user git service ssh-connection method publickey
2011.10.20 17:29:34 -  debug1: user git matched 'User *' at line 24
2011.10.20 17:29:34 -  debug1: user git matched 'User git' at line 17
2011.10.20 17:29:34 -  debug1: attempt 0 failures 0
2011.10.20 17:29:34 -  debug1: userauth-request for user git service ssh-connection method none
2011.10.20 17:29:34 -  debug1: KEX done
2011.10.20 17:29:34 -  debug1: SSH2_MSG_NEWKEYS received
2011.10.20 17:29:34 -  debug1: expecting SSH2_MSG_NEWKEYS
2011.10.20 17:29:34 -  debug1: SSH2_MSG_NEWKEYS sent
2011.10.20 17:29:34 -  debug1: SSH2_MSG_KEX_DH_GEX_REPLY sent
2011.10.20 17:29:34 -  debug1: expecting SSH2_MSG_KEX_DH_GEX_INIT
2011.10.20 17:29:34 -  debug1: SSH2_MSG_KEX_DH_GEX_GROUP sent
2011.10.20 17:29:34 -  debug1: SSH2_MSG_KEX_DH_GEX_REQUEST_OLD received
2011.10.20 17:29:33 -  debug1: kex: server->client aes256-ctr hmac-sha1 none
2011.10.20 17:29:33 -  debug1: kex: client->server aes256-ctr hmac-sha1 none
2011.10.20 17:29:33 -  debug1: SSH2_MSG_KEXINIT received
2011.10.20 17:29:33 -  debug1: SSH2_MSG_KEXINIT sent
2011.10.20 17:29:33 -  debug1: list_hostkey_types: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256
2011.10.20 17:29:33 -  debug1: Local version string SSH-2.0-OpenSSH_5.8
2011.10.20 17:29:33 -  debug1: Enabling compatibility mode for protocol 2.0
2011.10.20 17:29:33 -  debug1: no match: PuTTY_Release_0.61
2011.10.20 17:29:33 -  debug1: Client protocol version 2.0; client software version PuTTY_Release_0.61
2011.10.20 17:29:33 -  Connection from 172.30.83.188 port 5789

It seems here is the issue. TC asks for keyboard-authentication instead of public-key one (see highlighted lines)

0
Comment actions Permalink

Hi Ivan,

thank you for investigating this. I debugged ssh part of git-plugin and found that when the 'Default private key'authentication is used, we take prefered authentication methods from the <user home>/.ssh/config. But when 'Private key' by the path is used, we do not look inside .ssh/config. So maybe keyboard_interactive is the the default value for PreferredAuthentications when no config is loaded.

Could you please try to change you config as follows:

Host my-server
User git
Port 4837
PreferredAuthentications publickey
IdentityFile <path to key in OpenSSH format>
StrictHostKeyChecking no

and use 'Default private key' authentication method in VCS root settings?

0
Comment actions Permalink

Still keyboard-interactive. I checked that tomcat6.exe process really opens C:\Users\idanilov\.ssh\config file and C:\Users\idanilov\.ssh\private_key.ossh private key file. The only difference is in the Host line as I have full-qualified domain name of the server there (like 'server-name.office-name.company-name.com'). Both TC server and server with SSH are in the same domain. config file has Unix-style line endings (LF only - 0x0A symbol) and Win1251 encoding (as there's only ASCII7 characters used - it is same as UTF8 except BOM which is absent).

How can I check that config is recognized and applied by TC when it is connecting to the SSH server?

0
Comment actions Permalink

Hi Ivan,

I added ssh-related debug logs in the git-plugin. Please install an attached build of plugin and enable 'debug-vcs' logging preset at 'Administration > Server Configuration > Diagnostics'. To install plugin put it into .BuildServer/plugins and restart TeamCity.



Attachment(s):
jetbrains.git.zip
0
Comment actions Permalink

When I copied zip file to d:\BuildServerConfig\ (there I have config dir) and restarted TeamCity I saw plugin in Administration -> Server Configuration -> Plugins -> External plugins:

VCS support: Git SNAPSHOT-20111024041545 JetBrains, s.r.o. <TeamCity Data Directory>\.unpacked\jetbrains.git


After Test Connection button is hit - these lines are added to logs\teamcity-vcs.log file:

[2011-10-25 18:08:19,371]  DEBUG [on=editVcsRoot ] - .vcs.git.TestConnectionCommand - Opening connection for  (C:\TeamCity\temp\git-testcon3112543782889225122, ssh://git@my-server:4837/~/test.git#master) 
[2011-10-25 18:08:20,918]  DEBUG [on=editVcsRoot ] - ggers.vcs.git.OperationContext - The error during GIT vcs operation connection test
org.eclipse.jgit.errors.NoRemoteRepositoryException: ssh://git@my-server:4837/~/test.git: not found.
     at org.eclipse.jgit.transport.BasePackConnection.noRepository(BasePackConnection.java:263)
     at org.eclipse.jgit.transport.BasePackConnection.readAdvertisedRefsImpl(BasePackConnection.java:198)
     at org.eclipse.jgit.transport.BasePackConnection.readAdvertisedRefs(BasePackConnection.java:176)
     at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:380)
     at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:104)
     at jetbrains.buildServer.buildTriggers.vcs.git.TestConnectionCommand.checkFetchConnection(TestConnectionCommand.java:87)
     at jetbrains.buildServer.buildTriggers.vcs.git.TestConnectionCommand.testConnection(TestConnectionCommand.java:65)
     at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.testConnection(GitVcsSupport.java:1071)
     at jetbrains.buildServer.controllers.admin.projects.EditVcsRootsController.doPost(EditVcsRootsController.java:196)
     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:543)
     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:9)
     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:10)
     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)
[2011-10-25 18:08:20,934]   WARN [on=editVcsRoot ] -      jetbrains.buildServer.VCS - Error occurred in test connection
jetbrains.buildServer.vcs.VcsException: Connection test failed: org.eclipse.jgit.errors.NoRemoteRepositoryException: ssh://git@my-server:4837/~/test.git: not found.
     at jetbrains.buildServer.buildTriggers.vcs.git.OperationContext.wrapException(OperationContext.java:139)
     at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.testConnection(GitVcsSupport.java:1073)
     at jetbrains.buildServer.controllers.admin.projects.EditVcsRootsController.doPost(EditVcsRootsController.java:196)
     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:543)
     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:9)
     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:10)
     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.NoRemoteRepositoryException: ssh://git@my-server:4837/~/test.git: not found.
     at org.eclipse.jgit.transport.BasePackConnection.noRepository(BasePackConnection.java:263)
     at org.eclipse.jgit.transport.BasePackConnection.readAdvertisedRefsImpl(BasePackConnection.java:198)
     at org.eclipse.jgit.transport.BasePackConnection.readAdvertisedRefs(BasePackConnection.java:176)
     at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:380)
     at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:104)
     at jetbrains.buildServer.buildTriggers.vcs.git.TestConnectionCommand.checkFetchConnection(TestConnectionCommand.java:87)
     at jetbrains.buildServer.buildTriggers.vcs.git.TestConnectionCommand.testConnection(TestConnectionCommand.java:65)
     at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.testConnection(GitVcsSupport.java:1071)
     ... 33 more
0
Comment actions Permalink

Ivan,

log should contain something like this:

[2011-10-24 16:10:59,390]  DEBUG [tor 2 {id=2354}] - eshableSshConfigSessionFactory - SSH config file /home/nd/.ssh/config
[2011-10-24 16:10:59,390]  DEBUG [tor 2 {id=2354}] - eshableSshConfigSessionFactory - Used ssh parameters:
PreferredAuthentications = gssapi-with-mic,publickey,keyboard-interactive,password
StrictHostKeyChecking = no



Also since CopSsh have some pecularities regarding its home dir, please try to use full path without '~'.
0
Comment actions Permalink

Hi Dmitry,

Sorry for the delay, I was unable to test TC for some time. Now I'm back and going to finish these problems at last :)

I tried several times and these DEBUG messages above is all what I got on Test Connection action. Could it be that plugin not reaches the place where you added ssh-related debug logs? Or maybe these messages are not written on Test Connection, only on 'real' uses?

P.S. I've tried absolute path ssh://git@my-server:4837/Temp/test.git (which corresponds to C:\Temp\test.git\ on my-server machine) without any differences.

Message was edited by: Ivan Danilov

0
Comment actions Permalink

Ivan,

I will setUp windows with CopSSH and let you know if I was able to make it work with TeamCity.

0
Comment actions Permalink

Thanks,

I was able to get things running with https://github.com/yysun/Git-Web-Access after some contributing (by the way, you may be interested in actual cause of incompatibility, see here: https://github.com/yysun/Git-Web-Access/commit/f0a0a54b102b7c022920b0522884d95567859711).

So git server is now working on IIS/ASP.NET for me, thus no need for CopSSH or SSH protocol at all.

0
Comment actions Permalink

Ivan,

for me everything works out of box. I use Win XP as a git server, CopSsh 4.2.3 is installed into c:\Program Files\CopSsh and git 1.7.9 into c:\Program Files\Git. In the CopSsh control panel I enabled user 'nd' to be able to log into this machine and imported a public part of the openssh key (id_rsa.pub) I wanted to use. After that I was able to login to this windows machine by ssh. CopSsh creates a home dir for every user you allow to use ssh, so it created c:\Program Files\CopSsh\home\nd for user 'nd'. I edited .bashrc in this directory and added a folliwing line to the end:

PATH=/cygdrive/c/Program\ Files/Git/bin:/cygdrive/c/Program\ Files/Git/libexec/git-core:${PATH}

this allows to run git command from non-login shells. I created a bare repository 'repo.git' inside the c:\Program Files\CopSsh\home\nd. After that I created a TeamCity VCS root with url <server.ip>:repo.git with "Default Private Key" authentication method and user "nd" and it works.



I believe if you repeat these steps on a clean machine everything should work.
0
Comment actions Permalink

Hi Dmitry,

Sorry for answering for an extremely old post, but it's very relevant o an issue at hand. I'm happy to create a separate thread if necessary.

Is it at all possible to force server to use native ssh? We've a custom ssh with custom, again, authentication, and while I'm able to set up the native git to work just fine (just setting GIT_SSH properly does the trick), I'm nowhere near getting the TeamCIty server to work with it — which is a bit annoying.

We use TeamCity 9.0.2.

0

Please sign in to leave a comment.