• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • mailer-plugin
    • None
    • Centos 6.4/Tomcat 7.42

      Hello,

      When I create a maven build it does not save the email recipients. I do not have any email plugins installed.

      At the end of the build it does a npe:

      FATAL: null
      java.lang.NullPointerException
      at java.util.StringTokenizer.<init>(StringTokenizer.java:199)
      at java.util.StringTokenizer.<init>(StringTokenizer.java:236)
      at hudson.tasks.MailSender.createEmptyMail(MailSender.java:326)
      at hudson.tasks.MailSender.createBackToNormalMail(MailSender.java:175)
      at hudson.tasks.MailSender.getMail(MailSender.java:166)
      at hudson.tasks.MailSender.execute(MailSender.java:100)
      at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.cleanUp(MavenModuleSetBuild.java:1038)
      at hudson.model.Run.execute(Run.java:1723)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:509)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:231)

          [JENKINS-20954] NPE from MailSender.createEmptyMail

          Greg Huber created issue -

          Changed issue to critical, because it's a show stopper. Jobs does not build and fails always after checkout with this error.

          Conny Kreyßel added a comment - Changed issue to critical, because it's a show stopper. Jobs does not build and fails always after checkout with this error.
          Conny Kreyßel made changes -
          Priority Original: Minor [ 4 ] New: Critical [ 2 ]

          K P added a comment -

          Indeed, just got the same issue.
          Created a new job, which first didn't build (initially due to some other config. settings which had to be fixed). But when the module build eventually completed successfully, the Mailer plugin throws this Exception, resulting in a failed build job.

          ERROR: Processing failed due to a bug in the code. Please report this to jenkinsci-users@googlegroups.com
          java.lang.NullPointerException
          	at java.util.StringTokenizer.<init>(StringTokenizer.java:199)
          	at java.util.StringTokenizer.<init>(StringTokenizer.java:236)
          	at hudson.tasks.MailSender.createEmptyMail(MailSender.java:326)
          	at hudson.tasks.MailSender.createBackToNormalMail(MailSender.java:175)
          	at hudson.tasks.MailSender.getMail(MailSender.java:166)
          	at hudson.tasks.MailSender.execute(MailSender.java:100)
          	at hudson.maven.reporters.MavenMailer.end(MavenMailer.java:56)
          	at hudson.maven.AbstractMavenBuilder.end(AbstractMavenBuilder.java:103)
          	at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:829)
          	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:566)
          	at hudson.model.Run.execute(Run.java:1678)
          	at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:509)
          	at hudson.model.ResourceController.execute(ResourceController.java:88)
          	at hudson.model.Executor.run(Executor.java:231)
          

          Probably because of an empty recipient list?
          This is indeed rather critical, as it's the Mailer that's breaking an otherwise perfectly successful build.

          MailSender.java shouldn't try constructing a StringTokenizer with a null recipients list, as that throws an NPE. Some null checking would be very appropriate here, for whatever reason the recipients variable is null.

          K P added a comment - Indeed, just got the same issue. Created a new job, which first didn't build (initially due to some other config. settings which had to be fixed). But when the module build eventually completed successfully, the Mailer plugin throws this Exception, resulting in a failed build job. ERROR: Processing failed due to a bug in the code. Please report this to jenkinsci-users@googlegroups.com java.lang.NullPointerException at java.util.StringTokenizer.<init>(StringTokenizer.java:199) at java.util.StringTokenizer.<init>(StringTokenizer.java:236) at hudson.tasks.MailSender.createEmptyMail(MailSender.java:326) at hudson.tasks.MailSender.createBackToNormalMail(MailSender.java:175) at hudson.tasks.MailSender.getMail(MailSender.java:166) at hudson.tasks.MailSender.execute(MailSender.java:100) at hudson.maven.reporters.MavenMailer.end(MavenMailer.java:56) at hudson.maven.AbstractMavenBuilder.end(AbstractMavenBuilder.java:103) at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:829) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:566) at hudson.model.Run.execute(Run.java:1678) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:509) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:231) Probably because of an empty recipient list? This is indeed rather critical, as it's the Mailer that's breaking an otherwise perfectly successful build. MailSender.java shouldn't try constructing a StringTokenizer with a null recipients list, as that throws an NPE. Some null checking would be very appropriate here, for whatever reason the recipients variable is null.

          +1

          Breaks in version 1.6 and 1.509.4 LTS

          Rollback to 1.5 fixed the issue for me.

          Steffen Breitbach added a comment - +1 Breaks in version 1.6 and 1.509.4 LTS Rollback to 1.5 fixed the issue for me.

          +1

          1.542 has the problem, too.

          Additionally: If a job had a previously defined mail recipient, mail will still be sent to that recipient but an additional "null" recipient will be added.
          This results in bounce messages unless "null" is a valid mail user name.

          The "send email" post-build-action available in multi-configuration and in free style builds is not affected and works correctly for editing and mailing.

          Wolf Geldmacher added a comment - +1 1.542 has the problem, too. Additionally: If a job had a previously defined mail recipient, mail will still be sent to that recipient but an additional "null" recipient will be added. This results in bounce messages unless "null" is a valid mail user name. The "send email" post-build-action available in multi-configuration and in free style builds is not affected and works correctly for editing and mailing.

          Dejan Stojadinović added a comment - - edited

          +1

          Jenkins Mailer Plugin 1.6 and Jenkins 1.532.1 LTS combination is affected also; will try to downgrade plugin (from 1.6 to 1.5).

          Dejan Stojadinović added a comment - - edited +1 Jenkins Mailer Plugin 1.6 and Jenkins 1.532.1 LTS combination is affected also; will try to downgrade plugin (from 1.6 to 1.5).

          dtriphaus added a comment - - edited

          Same problem here with 1.543

          dtriphaus added a comment - - edited Same problem here with 1.543

          Jesse Glick added a comment -

          Fixed in sources in https://github.com/jenkinsci/mailer-plugin/commit/2dd9a1ec694e44e2ba47feae6b718d5c5040cda4 (though this was reported to me in 1.5, not 1.6).

          Jesse Glick added a comment - Fixed in sources in https://github.com/jenkinsci/mailer-plugin/commit/2dd9a1ec694e44e2ba47feae6b718d5c5040cda4 (though this was reported to me in 1.5, not 1.6).
          Jesse Glick made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

            Unassigned Unassigned
            gregh3269 Greg Huber
            Votes:
            9 Vote for this issue
            Watchers:
            15 Start watching this issue

              Created:
              Updated:
              Resolved: