Hudson git 插件无法在 Linux 上克隆存储库
好吧,我在 github 上的存储库被克隆到运行 Fedora 8 的 Hudson 服务器上时遇到了一些问题。输出是 git 遇到错误时通常的错误输出:
Started by user anonymous
Checkout:workspace / /home/tomcat/.hudson/jobs/CIExample/workspace - hudson.remoting.LocalChannel@3861e6
Using strategy: Default
Checkout:workspace / /home/tomcat/.hudson/jobs/CIExample/workspace - hudson.remoting.LocalChannel@3861e6
GitAPI created
Cloning the remote Git repository
Cloning repository origin
$ git clone -o origin https://[email protected]/mattupstate/CIExample.git /home/tomcat/.hudson/jobs/CIExample/workspace
ERROR: Error cloning remote repo 'origin' : Could not clone https://[email protected]/mattupstate/CIExample.git
ERROR: Cause: Error performing git clone -o origin https://[email protected]/mattupstate/CIExample.git /home/tomcat/.hudson/jobs/CIExample/workspace
Trying next repository
ERROR: Could not clone from a repository
FATAL: Could not clone
hudson.plugins.git.GitException: Could not clone
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:587)
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:535)
at hudson.FilePath.act(FilePath.java:753)
at hudson.FilePath.act(FilePath.java:735)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:535)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1044)
at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:479)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:411)
at hudson.model.Run.run(Run.java:1257)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:127)
The build does nothang at all like有些人报告。它立即失败。此外,如果我登录到我的盒子,切换到 tomcat 用户(运行 Tomcat 和 Hudson 的用户),然后运行此命令:
git clone -o origin https://[email protected]/mattupstate/CIExample.git /home/tomcat/.hudson/jobs/CIExample/workspace
它运行没有问题,并且存储库被克隆。我手动运行该命令遇到的唯一问题是工作区文件夹是否已经存在。当我想要克隆到的本地文件夹已经存在时,Git 不喜欢这样。我有一种感觉 Hudson 正在尝试克隆之前创建该文件夹?
任何帮助将不胜感激。
Alright, so I'm having some issues with my repo on github being cloned on my Hudson server which is running Fedora 8. The output is the usual error output when an error is encountered with git:
Started by user anonymous
Checkout:workspace / /home/tomcat/.hudson/jobs/CIExample/workspace - hudson.remoting.LocalChannel@3861e6
Using strategy: Default
Checkout:workspace / /home/tomcat/.hudson/jobs/CIExample/workspace - hudson.remoting.LocalChannel@3861e6
GitAPI created
Cloning the remote Git repository
Cloning repository origin
$ git clone -o origin https://[email protected]/mattupstate/CIExample.git /home/tomcat/.hudson/jobs/CIExample/workspace
ERROR: Error cloning remote repo 'origin' : Could not clone https://[email protected]/mattupstate/CIExample.git
ERROR: Cause: Error performing git clone -o origin https://[email protected]/mattupstate/CIExample.git /home/tomcat/.hudson/jobs/CIExample/workspace
Trying next repository
ERROR: Could not clone from a repository
FATAL: Could not clone
hudson.plugins.git.GitException: Could not clone
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:587)
at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:535)
at hudson.FilePath.act(FilePath.java:753)
at hudson.FilePath.act(FilePath.java:735)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:535)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1044)
at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:479)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:411)
at hudson.model.Run.run(Run.java:1257)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:127)
The build doesn't hang at all like some people report. It instantly fails. Additionally, if I log into my box, switch to the tomcat user (the user running Tomcat and thus Hudson), and run this command:
git clone -o origin https://[email protected]/mattupstate/CIExample.git /home/tomcat/.hudson/jobs/CIExample/workspace
It runs with no problems and the repo is cloned. The only problem I've run into running that command manually is if the workspace folder already exits. Git doesn't like it when the local folder I want to clone to already exists. I have a feeling Hudson is creating that folder before the clone is attempted?
Any help would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我在 Hudson 上的 git (v 2.2.1) 上检查项目时遇到了类似的问题。
我之前使用的是 Subversion,它那里有现有的工作区。因此,当我配置 Git 时,我选中了“构建之前清除工作区”选项,并且在 hudson 上运行构建时,它会清理现有工作区并立即失败。我尝试运行几次,结果都是一样的。
当我取消选中“构建之前清除工作区”选项时,我的下一个构建和检查都很好,没有任何问题。
有没有人用 git 在 hudson 上观察到这种行为。
I had a similar problem checking out a project from git on Hudson (v 2.2.1).
I was earlier using subversion and it had existing workspace there. so when I configured Git, I checked the option, "Wipe out workspace before build" and when running the build on hudson it cleaned that existing workspace and fails immediately. I tried to run this few times and results the same.
When I unchecked "Wipe out workspace before build" the option, my next build and check out fine without any issues.
Has anyone observed this behaviour on hudson with git.
当您的 Hudson 作业服务器执行并尝试调用 git 命令时,您是否检查您的路径?
请参阅 Git Hudson 插件 的“问题”部分。
Did you check your path when your Hudson job server execute and tries to call git commands?
See the "Gotcha" section of the Git Hudson plugin.
我无法克隆
ssh://[电子邮件受保护] /x/y.git
但可以克隆git://github.com/x/y.git
所以我猜 SSH 是问题所在。I was unable to clone
ssh://[email protected]/x/y.git
but could clonegit://github.com/x/y.git
so I guess SSH is the problem.我在 ssh:// git URL 时遇到此错误,问题是我没有安装 Hudson“SSH 插件”。
I had this error with an ssh:// git URL, and the problem was that I didn't have the Hudson "SSH Plugin" installed.