我们有一个遗留项目必须在Windows XP机器上构建,所以我们将它设置为Jenkins奴隶。我们相信我们已经正确设置了环境,因为我们可以在该XP机器上的Git Bash和Dos命令窗口中成功运行“Git Pull”。但是,当尝试从Jenkins运行构建作业时,它总是在Git Pull commnand上失败。
我们尝试过以两种不同的方式运行Git Pull :(出于安全考虑,我用XXXXX
覆盖了一些路径或服务器名称)
1 /在dos批处理文件中运行“Git Pull”,当调用该批处理时,我们在构建控制台输出中收到错误消息,如:
C:\sXXXXXX\cXXXXXX\gXXXXX>git checkout .
C:\sXXXXXX\cXXXXXX\gXXXXX>git pull -v ssh://oXXXXXX@sXXXXX/git/cXXXXX/gXXXXX.git
fatal: The remote end hung up unexpectedly
2 /在Jenkins中使用Git插件,我们收到如下错误消息:
Building remotely on buildbox1 in workspace C:\sXXXXX\cXXXX\gXXXXX
Checkout:gXXXXX / C:\sXXXXX\cXXXX\gXXXXX - hudson.remoting.Channel@62452c45:buildbox1
Using strategy: Default
Fetching changes from 1 remote Git repository
Fetching upstream changes from ssh://oXXXXXX@sXXXXX/git/cXXXXX/gXXXXX.git
ERROR: Problem fetching from origin / origin - could be unavailable. Continuing anyway
hudson.plugins.git.GitException: Command ""C:\Program Files\Git\bin\git.exe" fetch -t ssh://oXXXXXX@sXXXXXX/git/cXXXXX/gXXXXX.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout:
stderr: fatal: The remote end hung up unexpectedly
at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:863)
at hudson.plugins.git.GitAPI.launchCommand(GitAPI.java:824)
at hudson.plugins.git.GitAPI.fetch(GitAPI.java:198)
at hudson.plugins.git.GitAPI.fetch(GitAPI.java:1071)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:810)
at hudson.plugins.git.GitSCM.access$100(GitSCM.java:76)
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1076)
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1044)
at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2273)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:326)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
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:60)
at java.lang.Thread.run(Unknown Source)
ERROR: Could not fetch from any repository
FATAL: Could not fetch from any repository
hudson.plugins.git.GitException: Could not fetch from any repository
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1083)
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1044)
at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2273)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:326)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
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:60)
at java.lang.Thread.run(Unknown Source)
任何人都可以提供帮助,我们将不胜感激。
答案 0 :(得分:0)
确保您的Jenkins从属代理确实具有HOME
环境变量设置(创建一个只有echo %HOME%
的简单工作):它需要它来查找您的公钥和私钥。