2012-04-15 84 views
1

我正在爲一個Rails 3.2應用程序設置Jenkins。我添加了Github插件併爲服務器上的本地「jenkins」用戶設置了密鑰。我可以從服務器上的命令行克隆克隆就好了,所以我知道密鑰的工作。當我建立,它不能克隆回購..Jenkins構建失敗,因爲無法克隆git repo

Started by user anonymous 
Building in workspace /var/lib/jenkins/jobs/meeteor/workspace 
Checkout:workspace//var/lib/jenkins/jobs/meeteor/workspace - [email protected] 
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) 

任何想法?

+0

我解決了它。必須處理我輸入的git網址的格式。 – user577808 2012-04-15 18:10:26

+4

請考慮[正式回答你的問題](http://meta.stackexchange.com/questions/17845/etiquette-for-answering-your-own-question)。 – 2012-04-15 20:09:59

回答

2

錯誤似乎是:主機密鑰驗證失敗。你應該登錄到您的詹金斯主機作爲詹金斯用戶和運行:

SSH [email protected]

然後回答是大約主機密鑰的提示。或者,您可以將「StrictHostKeyChecking no」添加到〜jenkins/.ssh/config。

+0

「StrictHostKeyChecking no」修復了我的問題。 – 2016-11-21 14:31:31