jenkins can't clone repository from git

11,654 views
Skip to first unread message

Migratefish

unread,
Jun 11, 2012, 11:59:49 PM6/11/12
to repo-d...@googlegroups.com
Hi,FYI:

   I want jenkins to fetch code from git repository to build.  When Jenkins has been installed git and gerrit plugins. I trigger Jenkins  build by hand, but following problem appears:

Log files :


Started by user anonymous
Building remotely on gerrit-hudson-CI
Checkout:UDW_META_GERRIT / /home/work/qa/ci/workspace/
UDW_META_GERRIT - hudson.remoting.Channel@93f61c:gerrit-hudson-CI
Using strategy: Gerrit Trigger
Checkout:UDW_META_GERRIT / /home/work/qa/ci/workspace/
UDW_META_GERRIT - hudson.remoting.LocalChannel@1b033c7e
GitAPI created
Cloning the remote Git repository
Cloning repository origin
$ git clone -o origin ssh://gerrit2@db-testing-dtsfs07.db01.baidu.com:29418/udwproject.git /home/work/qa/ci/workspace/
UDW_META_GERRIT
ERROR: Error cloning remote repo 'origin' : Could not clone ssh://gerrit2@db-testing-dtsfs07.db01.baidu.com:29418/udwproject.git
ERROR: Cause: Error performing git clone -o origin ssh://gerrit2@db-testing-dtsfs07.db01.baidu.com:29418/udwproject.git /home/work/qa/ci/workspace/
UDW_META_GERRIT
Cannot run program "git": java.io.IOException: error=2, No such file or directory
Trying next repository
ERROR: Could not clone repository
FATAL: Could not clone
hudson.plugins.git.
GitException: Could not clone
at hudson.plugins.git.GitSCM$2.
invoke(GitSCM.java:809)
at hudson.plugins.git.GitSCM$2.
invoke(GitSCM.java:740)
at hudson.FilePath$
FileCallableWrapper.call(FilePath.java:1899)
at hudson.remoting.UserRequest.
perform(UserRequest.java:114)
at hudson.remoting.UserRequest.
perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(
Request.java:270)
at java.util.concurrent.
Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.
FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.
FutureTask.run(FutureTask.java:138)
at java.util.concurrent.
ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.
ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.
java:662)

I run this command in terminal use root :  $git clone -o origin ssh://gerrit2@db-testing-dtsfs07.db01.baidu.com:29418/udwproject.git /home/work/qa/ci/workspace/UDW_META_GERRIT , it works fine.

Jenkins : system manager  --->  system setting ---->Git :

Name  :Default

Path ot Git executable : git 

I changed its setting :

Name  :Default

Path ot Git executable : /usr/local/bin/git 

/usr/local/bin/git  is  directory where I  installed  git ,I do installed Git,but  it failed again:

Started by user anonymous
Building remotely on gerrit-hudson-CI
Checkout:UDW_META_GERRIT / /home/work/qa/ci/workspace/UDW_META_GERRIT - hudson.remoting.Channel@93f61c:gerrit-hudson-CI
Using strategy: Gerrit Trigger
Checkout:UDW_META_GERRIT / /home/work/qa/ci/workspace/UDW_META_GERRIT - hudson.remoting.LocalChannel@1b033c7e
GitAPI created
Cloning the remote Git repository
Cloning repository origin
$ /usr/local/bin/git clone -o origin ssh://gerrit2@db-testing-dtsfs07.db01.baidu.com:29418/udwproject.git /home/work/qa/ci/workspace/UDW_META_GERRIT
ERROR: Error cloning remote repo 'origin' : Could not clone ssh://gerrit2@db-testing-dtsfs07.db01.baidu.com:29418/udwproject.git
ERROR: Cause: Error performing /usr/local/bin/git clone -o origin ssh://gerrit2@db-testing-dtsfs07.db01.baidu.com:29418/udwproject.git /home/work/qa/ci/workspace/UDW_META_GERRIT
Cannot run program "/usr/local/bin/git": java.io.IOException: error=2, No such file or directory
Trying next repository
ERROR: Could not clone repository
ould not clone
	at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:809)
	at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:740)
	at hudson.FilePath$FileCallableWrapper.call(FilePath.java:1899)
	at hudson.remoting.UserRequest.perform(UserRequest.java:114)
	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
	at hudson.remoting.Request$2.run(Request.java:270)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:662)

Can any boys tell me why? Thank you very much. By the way, when hudson running build, which role is to running command : $git clone -o origin ssh://gerrit2@db-testing-dtsfs07.db01.baidu.com:29418/udwproject.git /home/work/qa/ci/workspace/UDW_META_GERRIT ? It is "hudson" or the role who installed jenkins?

Matthias Sohn

unread,
Jun 12, 2012, 2:27:55 AM6/12/12
to Migratefish, repo-d...@googlegroups.com
2012/6/12 Migratefish <migrate...@gmail.com>

did you tell Jenkins where to find git ? Open "Manage Jenkins > Configure System", there is a configuration 
parameter "Path to Git executable" under section "Git"

--
Matthias

Migratefish

unread,
Jun 12, 2012, 2:46:49 AM6/12/12
to repo-d...@googlegroups.com, Migratefish

Thank you Matthias,   I do  have told jenkins the path of git. 

Jenkins : system manager  --->  system setting ---->Git :

Name  :Default

Path ot Git executable : git 

I changed its setting as following before get the second log :

Name  :Default

Path ot Git executable : /usr/local/bin/git 

Here is the path of git.   Any ideas?


在 2012年6月12日星期二UTC+8下午2时27分55秒,Matthias Sohn写道:
2012/6/12 Migratefish <migrate...@gmail.com>

Matthias Sohn

unread,
Jun 12, 2012, 3:26:29 AM6/12/12
to Migratefish, repo-d...@googlegroups.com
2012/6/12 Migratefish <migrate...@gmail.com>


Thank you Matthias,   I do  have told jenkins the path of git. 

Jenkins : system manager  --->  system setting ---->Git :

Name  :Default

Path ot Git executable : git 

I changed its setting as following before get the second log :

Name  :Default

Path ot Git executable : /usr/local/bin/git 

Here is the path of git.   Any ideas?

probably you have some extra space in this path entry, see

--
Matthias
Reply all
Reply to author
Forward
0 new messages