user577808
user577808

Reputation: 2527

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?

Upvotes: 1

Views: 10891

Answers (1)

AniSaw
AniSaw

Reputation: 223

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.

Upvotes: 3

Related Questions