简体   繁体   English

哈德森git克隆错误

[英]Hudson git clone error

I have created free-style software project in Hudson. 我在Hudson创建了自由式软件项目。

I want to clone a public Git repository: git://github.com/bret/watir.git 我想克隆一个公共Git存储库: git://github.com/bret/watir.git

Build fails with error message: 构建失败并显示错误消息:

Started by user anonymous
Checkout:workspace / C:\Documents and Settings\Administrator\.hudson\jobs\watir\workspace - hudson.remoting.LocalChannel@1a1f370
Last Build : #4
Checkout:workspace / C:\Documents and Settings\Administrator\.hudson\jobs\watir\workspace - hudson.remoting.LocalChannel@1a1f370
Cloning the remote Git repository
Cloning repository origin
$ git clone -o origin git://github.com/bret/watir.git "C:\Documents and Settings\Administrator\.hudson\jobs\watir\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:400)
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:358)
    at hudson.FilePath.act(FilePath.java:676)
    at hudson.FilePath.act(FilePath.java:660)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:358)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:833)
    at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:314)
    at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:266)
    at hudson.model.Run.run(Run.java:948)
    at hudson.model.Build.run(Build.java:112)
    at hudson.model.ResourceController.execute(ResourceController.java:93)
    at hudson.model.Executor.run(Executor.java:118)

I do not think the problem is in folder permissions because I have another Hudson job (with SVN repository) that works just fine. 我不认为问题在于文件夹权限,因为我有另一个Hudson作业(使用SVN存储库),它可以正常工作。

I have tried to clone the repository to .hudson\\jobs\\watir\\workspace from command line, and it works fine: 我试图从命令行将存储库克隆到.hudson \\ jobs \\ watir \\ workspace,它工作正常:

C:\>git clone -o origin git://github.com/bret/watir.git "C:\Documents and Settings\Administrator\.hudson\jobs\watir\workspace"
Initialized empty Git repository in C:/Documents and Settings/Administrator/.hudson/jobs/watir/workspace/.git/
remote: Counting objects: 15203, done.
essing objects: 100% (5307/5307), done.
remote: Total 15203 (delta 10052), reused 14532 (delta 9565)
Receiving objects: 100% (15203/15203), 7.88 MiB | 144 KiB/s, done.
Resolving deltas: 100% (10052/10052), done.

As far as I can tell, Hudson used either the same Git executable or the same version of it, as command line does. 据我所知,Hudson使用相同的Git可执行文件或相同版本的命令行。

Command line: 命令行:

C:\>git version
git version 1.6.3.2.1299.gee46c

Hudson: 哈德森:

Started by user anonymous
[workspace] $ cmd /c call C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\hudson9062544454093366628.bat

C:\Documents and Settings\Administrator\.hudson\jobs\watir\workspace>git version
git version 1.6.3.2.1299.gee46c
Finished: SUCCESS

Searching the web I have found only one page related to my error message ( hudson git plugin remote windows slave clone ), and it says that the problem is Git not being in path. 在网上搜索我发现只有一个页面与我的错误信息相关( hudson git插件远程windows slave clone ),它说问题是Git不在路径中。 But in that case, git version would not run from Hudson, right? 但在那种情况下, git version不会从Hudson运行,对吧?

Environment: 环境:

  • Microsoft Windows Server 2003 R2, Standard Edition, Service Pack 2 Microsoft Windows Server 2003 R2,标准版,Service Pack 2
  • java 1.6.0_14 java 1.6.0_14
  • Hudson 1.316 哈德森1.316
  • Hudson GIT plugin 0.7.3 Hudson GIT插件0.7.3
  • git 1.6.3.2.1299.gee46c git 1.6.3.2.1299.gee46c

Looks like hudson git plugin remote windows slave clone post was right. 看起来像哈德森git插件远程Windows奴隶克隆帖是对的。 When I go to Manage Hudson > Configure System , in Git > Git executable section, there is error There's no such executable git in PATH . 当我去管理Hudson>配置系统时 ,在Git > Git executable部分,有错误There's no such executable git in PATH (If takes a few seconds for Hudson to display the error after the page is displayed.) Adding C:\\Program Files\\Git\\bin to path and restarting Hudson solved the problem. (如果显示页面后Hudson显示错误需要几秒钟。)将C:\\Program Files\\Git\\bin到路径并重新启动Hudson解决了问题。

It's worth noting that if the cloning process itself has an issue you will also see this problem. 值得注意的是,如果克隆过程本身存在问题,您也会看到此问题。 I have had issues with one of my boxes failing 4 out of 5 times on the initial clone of a large repository, and hudson kept throwing this error. 我有一个问题,我的一个盒子在一个大型存储库的初始克隆中失败了5次,并且哈德森不断抛出这个错误。 A good way to verify this is the problem, and it's not Hudson being unable to find the git executable, is to clone the repository into the Hudson workspace manually, and then run a Hudson build: if Hudson is configured properly the build will succeed and report that there are no changes. 验证这一问题的好方法是问题,并不是Hudson无法找到git可执行文件,而是手动将存储库克隆到Hudson工作区,然后运行Hudson构建:如果正确配置Hudson,构建将成功并且报告说没有变化。

我需要尝试使用ssh git@github.company.co.uk:organisation/repo.git url而不是https https://github.company.co.uk/organisation/repo.git

Git plugin 0.7.3 have some issues when used with windows absolute paths. 当与Windows绝对路径一起使用时,Git插件0.7.3有一些问题。

Try using relative paths instead. 请尝试使用相对路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM