Jenkins build fails because can't clone git repo

I’m setting up Jenkins for a Rails 3.2 app. I added the Github plugin and setup the keys for the local “jenkins” user on the server. I can git clone from the command line on the server just fine so I know the keys work. When I build, it can’t clone the repo..

    Started by user anonymous
Building in workspace /var/lib/jenkins/jobs/meeteor/workspace
Checkout:workspace / /var/lib/jenkins/jobs/meeteor/workspace - hudson.remoting.LocalChannel@59a683e6
Using strategy: Default
Cloning the remote Git repository
Cloning repository origin
ERROR: Error cloning remote repo 'origin' : Could not clone git://github.com/meeteor/webapp.git/
hudson.plugins.git.GitException: Could not clone git://github.com/meeteor/webapp.git/
    at hudson.plugins.git.GitAPI.clone(GitAPI.java:245)
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1117)
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1059)
    at hudson.FilePath.act(FilePath.java:832)
    at hudson.FilePath.act(FilePath.java:814)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1059)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1218)
    at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:581)
    at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:470)
    at hudson.model.Run.run(Run.java:1421)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:238)
Caused by: hudson.plugins.git.GitException: Command "git clone --progress -o origin git://github.com/meeteor/webapp.git/ /var/lib/jenkins/jobs/meeteor/workspace" returned status code 128:
stdout: Cloning into /var/lib/jenkins/jobs/meeteor/workspace...

stderr: fatal: The remote end hung up unexpectedly

    at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:779)
    at hudson.plugins.git.GitAPI.access$000(GitAPI.java:38)
    at hudson.plugins.git.GitAPI$1.invoke(GitAPI.java:241)
    at hudson.plugins.git.GitAPI$1.invoke(GitAPI.java:221)
    at hudson.FilePath.act(FilePath.java:832)
    at hudson.FilePath.act(FilePath.java:814)
    at hudson.plugins.git.GitAPI.clone(GitAPI.java:221)
    ... 12 more
Trying next repository
ERROR: Could not clone repository
FATAL: Could not clone
hudson.plugins.git.GitException: Could not clone
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1129)
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1059)
    at hudson.FilePath.act(FilePath.java:832)
    at hudson.FilePath.act(FilePath.java:814)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1059)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1218)
    at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:581)
    at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:470)
    at hudson.model.Run.run(Run.java:1421)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:238)

Any ideas?

  • Why does git keep deleting my folder?
  • Undo changes (commited and pushed)
  • What are the advantages of a rebase over a merge in git?
  • push local master *into* gh-pages branch on github
  • Mupdf in Android Studio
  • How to interface PHP and Git repository
  • Git, how to automatize history collapse with rebase
  • TortoiseGit: How do I temporarily switch to an earlier version
  • You have both xxx and xxx error: Error building trees git
  • Cloning Multiple Branches in GitHub for Windows
  • Multiple github repositories inside a single repository
  • Github EGit and Netbeans git: push not working
  • One Solution collect form web for “Jenkins build fails because can't clone git repo”

    The error seems to be: host key verification failed. You should log into your Jenkins host as the Jenkins user and run:

    ssh git@github.com

    Then answer yes to the prompt about the host key. Alternatively you could add “StrictHostKeyChecking no” to ~jenkins/.ssh/config.

    Git Baby is a git and github fan, let's start git clone.