jenkins windows slave 報錯ERROR: Error cloning remote repo 'origin'

來源:互聯網
上載者:User

標籤:lang   eve   procs   config   editor   hand   主機   lan   invoke   

在slave上是git clone ssh是可以成功的,但是jenkins調用slave節點就報如下錯誤:

ERROR: Error cloning remote repo ‘origin‘hudson.plugins.git.GitException: Could not init C:\lebo\workspace\repo1at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$5.execute(CliGitAPIImpl.java:717)at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:511)at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153)at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146)at hudson.remoting.UserRequest.perform(UserRequest.java:181)at hudson.remoting.UserRequest.perform(UserRequest.java:52)at hudson.remoting.Request$2.run(Request.java:336)at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)at java.util.concurrent.FutureTask.run(Unknown Source)at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)at hudson.remoting.Engine$1$1.run(Engine.java:98)at java.lang.Thread.run(Unknown Source)at ......remote call to JNLP4-connect connection from 192.168.8.211/192.168.8.211:49194(Native Method)at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1554)at hudson.remoting.UserResponse.retrieve(UserRequest.java:281)at hudson.remoting.Channel.call(Channel.java:839)at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:146)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:498)at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:132)at com.sun.proxy.$Proxy77.execute(Unknown Source)at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1083)at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1123)at hudson.scm.SCM.checkout(SCM.java:495)at hudson.model.AbstractProject.checkout(AbstractProject.java:1212)at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:560)at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:485)at hudson.model.Run.execute(Run.java:1735)at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)at hudson.model.ResourceController.execute(ResourceController.java:97)at hudson.model.Executor.run(Executor.java:415)Caused by: hudson.plugins.git.GitException: Error performing command: git init C:\lebo\workspace\repo1at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1931)at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1892)at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1888)at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1533)at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$5.execute(CliGitAPIImpl.java:715)at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:511)at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153)at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146)at hudson.remoting.UserRequest.perform(UserRequest.java:181)at hudson.remoting.UserRequest.perform(UserRequest.java:52)at hudson.remoting.Request$2.run(Request.java:336)at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)at java.util.concurrent.FutureTask.run(Unknown Source)at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)at hudson.remoting.Engine$1$1.run(Engine.java:98)at java.lang.Thread.run(Unknown Source)Caused by: java.io.IOException: Cannot run program "git" (in directory "C:\lebo\workspace\repo1"): CreateProcess error=2, 系統找不到指定的檔案。at java.lang.ProcessBuilder.start(Unknown Source)at hudson.Proc$LocalProc.<init>(Proc.java:249)at hudson.Proc$LocalProc.<init>(Proc.java:218)at hudson.Launcher$LocalLauncher.launch(Launcher.java:930)at hudson.Launcher$ProcStarter.start(Launcher.java:450)at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1920)... 16 moreCaused by: java.io.IOException: CreateProcess error=2, 系統找不到指定的檔案。at java.lang.ProcessImpl.create(Native Method)at java.lang.ProcessImpl.<init>(Unknown Source)at java.lang.ProcessImpl.start(Unknown Source)... 22 moreERROR: Error cloning remote repo ‘origin‘Finished: FAILURE


解決:需要在jenkins master上設定Tool Location,如下:

此外:首次下載,需要slave設定ssh-key 到gerrit上,並需要clone一次,選擇主機信任。

1.ssh-keygen -t rsa -C [email protected]

2.cat ~/.ssh/id_rsa.pub

3.git config --global user.email "[email protected]"

4.git config --global user.name "anl"

5.git config --global core.editor vim

6.git clone ssh:xxxxxxx


jenkins windows slave 報錯ERROR: Error cloning remote repo 'origin'

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.