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

NPE when retrieving "requester" address for a promoted build

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      We have started receiving NPE's during email creation. The issue goes away if we deselect the option to include the requester in the recipient list. A stack trace is below.

      Jul 06, 2012 8:09:23 AM hudson.plugins.emailext.ExtendedEmailPublisher sendMail
      WARNING: Could not send email.
      java.lang.NullPointerException
      at hudson.plugins.emailext.ExtendedEmailPublisher.createMail(ExtendedEmailPublisher.java:415)
      at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:273)
      at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:265)
      at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:225)
      at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:717)
      at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:692)
      at hudson.model.Build$BuildExecution.cleanUp(Build.java:192)
      at hudson.model.Run.execute(Run.java:1528)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:236)

      Thank you!

        Attachments

          Activity

          Hide
          slide_o_mix Alex Earl added a comment -

          What version

          Show
          slide_o_mix Alex Earl added a comment - What version
          Hide
          mmacvicar Mark MacVicar added a comment -

          This is occurring for us with:
          Jenkins: 1.504
          Mailer: 1.4
          Email-ext: 2.27.1

          The error we get is

          Sending email for trigger: Success
          ERROR: Could not send email as a part of the post-build publishers.
          java.lang.NullPointerException
          at hudson.plugins.emailext.ExtendedEmailPublisher.createMail(ExtendedEmailPublisher.java:535)
          at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:304)
          at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:296)
          at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:256)
          at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
          at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:814)
          at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:786)
          at hudson.model.Build$BuildExecution.cleanUp(Build.java:192)
          at hudson.model.Run.execute(Run.java:1612)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
          at hudson.model.ResourceController.execute(ResourceController.java:88)
          at hudson.model.Executor.run(Executor.java:237)

          Most jobs work ok with requester checked, but a few jobs always report this error when requester is checked.

          Show
          mmacvicar Mark MacVicar added a comment - This is occurring for us with: Jenkins: 1.504 Mailer: 1.4 Email-ext: 2.27.1 The error we get is Sending email for trigger: Success ERROR: Could not send email as a part of the post-build publishers. java.lang.NullPointerException at hudson.plugins.emailext.ExtendedEmailPublisher.createMail(ExtendedEmailPublisher.java:535) at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:304) at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:296) at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:256) at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:814) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:786) at hudson.model.Build$BuildExecution.cleanUp(Build.java:192) at hudson.model.Run.execute(Run.java:1612) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:237) Most jobs work ok with requester checked, but a few jobs always report this error when requester is checked.
          Hide
          slide_o_mix Alex Earl added a comment -

          Looks like its in this code (which I think is different from the original submitter of the issue)

          while (upc != null) {
              // UpstreamCause.getUpStreamProject() returns the full name, so use getItemByFullName
              AbstractProject<?, ?> p = (AbstractProject<?, ?>) Hudson.getInstance().getItemByFullName(upc.getUpstreamProject());
              cur = p.getBuildByNumber(upc.getUpstreamBuild()); // line 535
              upc = cur.getCause(Cause.UpstreamCause.class);
          }
          

          I guess p could be null

          Show
          slide_o_mix Alex Earl added a comment - Looks like its in this code (which I think is different from the original submitter of the issue) while (upc != null ) { // UpstreamCause.getUpStreamProject() returns the full name, so use getItemByFullName AbstractProject<?, ?> p = (AbstractProject<?, ?>) Hudson.getInstance().getItemByFullName(upc.getUpstreamProject()); cur = p.getBuildByNumber(upc.getUpstreamBuild()); // line 535 upc = cur.getCause(Cause.UpstreamCause.class); } I guess p could be null
          Hide
          slide_o_mix Alex Earl added a comment -

          Added check to see if returned project is null before trying to use it.

          Show
          slide_o_mix Alex Earl added a comment - Added check to see if returned project is null before trying to use it.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Alex Earl
          Path:
          src/main/java/hudson/plugins/emailext/ExtendedEmailPublisher.java
          http://jenkins-ci.org/commit/email-ext-plugin/a8280bcc3a91bb542091ef2a4eff3a57892dce26
          Log:
          Fix JENKINS-14338

          Added check to see if AbstractProject is null before trying to use it.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Alex Earl Path: src/main/java/hudson/plugins/emailext/ExtendedEmailPublisher.java http://jenkins-ci.org/commit/email-ext-plugin/a8280bcc3a91bb542091ef2a4eff3a57892dce26 Log: Fix JENKINS-14338 Added check to see if AbstractProject is null before trying to use it.

            People

            • Assignee:
              slide_o_mix Alex Earl
              Reporter:
              asedlackparts Aron Sedlack
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: