Promoting build with custom workspace results in NullPointerException

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      Promoting a build with a custom workspace results in:

      java.lang.NullPointerException
          at hudson.plugins.promoted_builds.Promotion.getUrl(Promotion.java:61)
          at hudson.model.Run.getEnvironment(Run.java:1771)
          at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:725)
          at hudson.plugins.promoted_builds.Promotion.getEnvironment(Promotion.java:74)
          at hudson.plugins.promoted_builds.Promotion$RunnerImpl.decideWorkspace(Promotion.java:107)
          ...
      

      When a build with a custom workspace is promoted, decideWorkspace(...) attempts to build the environment, which eventually results in a call to getUrl() before the target build number has been initialized. Promotion guards against this in its own getEnvironment(TaskListener) implementation, however, it still ends up getting called by Run.getEnvironment(TaskListener).

      Several people have also reported this in the comments on the plugin wiki.

      I'll be submitting a pull request in GitHub shortly with a proposed solution.

            Assignee:
            Peter Hayes
            Reporter:
            mrobinet
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: