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

NullPointerException in BuildNameSetter.setup

    XMLWordPrintable

Details

    Description

      Similar NPE on all of our jobs using build name setter:

      ERROR: Processing failed due to a bug in the code. Please report this to jenkinsci-users@googlegroups.com
      java.lang.NullPointerException
      at org.jenkinsci.plugins.buildnamesetter.BuildNameSetter.setUp(BuildNameSetter.java:41)
      at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:655)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
      at hudson.model.Run.execute(Run.java:1738)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531)
      at hudson.model.ResourceController.execute(ResourceController.java:98)
      at hudson.model.Executor.run(Executor.java:410)
      project=hudson.maven.MavenModuleSet@19c9e8a[player-services-test]
      project.getModules()=[hudson.maven.MavenModule@1209012[player-services-test/com.sonos.services:player-services-test][player-services-test/com.sonos.services:player-services-test][relativePath:], hudson.maven.MavenModule@23fe5f[player-services-test/com.sonos.services:sonos-test][player-services-test/com.sonos.services:sonos-test][relativePath:sonos-test], hudson.maven.MavenModule@89efd9[player-services-test/com.sonos.services:sonos-test-dependencies][player-services-test/com.sonos.services:sonos-test-dependencies][relativePath:sonos-test-dependencies]]
      project.getRootModule()=hudson.maven.MavenModule@1209012[player-services-test/com.sonos.services:player-services-test][player-services-test/com.sonos.services:player-services-test][relativePath:]
      FATAL: null
      java.lang.NullPointerException
      at org.jenkinsci.plugins.buildnamesetter.BuildNameSetter.setUp(BuildNameSetter.java:41)
      at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:655)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
      at hudson.model.Run.execute(Run.java:1738)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531)
      at hudson.model.ResourceController.execute(ResourceController.java:98)
      at hudson.model.Executor.run(Executor.java:410)

      Build Name: #${BUILD_NUMBER}-${ENV,var="STREAM"}

      Attachments

        Issue Links

          Activity

            le0 Lev Mishin added a comment - - edited

            New version of the plugin is available in alternative update center https://github.com/jucies/releases
            So I'm going to close the bug

            le0 Lev Mishin added a comment - - edited New version of the plugin is available in alternative update center https://github.com/jucies/releases So I'm going to close the bug
            le0 Lev Mishin added a comment -

            danielbeck thanks for the link! It seems you are right

            le0 Lev Mishin added a comment - danielbeck thanks for the link! It seems you are right
            le0 Lev Mishin added a comment -

            Fixed in version 1.6.3

            le0 Lev Mishin added a comment - Fixed in version 1.6.3
            jeysaba Jey Saba added a comment -

            le0, I tried upgrading to version 1.6.3, and it no longer sets the build name, either before or after the build. On upgrade, both runAtStart and runAtEnd are set to false, so no build name is ever set.

            We have over a hundred Jenkins jobs, so it's not feasible to manually set the flag for each job. I have to roll back to the earlier version, 1.5.1.

            I also read the wiki that danielbeck mentioned above w.r.t. adding a new field. Here are my thoughts on this issue:

            1. On upgrade, the plugin should preserve the existing behaviour (i.e., set the name at start).
            2. Right now, there are two check boxes for start and end. Wouldn't it make more sense for it to be a choice between start OR end (i.e., a radio button)?
            3. Why not remove the first option and only keep the one for "Set build name after build ends" instead of at the start?

            Just have one flag that's set to false on upgrade, and persisted only if the user actively sets it to true. It preserves the existing behaviour, works within the recommended guidelines for adding a new field, and introduces the new advanced feature that you wrote to set the name at the end of a build.

            jeysaba Jey Saba added a comment - le0 , I tried upgrading to version 1.6.3, and it no longer sets the build name, either before or after the build. On upgrade, both runAtStart and runAtEnd are set to false, so no build name is ever set. We have over a hundred Jenkins jobs, so it's not feasible to manually set the flag for each job. I have to roll back to the earlier version, 1.5.1. I also read the wiki that danielbeck mentioned above w.r.t. adding a new field. Here are my thoughts on this issue: On upgrade, the plugin should preserve the existing behaviour (i.e., set the name at start). Right now, there are two check boxes for start and end. Wouldn't it make more sense for it to be a choice between start OR end (i.e., a radio button)? Why not remove the first option and only keep the one for "Set build name after build ends" instead of at the start? Just have one flag that's set to false on upgrade, and persisted only if the user actively sets it to true. It preserves the existing behaviour, works within the recommended guidelines for adding a new field, and introduces the new advanced feature that you wrote to set the name at the end of a build.
            le0 Lev Mishin added a comment -

            jeysaba default behaviour of this plugin was to set build name at the start and at the and. I created a new bug
            https://issues.jenkins-ci.org/browse/JENKINS-34415 and I'll fix it asap (PR is already created)

            le0 Lev Mishin added a comment - jeysaba default behaviour of this plugin was to set build name at the start and at the and. I created a new bug https://issues.jenkins-ci.org/browse/JENKINS-34415 and I'll fix it asap (PR is already created)

            People

              le0 Lev Mishin
              codyslee Cody Lee
              Votes:
              16 Vote for this issue
              Watchers:
              23 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: