JENKINS 克隆远程存储库“来源”时出错引起原因:java.io.IOException:无法运行程序“C:\Program Files\Git\bin\git.exe”
我正在尝试从 GitLab 存储库在 Jenkins 上运行 Selenium 测试用例。我让它在 RHEL VM 上运行,并尝试在 Windows 上构建它。但是我无法使构建成功。 Jenkins 显然首先未能从 GitLab 获取存储库,我留下了这样的控制台输出:
13:13:13 Cloning the remote Git repository
13:13:13 Cloning repository https://gitlab.user.com/user/testing.git
13:13:13 > C:\Program Files\Git\bin\git.exe init C:\jenkins\workspace\Testing # timeout=10
13:13:13 ERROR: Error cloning remote repo 'origin'
13:13:13 hudson.plugins.git.GitException: Could not init C:\jenkins\workspace\Testing
13:13:13 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$5.execute(CliGitAPIImpl.java:1048)
13:13:13 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:803)
13:13:13 at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$GitCommandMasterToSlaveCallable.call(RemoteGitImpl.java:160)
13:13:13 at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$GitCommandMasterToSlaveCallable.call(RemoteGitImpl.java:153)
13:13:13 at hudson.remoting.UserRequest.perform(UserRequest.java:211)
13:13:13 at hudson.remoting.UserRequest.perform(UserRequest.java:54)
13:13:13 at hudson.remoting.Request$2.run(Request.java:376)
13:13:13 at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
13:13:13 at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
13:13:13 at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
13:13:13 at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
13:13:13 at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:122)
13:13:13 at java.base/java.lang.Thread.run(Thread.java:834)
13:13:13 Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from 10.172.0.74/10.172.0.74:57192
13:13:13 at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1795)
13:13:13 at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
13:13:13 at hudson.remoting.Channel.call(Channel.java:1001)
13:13:13 at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:145)
13:13:13 at jdk.internal.reflect.GeneratedMethodAccessor2125.invoke(Unknown Source)
13:13:13 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
13:13:13 at java.base/java.lang.reflect.Method.invoke(Method.java:566)
13:13:13 at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:131)
13:13:13 at com.sun.proxy.$Proxy96.execute(Unknown Source)
13:13:13 at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1224)
13:13:13 at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1302)
13:13:13 at hudson.scm.SCM.checkout(SCM.java:505)
13:13:13 at hudson.model.AbstractProject.checkout(AbstractProject.java:1213)
13:13:13 at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:637)
13:13:13 at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:85)
13:13:13 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:509)
13:13:13 at hudson.model.Run.execute(Run.java:1888)
13:13:13 at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
13:13:13 at hudson.model.ResourceController.execute(ResourceController.java:99)
13:13:13 at hudson.model.Executor.run(Executor.java:431)
13:13:13 Caused by: hudson.plugins.git.GitException: Error performing git command: C:\Program Files\Git\bin\git.exe init C:\jenkins\workspace\Testing
13:13:13 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2689)
13:13:13 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2611)
13:13:13 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2607)
13:13:13 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1974)
13:13:13 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$5.execute(CliGitAPIImpl.java:1046)
13:13:13 ... 12 more
13:13:13 Caused by: java.io.IOException: Cannot run program "C:\Program Files\Git\bin\git.exe" (in directory "C:\jenkins\workspace\Testing"): CreateProcess error=2, The system cannot find the file specified
13:13:13 at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1128)
13:13:13 at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071)
13:13:13 at hudson.Proc$LocalProc.<init>(Proc.java:252)
13:13:13 at hudson.Proc$LocalProc.<init>(Proc.java:221)
13:13:13 at hudson.Launcher$LocalLauncher.launch(Launcher.java:995)
13:13:13 at hudson.Launcher$ProcStarter.start(Launcher.java:507)
13:13:13 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2674)
13:13:13 ... 16 more
13:13:13 Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
13:13:13 at java.base/java.lang.ProcessImpl.create(Native Method)
13:13:13 at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:487)
13:13:13 at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:154)
13:13:13 at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1107)
13:13:13 ... 22 more
13:13:13 ERROR: Error cloning remote repo 'origin'
13:13:13 Finished: FAILURE
根据本网站上类似帖子的建议,我已将 Jenkins Shell 路径设置为我的 Windows 计算机上的 git.exe 。但我无法克服这个错误。有人可以指出我正确的方向来解决这个问题吗?如果需要任何进一步的信息,请告诉我,感谢您的阅读。
I am trying to run Selenium test cases onto Jenkins from a GitLab repo. I made it work on a RHEL VM and am attempting to construct this on Windows. However I am unable to get the builds to be successful. Jenkins apparently fails to get the repo from GitLab in the first place and I am left with a console output like this:
13:13:13 Cloning the remote Git repository
13:13:13 Cloning repository https://gitlab.user.com/user/testing.git
13:13:13 > C:\Program Files\Git\bin\git.exe init C:\jenkins\workspace\Testing # timeout=10
13:13:13 ERROR: Error cloning remote repo 'origin'
13:13:13 hudson.plugins.git.GitException: Could not init C:\jenkins\workspace\Testing
13:13:13 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$5.execute(CliGitAPIImpl.java:1048)
13:13:13 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:803)
13:13:13 at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$GitCommandMasterToSlaveCallable.call(RemoteGitImpl.java:160)
13:13:13 at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$GitCommandMasterToSlaveCallable.call(RemoteGitImpl.java:153)
13:13:13 at hudson.remoting.UserRequest.perform(UserRequest.java:211)
13:13:13 at hudson.remoting.UserRequest.perform(UserRequest.java:54)
13:13:13 at hudson.remoting.Request$2.run(Request.java:376)
13:13:13 at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
13:13:13 at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
13:13:13 at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
13:13:13 at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
13:13:13 at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:122)
13:13:13 at java.base/java.lang.Thread.run(Thread.java:834)
13:13:13 Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from 10.172.0.74/10.172.0.74:57192
13:13:13 at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1795)
13:13:13 at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
13:13:13 at hudson.remoting.Channel.call(Channel.java:1001)
13:13:13 at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:145)
13:13:13 at jdk.internal.reflect.GeneratedMethodAccessor2125.invoke(Unknown Source)
13:13:13 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
13:13:13 at java.base/java.lang.reflect.Method.invoke(Method.java:566)
13:13:13 at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:131)
13:13:13 at com.sun.proxy.$Proxy96.execute(Unknown Source)
13:13:13 at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1224)
13:13:13 at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1302)
13:13:13 at hudson.scm.SCM.checkout(SCM.java:505)
13:13:13 at hudson.model.AbstractProject.checkout(AbstractProject.java:1213)
13:13:13 at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:637)
13:13:13 at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:85)
13:13:13 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:509)
13:13:13 at hudson.model.Run.execute(Run.java:1888)
13:13:13 at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
13:13:13 at hudson.model.ResourceController.execute(ResourceController.java:99)
13:13:13 at hudson.model.Executor.run(Executor.java:431)
13:13:13 Caused by: hudson.plugins.git.GitException: Error performing git command: C:\Program Files\Git\bin\git.exe init C:\jenkins\workspace\Testing
13:13:13 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2689)
13:13:13 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2611)
13:13:13 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2607)
13:13:13 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1974)
13:13:13 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$5.execute(CliGitAPIImpl.java:1046)
13:13:13 ... 12 more
13:13:13 Caused by: java.io.IOException: Cannot run program "C:\Program Files\Git\bin\git.exe" (in directory "C:\jenkins\workspace\Testing"): CreateProcess error=2, The system cannot find the file specified
13:13:13 at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1128)
13:13:13 at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071)
13:13:13 at hudson.Proc$LocalProc.<init>(Proc.java:252)
13:13:13 at hudson.Proc$LocalProc.<init>(Proc.java:221)
13:13:13 at hudson.Launcher$LocalLauncher.launch(Launcher.java:995)
13:13:13 at hudson.Launcher$ProcStarter.start(Launcher.java:507)
13:13:13 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2674)
13:13:13 ... 16 more
13:13:13 Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
13:13:13 at java.base/java.lang.ProcessImpl.create(Native Method)
13:13:13 at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:487)
13:13:13 at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:154)
13:13:13 at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1107)
13:13:13 ... 22 more
13:13:13 ERROR: Error cloning remote repo 'origin'
13:13:13 Finished: FAILURE
On following advice from similar posts on this site, I had set the Jenkins Shell path to the git.exe on my Windows machine. But I am unable to get past this error. Can someone point me in the right direction to fix this? Let me know if any further information is required, and thanks for reading.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论