Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hudson git clone error

Tags:

git

clone

hudson

I have created free-style software project in Hudson.

I want to clone a public Git repository: 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.

I have tried to clone the repository to .hudson\jobs\watir\workspace from command line, and it works fine:

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.

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. But in that case, git version would not run from Hudson, right?

Environment:

  • Microsoft Windows Server 2003 R2, Standard Edition, Service Pack 2
  • java 1.6.0_14
  • Hudson 1.316
  • Hudson GIT plugin 0.7.3
  • git 1.6.3.2.1299.gee46c
like image 720
Željko Filipin Avatar asked Jul 24 '09 12:07

Željko Filipin


People also ask

How do I fix error cloning remote repo origin?

I resolved it by correctly configuring the Git.exe location on my windows slave agent. Under Node properties -> tool locations-> Specify the correct path of your Git.exe (In case you don't know the location of git on your machine,run "where git" command) -> save.

What are Git cloners?

git clone is primarily used to point to an existing repo and make a clone or copy of that repo at in a new directory, at another location. The original repository can be located on the local filesystem or on remote machine accessible supported protocols. The git clone command copies an existing Git repository.


2 Answers

Looks like hudson git plugin remote windows slave clone post was right. When I go to Manage Hudson > Configure System, in Git > Git executable section, there is error 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.

like image 57
Željko Filipin Avatar answered Sep 22 '22 07:09

Željko Filipin


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. 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.

like image 45
Guildencrantz Avatar answered Sep 23 '22 07:09

Guildencrantz