Jenkins fails with github “git clone”

后端 未结 5 728
猫巷女王i
猫巷女王i 2020-12-15 18:17

When I do build in Jenkins, it fails with this error. Any idea?

ERROR: Error cloning remote repo \'origin\' : Could not clone git@github.com:test/test.git
ER         


        
相关标签:
5条回答
  • 2020-12-15 18:39

    You need to copy your private ssh key into the .ssh folder beneath Jenkins. Something like (on Ubuntu Lucid): /var/lib/jenkins/.ssh

    0 讨论(0)
  • 2020-12-15 18:41

    Actually, I ended up with simply using https instead of ssh to clone the repository from GitHub to Jenkins.

    So instead of: git@github.com:[user]/[repository].git I used: https://github.com/[user]/[repository].git as the repository URL.

    0 讨论(0)
  • 2020-12-15 18:46

    Host key verification failed. - make sure your SSH keys are setup properly.

    http://help.github.com/linux-set-up-git/

    After you are done with that,

    ssh git@github.com
    

    should give you a welcome message ( which also says no shell access ) from GitHub

    0 讨论(0)
  • 2020-12-15 18:52

    Had the same problem, even though the ssh-keys were correctly set up.

    The issue was that on the first connection attempt, the git-server needed to be added to the known hosts file

    /.ssh/known_hosts

    . Git prompts you for this on first connect-attempt: Are you sure you want to continue connecting (yes/no)?, but Jenkins did not nor can it pass on the prompt, so it failed silently.

    We solved it by walking to our ops-guy, bringing him a nice cup of espresso, and had him do a random git-checkout, where he answered yes to said prompt :) After that, checkouts through Jenkins worked as expected.

    Found the clue here: http://www.ipsure.com/blog/2010/ssh-public-key-w-rsa-authentication-and-ssh-tunneling-part-1/

    0 讨论(0)
  • 2020-12-15 18:52

    If you still have the Host key verification failed problem I answered a similar problem with a step by step solution here :

    Jenkins & Github not using SSH Key

    0 讨论(0)
提交回复
热议问题