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

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

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • git-plugin
    • None
    • 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

      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.

          [JENKINS-9702] NPE if 'Global Config user.{name,email} Value' are not set

          Andrew Bayer added a comment -

          I'm not able to replicate this in my test setup - could you attach your top-level Jenkins config.xml, the job's config.xml, and, if it exists, the top-level hudson.plugins.git.GitSCM.xml? Thanks.

          Andrew Bayer added a comment - I'm not able to replicate this in my test setup - could you attach your top-level Jenkins config.xml, the job's config.xml, and, if it exists, the top-level hudson.plugins.git.GitSCM.xml? Thanks.

          Nathan Nutter added a comment -

          I've attached the files your requested. Thanks for following up!

          Nathan Nutter added a comment - I've attached the files your requested. Thanks for following up!

          Nathan Nutter added a comment - - edited

          I guess you'll have to delete the Jenkins Git user.name and user.email after loading those configs.

          Nathan Nutter added a comment - - edited I guess you'll have to delete the Jenkins Git user.name and user.email after loading those configs.

          bap added a comment -

          I had this issue too, after upgrading to 1.1.8
          Was all working fine before upgrade, NPE after.
          Setting user.name and user.email in the global config solved it.

          ohookins: in irc had the same issue too

          bap added a comment - I had this issue too, after upgrading to 1.1.8 Was all working fine before upgrade, NPE after. Setting user.name and user.email in the global config solved it. ohookins: in irc had the same issue too

          Andrew Bayer added a comment -

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

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

          Andrew Bayer added a comment -

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

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

          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.

          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.

          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

          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

          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.

          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.

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

              Created:
              Updated:
              Resolved: