Jenkins complains about host key validation error, although the key was generated

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:

  • I found that the jenkins build fails with execution

    git fetch -t git@github.com:...../......git +refs/heads/*:refs/remotes/origin/*
    
  • Then I inserted the same command on the command line that it successfully runs it, strange!

  • To ensure the operation of the key, the following was done:

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

    Available at http://help.github.com/ssh-issues/

  • I tried to copy the generated ssh private key to the .ssh folder under Jenkins

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

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

    Suggested in: Jenkins fails with github "git clone"

+3
source share
1 answer

Fixed:

, . . ........... ** DID NOT SUDO **, git. git config user.email "emailid@abc.com" git config user.name " ". jenkins !

:.git root, . : happy-coding.com/...

0

All Articles