Jenkins构建失败,因为无法克隆git repo

时间:2012-04-15 17:43:33

标签: git jenkins jenkins-plugins

我正在为一个Rails 3.2应用程序设置Jenkins。我添加了Github插件并为服务器上的本地“jenkins”用户设置了密钥。我可以从服务器上的命令行git克隆就好了,所以我知道键工作。当我构建时,它无法克隆回购..

    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)

有什么想法吗?

1 个答案:

答案 0 :(得分:2)

错误似乎是:主机密钥验证失败。您应该以Jenkins用户身份登录Jenkins主机并运行:

  

ssh git@github.com

然后对有关主机密钥的提示回答“是”。或者你可以在~jenkins / .ssh / config中添加“StrictHostKeyChecking no”。