1

I'm trying to connect to a Stash repo from a Jenkins container (RHEL7). The connection appears to authenticate successfully however fails shortly afterward.

 Connection established.
debug1: identity file /var/jenkins_home/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /var/jenkins_home/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /var/jenkins_home/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /var/jenkins_home/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /var/jenkins_home/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /var/jenkins_home/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /var/jenkins_home/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /var/jenkins_home/.ssh/id_ed25519-cert type -1

debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: RSA 61:51:41:02:d0:fb:b7:42:2a:c9:37:85:1b:5f:44:97
debug1: Host 'mystash.com' is known and matches the RSA host key.
debug1: Found key in /var/jenkins_home/.ssh/known_hosts:35
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /var/jenkins_home/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: Authentication succeeded (publickey).
Authenticated to mystash.com ([10.xxx.xxx.xxx]:22).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = C.UTF-8
shell request failed on channel 0

When I attempt a GIT pull through one of my Jenkins Jobs I receive the following messages indicating an issue with my public/private key however I have been unable test this further through the container due to above issue.

ERROR: Error cloning remote repo 'origin'
returned status code 128:

Any help would be greatly appreciated.

cdugga
  • 3,731
  • 15
  • 76
  • 120
  • Looks like your issue is coming from jenkins not having the right path to git exec: see https://stackoverflow.com/q/29301729/2123530, https://stackoverflow.com/q/41268071/2123530, ... – β.εηοιτ.βε May 26 '17 at 12:25

2 Answers2

0

the following messages indicating an issue with my public/private key

It is not an issue with your key. If it would, you would not see the following:

Authenticated to mystash.com ([10.xxx.xxx.xxx]:22).

It is a problem with the server configuration. The server log or configuration information can be more helpful.

Jakuje
  • 20,643
  • 11
  • 53
  • 62
0

Today i stuck into the same error message:

i want to clone a bitbucket repository in a new local vagrant maschine via

git glone git@git.servername.com/project/myrepo.git

and just stuck a timeout message

testing the ssh connection

ssh -T git@git.servername.com 

shows the error: request failed on channel 0

Reason/Solution in my case: someone had deleted the (unsed) default branch "master" . Correcting the "default" branch in bitbucket helped in my case ..