Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-16523

Git plugin fails with NullPointerException (Error trying to determine the git version: Error performing command: --version)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • git-plugin
    • None
    • git version 1.7.9.5
      git plugin version 1.1.26
      jenkins version 1.500

      Suddenly, the git plugin stopped to work. It issues the following error message:

      Error trying to determine the git version: Error performing command: --version

      Full stack trace:

      ERROR: Error cloning remote repo 'origin' : Could not clone ssh://<URL>
      hudson.plugins.git.GitException: Could not clone ssh://<URL>
      	at hudson.plugins.git.GitAPI.clone(GitAPI.java:273)
      	at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1044)
      	at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:986)
      	at hudson.FilePath.act(FilePath.java:865)
      	at hudson.FilePath.act(FilePath.java:838)
      	at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:986)
      	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1142)
      	at hudson.model.AbstractProject.checkout(AbstractProject.java:1331)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:682)
      	at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:587)
      	at hudson.model.Run.execute(Run.java:1557)
      	at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:477)
      	at hudson.model.ResourceController.execute(ResourceController.java:88)
      	at hudson.model.Executor.run(Executor.java:236)
      Caused by: hudson.plugins.git.GitException: Error performing command:  clone -o origin ssh://<URL> /var/lib/jenkins/jobs/<project>/workspace
      	at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:904)
      	at hudson.plugins.git.GitAPI.access$000(GitAPI.java:42)
      	at hudson.plugins.git.GitAPI$1.invoke(GitAPI.java:269)
      	at hudson.plugins.git.GitAPI$1.invoke(GitAPI.java:248)
      	at hudson.FilePath.act(FilePath.java:865)
      	at hudson.FilePath.act(FilePath.java:838)
      	at hudson.plugins.git.GitAPI.clone(GitAPI.java:248)
      	... 14 more
      Caused by: java.lang.NullPointerException
      	at hudson.Launcher.printCommandLine(Launcher.java:607)
      	at hudson.Launcher.maskedPrintCommandLine(Launcher.java:629)
      	at hudson.Launcher$LocalLauncher.launch(Launcher.java:754)
      	at hudson.Launcher$ProcStarter.start(Launcher.java:353)
      	at hudson.Launcher$ProcStarter.join(Launcher.java:360)
      	at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:885)
      	... 20 more
      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:1056)
      	at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:986)
      	at hudson.FilePath.act(FilePath.java:865)
      	at hudson.FilePath.act(FilePath.java:838)
      	at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:986)
      	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1142)
      	at hudson.model.AbstractProject.checkout(AbstractProject.java:1331)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:682)
      	at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:587)
      	at hudson.model.Run.execute(Run.java:1557)
      	at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:477)
      	at hudson.model.ResourceController.execute(ResourceController.java:88)
      	at hudson.model.Executor.run(Executor.java:236)
      

      As system user jenkins (which runs Jenkins) I am perfectly able to run that command:

      $ git --version
      git version 1.7.9.5
      

      Cloning worked before, but all of a sudden the above error occurs.

      I tried both to specify the full path to the git executable (/usr/bin/git) and to specify the name of the executable only (without path: git). However, without success.

            ndeloof Nicolas De Loof
            mburger Martin Burger
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: