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

NPE if 'Global Config user.{name,email} Value' are not set

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: git-plugin
    • Labels:
      None
    • Environment:
      Linux vm86.gsc.wustl.edu 2.6.32-21-server #32-Ubuntu SMP Fri Apr 16 09:17:34 UTC 2010 x86_64 GNU/Linux
      Jenkins v1.411
      Jenkins Git v1.1.8
    • Similar Issues:

      Description

      If 'Global Config user.name Value' and/or 'Global Config user.email Value' are not set in the Jenkins configuration then the following error occurs when Jenkins Git tries to checkout a repo:

      Started by user anonymous
      Building on master
      Checkout:workspace / /var/lib/jenkins/jobs/1_Genome_1_Poll_for_Changes/workspace - hudson.remoting.LocalChannel@7c6b3d66
      Using strategy: Default
      Last Built Revision: Revision b41bc2430e83c6eb2f1977961868bd716d81834d (origin/master)
      FATAL: null
      java.lang.NullPointerException
      	at hudson.plugins.git.GitSCM.getGitConfigNameToUse(GitSCM.java:320)
      	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:787)
      	at hudson.model.AbstractProject.checkout(AbstractProject.java:1181)
      	at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:536)
      	at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:424)
      	at hudson.model.Run.run(Run.java:1374)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      	at hudson.model.ResourceController.execute(ResourceController.java:88)
      	at hudson.model.Executor.run(Executor.java:145)

      It seems like these values should be collected from the Git's config:

      $ git config --global -l
      user.name=APipe Tester
      user.email=apipe-tester@genome.wustl.edu

      Or at the very least not crash if they are not filled in.

      This issue occurred after a Jenkins deb upgrade and upgrade of plugins.

        Attachments

          Activity

          Hide
          abayer Andrew Bayer added a comment -

          I'm still having trouble reproducing this, which is, well, weird. Will keep diving in.

          Show
          abayer Andrew Bayer added a comment - I'm still having trouble reproducing this, which is, well, weird. Will keep diving in.
          Hide
          abayer Andrew Bayer added a comment -

          Ah-ha, finally got it to happen. Now I'll figure out a fix. =)

          Show
          abayer Andrew Bayer added a comment - Ah-ha, finally got it to happen. Now I'll figure out a fix. =)
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Andrew Bayer
          Path:
          src/main/java/hudson/plugins/git/GitSCM.java
          http://jenkins-ci.org/commit/git-plugin/89e610b7457d0f34e127e9d94f2af1202babf206
          Log:
          [FIXED JENKINS-9702] Misuse of hudson.Util.fixEmptyAndTrim was causing NPEs.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: src/main/java/hudson/plugins/git/GitSCM.java http://jenkins-ci.org/commit/git-plugin/89e610b7457d0f34e127e9d94f2af1202babf206 Log: [FIXED JENKINS-9702] Misuse of hudson.Util.fixEmptyAndTrim was causing NPEs.
          Hide
          dogfood dogfood added a comment -

          Integrated in plugins_git-plugin #131
          [FIXED JENKINS-9702] Misuse of hudson.Util.fixEmptyAndTrim was causing NPEs.

          Andrew Bayer : 89e610b7457d0f34e127e9d94f2af1202babf206
          Files :

          • src/main/java/hudson/plugins/git/GitSCM.java
          Show
          dogfood dogfood added a comment - Integrated in plugins_git-plugin #131 [FIXED JENKINS-9702] Misuse of hudson.Util.fixEmptyAndTrim was causing NPEs. Andrew Bayer : 89e610b7457d0f34e127e9d94f2af1202babf206 Files : src/main/java/hudson/plugins/git/GitSCM.java
          Hide
          abayer Andrew Bayer added a comment -

          So yeah, I fixed it. It'll be in 1.1.9, which I think I'm going to push out today.

          Show
          abayer Andrew Bayer added a comment - So yeah, I fixed it. It'll be in 1.1.9, which I think I'm going to push out today.

            People

            • Assignee:
              abayer Andrew Bayer
              Reporter:
              nnutter Nathan Nutter
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: