3
Error:
Fetching upstream changes from git@github.com:....../.........git
    ERROR: Problem fetching from origin / origin - could be unavailable. Continuing anyway
    hudson.plugins.git.GitException: Error performing command: git fetch -t git@github.com:....../......git +refs/heads/*:refs/remotes/origin/*
    Command "git fetch -t git@github.com:...../......git +refs/heads/*:refs/remotes/origin/*" returned status code 128: Host key verification failed.
    fatal: The remote end hung up unexpectedly

My comments:

  1. I found that jenkins build fails when it executes

    git fetch -t git@github.com:...../......git +refs/heads/*:refs/remotes/origin/*
    
  2. I then pasted the same command on the command line it executes it successfully, weird!

  3. Executed the following to ensure the key works:

    ssh -T git@github.com
    Hi [username]! You've successfully authenticated, but GitHub does not provide shell access.
    

    Suggested in http://help.github.com/ssh-issues/

  4. I did try to copy the generated private ssh key into the .ssh folder beneath Jenkins

    cp -rf /root/.ssh /var/lib/jenkins/.ssh
    

    and also copied the .gitconfig file into /var/lib/jenkins

    Suggested in: Jenkins fails with github "git clone"

Community
  • 1
  • 1
nab
  • 31
  • 1
  • 7
  • It's referring to the host key, not your public/private key. – robert May 23 '12 at 16:02
  • When you try it on the command line are you running as the same user that Jenkins is running under? You will need to add the host key as an allowed host for the Jenkins user. – codemonkey May 23 '12 at 16:02
  • To robert: Thanks, I will check this – nab May 24 '12 at 09:00
  • To codemonkey: Yes from Jenkins web, I am logged in as myself to run the configured build. But, I did a 'sudo' into the jenkins system to execute it at the command prompt. I will try the latter suggested and see if that resolves the issue. Many thanks. – nab May 24 '12 at 09:01
  • Fixed: The .git was owned by root while the others were owned by jenkins. A work around would be : http://happy-coding.com/jenkins-github-and-host-key-verification-failed/ – nab May 24 '12 at 10:08
  • But I did not have any intense configuration to loose in the project. So deleted it and recreated another. And this time...........I just logged into the system and **** DID NOT SUDO **** to create the git config . Instead just executed git config user.email "emailid@abc.com" and git config user.name "User name" .The jenkins build had success! – nab May 24 '12 at 10:09

1 Answers1

0

Fixed:

But I did not have any intense configuration to loose in the project. So deleted it and recreated another. And this time...........I just logged into the system and ** DID NOT SUDO ** to create the git config . Instead just executed git config user.email "emailid@abc.com" and git config user.name "User name" .The jenkins build had success!

Alternate solution: The .git was owned by root while the others were owned by jenkins. A work around would be : happy-coding.com/…

nab
  • 31
  • 1
  • 7