Did you install to the home of the user running Jenkins?

Sent from my Windows Phone
------------------------------
From: Kurt Granroth
Sent: 6/29/2012 10:44 AM
To: jenkinsci-users@googlegroups.com
Subject: Git clone fails with NPE and 'missing' exe

I am unable to perform a git clone using a Jenkins instance for which I
have no root access.  The symptom at this point is that the Git plugin is
running the clone command with an empty or NULL 'git' exe.

Here's some more details.  I started out by enabling the Git plugin on the
assumption that it implemented the Git protocol internally.  It does not,
but instead calls the 'git' executable installed on the Jenkins box.  Fair
enough.  I don't have root access to the box, so I cannot install git into
/usr/bin and instead installed it into $HOME/local-git.  I then updated the
path of the git exe in the config interface to use
/home/jenkins/local-git/bin/git.

Since then, all builds fail at the 'clone stage' with this (truncated):

ERROR: Error cloning remote repo 'origin' : Could not clone
git://gitrepo/test-repohudson.plugins.git.GitException
<http://stacktrace.jenkins-ci.org/search?query=hudson.plugins.git.GitException>:
Could not clone git://gitrepo/test-repo
        at hudson.plugins.git.GitAPI.clone(GitAPI.java:251)
<http://stacktrace.jenkins-ci.org/search/?query=hudson.plugins.git.GitAPI.clone&entity=method>
        at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1121)
<http://stacktrace.jenkins-ci.org/search/?query=hudson.plugins.git.GitSCM$2.invoke&entity=method>
        at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1063)
<http://stacktrace.jenkins-ci.org/search/?query=hudson.plugins.git.GitSCM$2.invoke&entity=method>
        at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2154)
<http://stacktrace.jenkins-ci.org/search/?query=hudson.FilePath$FileCallableWrapper.call&entity=method>
        at hudson.remoting.UserRequest.perform(UserRequest.java:118)
<http://stacktrace.jenkins-ci.org/search/?query=hudson.remoting.UserRequest.perform&entity=method>
        at hudson.remoting.UserRequest.perform(UserRequest.java:48)
<http://stacktrace.jenkins-ci.org/search/?query=hudson.remoting.UserRequest.perform&entity=method>
        at hudson.remoting.Request$2.run(Request.java:287)
<http://stacktrace.jenkins-ci.org/search/?query=hudson.remoting.Request$2.run&entity=method>
        at 
hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
<http://stacktrace.jenkins-ci.org/search/?query=hudson.remoting.InterceptingExecutorService$1.call&entity=method>
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
<http://stacktrace.jenkins-ci.org/search/?query=java.util.concurrent.FutureTask$Sync.innerRun&entity=method>
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
<http://stacktrace.jenkins-ci.org/search/?query=java.util.concurrent.FutureTask.run&entity=method>
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
<http://stacktrace.jenkins-ci.org/search/?query=java.util.concurrent.ThreadPoolExecutor$Worker.runTask&entity=method>
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
<http://stacktrace.jenkins-ci.org/search/?query=java.util.concurrent.ThreadPoolExecutor$Worker.run&entity=method>
        at java.lang.Thread.run(Thread.java:662)
<http://stacktrace.jenkins-ci.org/search/?query=java.lang.Thread.run&entity=method>
Caused by: hudson.plugins.git.GitException
<http://stacktrace.jenkins-ci.org/search?query=hudson.plugins.git.GitException>:
Error performing command:  clone -o origin git://gitrepo/test-repo
/home/jenkins/workspace/TEST - Git Repo
        at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:793)
<http://stacktrace.jenkins-ci.org/search/?query=hudson.plugins.git.GitAPI.launchCommandIn&entity=method>
        at hudson.plugins.git.GitAPI.access$000(GitAPI.java:39)
<http://stacktrace.jenkins-ci.org/search/?query=hudson.plugins.git.GitAPI.access$000&entity=method>
        at hudson.plugins.git.GitAPI$1.invoke(GitAPI.java:247)
<http://stacktrace.jenkins-ci.org/search/?query=hudson.plugins.git.GitAPI$1.invoke&entity=method>
        at hudson.plugins.git.GitAPI$1.invoke(GitAPI.java:227)
<http://stacktrace.jenkins-ci.org/search/?query=hudson.plugins.git.GitAPI$1.invoke&entity=method>
        at hudson.FilePath.act(FilePath.java:832)
<http://stacktrace.jenkins-ci.org/search/?query=hudson.FilePath.act&entity=method>
        at hudson.FilePath.act(FilePath.java:814)
<http://stacktrace.jenkins-ci.org/search/?query=hudson.FilePath.act&entity=method>
        at hudson.plugins.git.GitAPI.clone(GitAPI.java:227)
<http://stacktrace.jenkins-ci.org/search/?query=hudson.plugins.git.GitAPI.clone&entity=method>
        ... 12 more
Caused by: java.lang.NullPointerException
<http://stacktrace.jenkins-ci.org/search?query=java.lang.NullPointerException>  
at
hudson.Launcher.printCommandLine(Launcher.java:592)
<http://stacktrace.jenkins-ci.org/search/?query=hudson.Launcher.printCommandLine&entity=method>
        at hudson.Launcher.maskedPrintCommandLine(Launcher.java:614)
<http://stacktrace.jenkins-ci.org/search/?query=hudson.Launcher.maskedPrintCommandLine&entity=method>
        at hudson.Launcher$LocalLauncher.launch(Launcher.java:700)
<http://stacktrace.jenkins-ci.org/search/?query=hudson.Launcher$LocalLauncher.launch&entity=method>
        at hudson.Launcher$ProcStarter.start(Launcher.java:338)
<http://stacktrace.jenkins-ci.org/search/?query=hudson.Launcher$ProcStarter.start&entity=method>
        at hudson.Launcher$ProcStarter.join(Launcher.java:345)
<http://stacktrace.jenkins-ci.org/search/?query=hudson.Launcher$ProcStarter.join&entity=method>
        at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:774)
<http://stacktrace.jenkins-ci.org/search/?query=hudson.plugins.git.GitAPI.launchCommandIn&entity=method>
        ... 18 more


Note the clone line after 'Error performing command.'  I would expect
it to read '/home/jenkins/local-git/bin/git clone -o origin...' but
instead, the git exe is missing!


I suspected that this may be an issue with directly specifying the
location, so I added $HOME/local-git/bin to the jenkin user's PATH and
 switched the config path back to just 'git'.  That made no
difference.  I also verified that I can perform a 'git clone' on the
command line as the Jenkins user.


This feels like it should be blindingly obvious, but I'm stumped.
What could be causing the Git plugin to use a NULL 'gitExe' during
that call?

Reply via email to