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

javax.mail.internet.AddressException: Illegal address in string

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Component/s: mailer-plugin
    • Labels:
      None
    • Environment:
      Hudson-1.385
      Linux OS
    • Similar Issues:

      Description

      Hi,
      I updated my Hudson from version 1.382 to latest once 1.385
      I found that then we are not getting notification (irrespective id thye build is successful or failed) , error logs shows below message :

      -----------------------------------
      Polled jobs are []
      ERROR: Illegal address
      javax.mail.internet.AddressException: Illegal address in string ``''
      at javax.mail.internet.InternetAddress.<init>(InternetAddress.java:94)
      at hudson.tasks.MailSender.createEmptyMail(MailSender.java:308)
      at hudson.tasks.MailSender.createFailureMail(MailSender.java:219)
      at hudson.tasks.MailSender.getMail(MailSender.java:146)
      at hudson.tasks.MailSender.execute(MailSender.java:94)
      at hudson.maven.MavenModuleSetBuild$RunnerImpl.cleanUp(MavenModuleSetBuild.java:675)
      at hudson.model.Run.run(Run.java:1367)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:349)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:139)
      Finished: FAILURE
      --------------------------

      email-id I have configured is simple : vishal.jain.2@xxxx.com

        Attachments

          Activity

          Hide
          evernat evernat added a comment -

          Is it reproduced with a recent Jenkins version?

          Show
          evernat evernat added a comment - Is it reproduced with a recent Jenkins version?
          Hide
          cloarec4 Jean-Paul Cloarec added a comment -

          I have it with 1.504 version also

          Build step 'Execute shell' marked build as failure
          ERROR: Illegal address
          javax.mail.internet.AddressException: Illegal address in string ``''
          at javax.mail.internet.InternetAddress.<init>(InternetAddress.java:114)
          at hudson.tasks.Mailer.StringToAddress(Mailer.java:154)
          at hudson.tasks.MailSender.createEmptyMail(MailSender.java:318)
          at hudson.tasks.MailSender.createFailureMail(MailSender.java:227)
          at hudson.tasks.MailSender.getMail(MailSender.java:154)
          at hudson.tasks.MailSender.execute(MailSender.java:100)
          at hudson.tasks.Mailer.perform(Mailer.java:117)
          at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
          at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:814)
          at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:786)
          at hudson.model.Build$BuildExecution.post2(Build.java:183)
          at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:733)
          at hudson.model.Run.execute(Run.java:1592)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
          at hudson.model.ResourceController.execute(ResourceController.java:88)
          at hudson.model.Executor.run(Executor.java:237)
          Finished: FAILURE

          Show
          cloarec4 Jean-Paul Cloarec added a comment - I have it with 1.504 version also Build step 'Execute shell' marked build as failure ERROR: Illegal address javax.mail.internet.AddressException: Illegal address in string ``'' at javax.mail.internet.InternetAddress.<init>(InternetAddress.java:114) at hudson.tasks.Mailer.StringToAddress(Mailer.java:154) at hudson.tasks.MailSender.createEmptyMail(MailSender.java:318) at hudson.tasks.MailSender.createFailureMail(MailSender.java:227) at hudson.tasks.MailSender.getMail(MailSender.java:154) at hudson.tasks.MailSender.execute(MailSender.java:100) at hudson.tasks.Mailer.perform(Mailer.java:117) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:814) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:786) at hudson.model.Build$BuildExecution.post2(Build.java:183) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:733) at hudson.model.Run.execute(Run.java:1592) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:237) Finished: FAILURE
          Hide
          evernat evernat added a comment -

          @Jean-Paul
          The line 318 of MailSender is currently:
          msg.setFrom(Mailer.StringToAddress(Mailer.descriptor().getAdminAddress(), charset));

          See:
          https://github.com/jenkinsci/mailer-plugin/blob/master/src/main/java/hudson/tasks/MailSender.java#L318

          I think that you have an empty email address for Admin.
          Can you check in your global Jenkins configuration at "Jenkins location", if your "System Admin e-mail address" is empty or starts with a space for example?

          In which case, this issue would be that the exception message could really be improved to explain what is the cause.

          Show
          evernat evernat added a comment - @Jean-Paul The line 318 of MailSender is currently: msg.setFrom(Mailer.StringToAddress(Mailer.descriptor().getAdminAddress(), charset)); See: https://github.com/jenkinsci/mailer-plugin/blob/master/src/main/java/hudson/tasks/MailSender.java#L318 I think that you have an empty email address for Admin. Can you check in your global Jenkins configuration at "Jenkins location", if your "System Admin e-mail address" is empty or starts with a space for example? In which case, this issue would be that the exception message could really be improved to explain what is the cause.
          Hide
          cloarec4 Jean-Paul Cloarec added a comment -

          You're the boss
          yes, System-admin email address was empty.
          Many thanks!

          Show
          cloarec4 Jean-Paul Cloarec added a comment - You're the boss yes, System-admin email address was empty. Many thanks!
          Hide
          evernat evernat added a comment - - edited

          Can you, or another developer from A-L, send a github pull request to the mailer plugin:
          https://github.com/jenkinsci/mailer-plugin

          For example, something starting like
          if (StringUtils.isNotBlank(Mailer.descriptor().getAdminAddress()))

          { ... }

          else {
          throw ...
          somewhere around there:
          https://github.com/jenkinsci/mailer-plugin/blob/master/src/main/java/hudson/tasks/MailSender.java#L318

          Thanks

          Show
          evernat evernat added a comment - - edited Can you, or another developer from A-L, send a github pull request to the mailer plugin: https://github.com/jenkinsci/mailer-plugin For example, something starting like if (StringUtils.isNotBlank(Mailer.descriptor().getAdminAddress())) { ... } else { throw ... somewhere around there: https://github.com/jenkinsci/mailer-plugin/blob/master/src/main/java/hudson/tasks/MailSender.java#L318 Thanks
          Hide
          slide_o_mix Alex Earl added a comment -

          This has already been fixed by returning an error message.

          Show
          slide_o_mix Alex Earl added a comment - This has already been fixed by returning an error message.

            People

            • Assignee:
              cloarec4 Jean-Paul Cloarec
              Reporter:
              vishaljain000 vishaljain000
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: