-1

Friends, i keep getting the following error in Jenkins console.

"Failed to connect to repository : Command "git -c core.askpass=true ls-remote -h ssh://yyyyyyyy@gerrit.xxxxxxxx.com:29418/mobile HEAD" returned status code 128:
stdout: 
stderr: Host key verification failed. 
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists."

Tried all the options on the web. Nothing worked. Appreciate your help here

Complete Log Here

Building in workspace /Users/Shared/Jenkins/GIT
Cloning the remote Git repository
Cloning repository ssh://yyyyy@gerrit.xxxxxxxx.com:29418/mobile
 > git init /Users/Shared/Jenkins/GIT # timeout=10
Fetching upstream changes from ssh://yyyyy@gerrit.xxxxxxxx.com:29418/mobile
 > git --version # timeout=10
 > git -c core.askpass=true fetch --tags --progress ssh://yyyyyyy@gerrit.xxxxxxxxx.com:29418/mobile +refs/heads/*:refs/remotes/origin/*
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Command "git -c core.askpass=true fetch --tags --progress ssh://yyyyyy@gerrit.xxxxxxxxx.com:29418/mobile +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout: 
stderr: Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Thanks, Madhav

Bruno Lavit
  • 9,486
  • 2
  • 27
  • 37

1 Answers1

2

I think it's a permissions problem on your .ssh folder or your id_rsa* files.

Please have a look to this article to set the correct permissions: https://superuser.com/questions/215504/permissions-on-private-key-in-ssh-folder

The .ssh folder should exist in the home folder of your jenkins user (something like /home/jenkins or /var/lib/jenkins).

The permissions should be:

  • .ssh folder: 700 (drwx------)
  • public key (.pub): 644 (-rw-r--r--)
  • private key (id_rsa): 600 (-rw-------)

Please confirm it fixed your issue :)

Community
  • 1
  • 1
Bruno Lavit
  • 9,486
  • 2
  • 27
  • 37