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

Publisher hudson.tasks.Mailer aborted due to exception

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: perforce-plugin
    • Labels:
      None
    • Environment:
      Hudson 1.352, Perforce plugin 1.0.24
    • Similar Issues:

      Description

      In a couple of recent builds, I received messages like this:

      ERROR: Publisher hudson.tasks.Mailer aborted due to exception

      java.lang.NullPointerException
      at hudson.plugins.perforce.PerforceMailResolver.findMailAddressFor(PerforceMailResolver.java:41)
      at hudson.tasks.MailAddressResolver.resolve(MailAddressResolver.java:97)
      at hudson.tasks.Mailer$UserProperty.getAddress(Mailer.java:465)
      at hudson.tasks.MailSender.buildCulpritList(MailSender.java:357)
      at hudson.tasks.MailSender.createEmptyMail(MailSender.java:338)
      at hudson.tasks.MailSender.createBackToNormalMail(MailSender.java:156)
      at hudson.tasks.MailSender.getMail(MailSender.java:147)
      at hudson.tasks.MailSender.execute(MailSender.java:81)
      at hudson.tasks.Mailer.perform(Mailer.java:101)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
      at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:582)
      at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:563)
      at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:550)
      at hudson.model.Build$RunnerImpl.post2(Build.java:152)
      at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:528)
      at hudson.model.Run.run(Run.java:1263)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:122)

      The projects it happened for were new (in Hudson) and had rather many changes in the depot (because they're old). Some of the users involved might not exist anymore (didn't check, but it's plausible given the age of the projects).
      Feel free to make the summary more accurately reflect what causes the problem (number of changes / users not existing).

        Attachments

          Activity

          Hide
          torbent torbent added a comment -

          The NullPointerException may well be gone, but I cannot upgrade to 1.0.27 because of JENKINS-6173 (LineEnd defaults to "null"). I believe I have fewer Mailer errors than I would have LineEnd errors :-/

          The mail resolver sounds a bit strange ... but I do believe that the 'username'@'clientname' may come from either the plugin's population of the changelog, or ultimately from Perforce itself (that's the way the submitter is identified in the changelist).

          Show
          torbent torbent added a comment - The NullPointerException may well be gone, but I cannot upgrade to 1.0.27 because of JENKINS-6173 (LineEnd defaults to "null"). I believe I have fewer Mailer errors than I would have LineEnd errors :-/ The mail resolver sounds a bit strange ... but I do believe that the 'username'@'clientname' may come from either the plugin's population of the changelog, or ultimately from Perforce itself (that's the way the submitter is identified in the changelist).
          Hide
          rpetti Rob Petti added a comment -

          Ok, looks like 'username'@'clientname' is only used in the changelog view, so I have no idea where it came from in your case. Maybe one of your perforce servers has it defined as such?

          Show
          rpetti Rob Petti added a comment - Ok, looks like 'username'@'clientname' is only used in the changelog view, so I have no idea where it came from in your case. Maybe one of your perforce servers has it defined as such?
          Hide
          torbent torbent added a comment -

          I'm pretty sure the user in question didn't exist on either server. I also think that Perforce's default response to p4 user -o no_such_user is a ready-to-be-filled-in form with an email address of "no_such_user@whatever-client-is-being-used".
          Yup, just checked the docs: http://perforce.com/perforce/doc.092/manuals/cmdref/user.html
          "Email: The user's email address. By default, this is user@client."

          So Perforce will happily invent email addresses (and users) for us. Not too good. I'm not near a Perforce server until Monday, but perhaps the -s option has some use here? As in p4 -s user -o no_such_user - hopefully it will then respond with "error".

          Did a bit more reading in those docs. The users command seems to be our friend: http://perforce.com/perforce/doc.092/manuals/cmdref/users.html. The command p4 users who will give information about "who"; the information being a.o. username, real name, and email address. Presumably nothing will be returned if the user does not exist?

          Anyway, you could try playing around with it, perhaps? Or I can do it Monday.

          Show
          torbent torbent added a comment - I'm pretty sure the user in question didn't exist on either server. I also think that Perforce's default response to p4 user -o no_such_user is a ready-to-be-filled-in form with an email address of "no_such_user@whatever-client-is-being-used". Yup, just checked the docs: http://perforce.com/perforce/doc.092/manuals/cmdref/user.html " Email: The user's email address. By default, this is user@client. " So Perforce will happily invent email addresses (and users) for us. Not too good. I'm not near a Perforce server until Monday, but perhaps the -s option has some use here? As in p4 -s user -o no_such_user - hopefully it will then respond with "error". Did a bit more reading in those docs. The users command seems to be our friend: http://perforce.com/perforce/doc.092/manuals/cmdref/users.html . The command p4 users who will give information about "who"; the information being a.o. username, real name, and email address. Presumably nothing will be returned if the user does not exist? Anyway, you could try playing around with it, perhaps? Or I can do it Monday.
          Hide
          rpetti Rob Petti added a comment -

          Aha, that would explain it!

          I just tried p4 -s user -o USER and it doesn't error out, it just prepends every line with either 'error:' or 'info:', the actual information returned is still the same.

          I could try changing to p4 users, but that will require changing the tek42 libraries, so it might take me some time to get oriented with it. If a build is failing because of an invalid email address in the MailPublisher, then perhaps a bug should be filed against it as well.

          Show
          rpetti Rob Petti added a comment - Aha, that would explain it! I just tried p4 -s user -o USER and it doesn't error out, it just prepends every line with either 'error:' or 'info:', the actual information returned is still the same. I could try changing to p4 users, but that will require changing the tek42 libraries, so it might take me some time to get oriented with it. If a build is failing because of an invalid email address in the MailPublisher, then perhaps a bug should be filed against it as well.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Rob Petti
          Path:
          src/main/java/com/tek42/perforce/parse/Users.java
          src/main/java/hudson/plugins/perforce/PerforceMailResolver.java
          http://jenkins-ci.org/commit/perforce-plugin/4ee1ee3baaeaaaee7bc0a1f5deaa345c614ffc9b
          Log:
          [FIXED JENKINS-6079] check to see if the user exists before attempting to get their information

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Rob Petti Path: src/main/java/com/tek42/perforce/parse/Users.java src/main/java/hudson/plugins/perforce/PerforceMailResolver.java http://jenkins-ci.org/commit/perforce-plugin/4ee1ee3baaeaaaee7bc0a1f5deaa345c614ffc9b Log: [FIXED JENKINS-6079] check to see if the user exists before attempting to get their information

            People

            • Assignee:
              rpetti Rob Petti
              Reporter:
              torbent torbent
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: