You probably have a problem with your PATH when running in Jenkins Jeff Le 12 juin 2012 05:15, "MigrateFish" <[email protected]> a écrit :
> 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:// > [email protected]:29418/udwproject.git > ERROR: Cause: Error performing git clone -o origin ssh:// > [email protected]: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<http://[email protected]: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://[email protected]:29418/udwproject.git > /home/work/qa/ci/workspace/****UDW_META_GERRIT > ERROR: Error cloning remote repo 'origin' : Could not clone > ssh://[email protected]:29418/udwproject.gitERROR > <http://grepcode.com/search?query=ERROR>: Cause: Error performing > /usr/local/bin/git clone -o origin > ssh://[email protected]: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 > <http://[email protected]:29418/udwproject.git> > /home/work/qa/ci/workspace/UDW_META_GERRIT ? It is "hudson" or the role who > installed jenkins? > >
