Jenkins - git.exe init#timeout = 10错误:克隆远程repo‘origin‘时出错hudson.plugins.git

简介: Jenkins - git.exe init#timeout = 10错误:克隆远程repo‘origin‘时出错hudson.plugins.git

用Jenkins自动化搭建测试环境,Jenkins构建任务,关键异常抓取

git.exe init#timeout = 10错误:克隆远程repo'origin'时出错hudson.plugins.git (git.exe init # timeout=10 ERROR: Error cloning remote repo 'origin' hudson.plugins.git)

具体异常抓取

运行报这个错误,前面查ip的任务可以
由用户admin启动
在远程节点testDev上构建在工作空间/root/.jenkins/workspace/TestDev中
克隆远程Git存储库
克隆存储库git@github.com:zhaoqi66/order.git
 > git.exe init /root/.jenkins/workspace/TestDev/order#timeout = 10
错误:克隆远程repo'origin'时出错
hudson.plugins.git.GitException:无法初始化/root/.jenkins/workspace/TestDev/order
在org.jenkinsci.plugins.gitclient.CliGitAPIImpl $ 5.execute(CliGitAPIImpl.java:772)
在org.jenkinsci.plugins.gitclient.CliGitAPIImpl $ 2.execute(CliGitAPIImpl.java:564)
在org.jenkinsci.plugins.gitclient.RemoteGitImpl $ CommandInvocationHandler $ 1.call(RemoteGitImpl.java:153)
在org.jenkinsci.plugins.gitclient.RemoteGitImpl $ CommandInvocationHandler $ 1.call(RemoteGitImpl.java:146)
在hudson.remoting.UserRequest.perform(UserRequest.java:212)
在hudson.remoting.UserRequest.perform(UserRequest.java:54)
在hudson.remoting.Request $ 2.run(Request.java:369)
在hudson.remoting.InterceptingExecutorService $ 1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:624)
在java.lang.Thread.run(Thread.java:748)
抑制:hudson.remoting.Channel $ CallSiteStackTrace:远程调用testDev
在hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1741)
在hudson.remoting.UserRequest $ ExceptionResponse.retrieve(UserRequest.java:357)
在hudson.remoting.Channel.call(Channel.java:955)
在org.jenkinsci.plugins.gitclient.RemoteGitImpl $ CommandInvocationHandler.execute(RemoteGitImpl.java:146)
at sun.reflect.GeneratedMethodAccessor556.invoke(未知来源)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
在org.jenkinsci.plugins.gitclient.RemoteGitImpl $ CommandInvocationHandler.invoke(RemoteGitImpl.java:132)
在com.sun.proxy。$ Proxy70.execute(未知来源)
在hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1146)
在hudson.plugins.git.GitSCM.checkout(GitSCM.java:1186)
在hudson.scm.SCM.checkout(SCM.java:504)
在hudson.model.AbstractProject.checkout(AbstractProject.java:1208)
在hudson.model.AbstractBuild $ AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
在jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
在hudson.model.AbstractBuild $ AbstractBuildExecution.run(AbstractBuild.java:499)
在hudson.model.Run.execute(Run.java:1815)
在hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
在hudson.model.ResourceController.execute(ResourceController.java:97)
在hudson.model.Executor.run(Executor.java:429)
引起:hudson.plugins.git.GitException:执行命令时出错:git.exe init /root/.jenkins/workspace/TestDev/order
在org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2009)
在org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1970)
在org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1966)
在org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1597)
在org.jenkinsci.plugins.gitclient.CliGitAPIImpl $ 5.execute(CliGitAPIImpl.java:770)
......还有11个
引起:java.io.IOException:无法运行程序“git.exe”(在目录“/root/.jenkins/workspace/TestDev/order”):error = 2,没有这样的文件或目录
在java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
在hudson.Proc $ LocalProc。<init>(Proc.java:249)
在hudson.Proc $ LocalProc。<init>(Proc.java:218)
在hudson.Launcher $ LocalLauncher.launch(Launcher.java:929)
在hudson.Launcher $ ProcStarter.start(Launcher.java:449)
在org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1998)
......还有15个
引起:java.io.IOException:error = 2,没有这样的文件或目录
at java.lang.UNIXProcess.forkAndExec(Native Method)
在java.lang.UNIXProcess。<init>(UNIXProcess.java:247)
在java.lang.ProcessImpl.start(ProcessImpl.java:134)
在java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
......还有20个
错误:克隆远程repo'origin'时出错
完成:失败

解决方案

由于我是要将项目构建在Linux的虚拟机中,所以需要在任务指定运行的节点上配置服务器上的git的运行地址。

1、查找并复制GIT中在服务器上的运行地址

which git

2、在Jenkins上,系统管理 - >节点管理 - > LinuxEvn,配置GIT中在Linux的虚拟机上的运行地址

 

 

 3、保存。再次构建就可以了

 

 

目录
相关文章
|
4月前
|
存储 Shell 开发工具
git init 执行后发生了什么?
首先在磁盘中创建一个新目录 Git,进入该目录后执行 `git init` 初始化。这个时候目录下会创建一个隐藏目录 ./git,这个./git 目录叫做 Git 版本库或者仓库
28 0
git init 执行后发生了什么?
|
3月前
|
jenkins 应用服务中间件 持续交付
Git + Jenkins 自动化 NGINX 发布简易实现
Git + Jenkins 自动化 NGINX 发布简易实现
|
3月前
|
网络安全 开发工具 git
git修改提交路径以及强制提交——异常:error: remote origin already exists.与异常:error: failed to push some refs to的解决
git修改提交路径以及强制提交——异常:error: remote origin already exists.与异常:error: failed to push some refs to的解决
21 0
|
16天前
|
jenkins 持续交付 开发工具
Jenkins 快速入门 (含Jenkins + Docker + Git 简单的自动化实操)(下)
Jenkins 快速入门 (含Jenkins + Docker + Git 简单的自动化实操)
|
16天前
|
jenkins Java 持续交付
Jenkins 快速入门 (含Jenkins + Docker + Git 简单的自动化实操)(上)
Jenkins 快速入门 (含Jenkins + Docker + Git 简单的自动化实操)
|
22天前
|
开发工具 git
完美解决git 执行git push origin master指令 报错command not found
完美解决git 执行git push origin master指令 报错command not found
29 0
|
3月前
|
开发工具 git
Git:error: remote origin already exists
Git:error: remote origin already exists
23 2
|
5月前
|
存储 jenkins 持续交付
git文件过大导致构建失败的解决方案(快速提升jenkins构建速度)
git文件过大导致构建失败的解决方案(快速提升jenkins构建速度)
67 0
|
6月前
|
开发工具 git
git push origin master提交报错解决办法
git push origin master提交报错解决办法
79 0
|
6月前
|
开发工具 git
【Git】 git push origin master Everything up-to-date报错
【Git】 git push origin master Everything up-to-date报错