timja / jenkins-gh-issues-poc-06-18

0 stars 0 forks source link

[JENKINS-62596] Email functionality is not working after Jenkins upgrade #1066

Open timja opened 4 years ago

timja commented 4 years ago

Hi Team,

On 16/May/2020, we upgraded our jenkins from 2.165 to 2.236 version. After upgrade, we are getting an exception while sending an email after build Failure in Jenkins. It was working fine before upgrade.

Below is the exception message from jenkins console log. Please check this asap and resolve. Let us know if any details needed. Thanks.

 

Exception:

ERROR: Processing failed due to a bug in the code. Please report this to the issue tracker (https://jenkins.io/redirect/report-an-issue).

java.lang.NullPointerException

        at javax.mail.internet.InternetAddress.toString(InternetAddress.java:472)

        at javax.mail.internet.MimeMessage.setAddressHeader(MimeMessage.java:733)

        at javax.mail.internet.MimeMessage.setFrom(MimeMessage.java:382)

        at jenkins.plugins.mailer.tasks.MimeMessageBuilder.buildMimeMessage(MimeMessageBuilder.java:197) 

       at hudson.tasks.MailSender.createEmptyMail(MailSender.java:401) 

       at hudson.tasks.MailSender.createUnstableMail(MailSender.java:224) 

       at hudson.tasks.MailSender.createMail(MailSender.java:186)  

      at hudson.tasks.MailSender.run(MailSender.java:112)

       at hudson.tasks.MailSender.execute(MailSender.java:106)

        at hudson.maven.reporters.MavenMailer.end(MavenMailer.java:77)

      at hudson.maven.AbstractMavenBuilder.end(AbstractMavenBuilder.java:104)

       at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:885)              at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)

       at hudson.model.Run.execute(Run.java:1880) 

      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543) 

      at hudson.model.ResourceController.execute(ResourceController.java:97)

      at hudson.model.Executor.run(Executor.java:428)

[project=hudson.maven.MavenModuleSet@17e70c4BLOOM-PREPROD-PUBLISHER-FUNCTIONAL_TGproject.getModules()=[hudson.maven.MavenModule@936fcb[BLOOM-PREPROD-PUBLISHER-FUNCTIONAL_TG/Bloom:BloomTestNGFramework][BLOOM-PREPROD-PUBLISHER-FUNCTIONAL_TG/Bloom:BloomTestNGFramework][relativePath:BloomPublisher-KeyFunctionalities-Parallel]]

project.getRootModule()[=hudson.maven.MavenModule@936fcb[BLOOM-PREPROD-PUBLISHER-FUNCTIONAL_TG/Bloom:BloomTestNGFramework][BLOOM-PREPROD-PUBLISHER-FUNCTIONAL_TG/Bloom:BloomTestNGFramework]relativePath:BloomPublisher-KeyFunctionalities-Parallel

FATAL: nulljava.lang.NullPointerException

        at javax.mail.internet.InternetAddress.toString(InternetAddress.java:472)

        at javax.mail.internet.MimeMessage.setAddressHeader(MimeMessage.java:733)

        at javax.mail.internet.MimeMessage.setFrom(MimeMessage.java:382)

        at jenkins.plugins.mailer.tasks.MimeMessageBuilder.buildMimeMessage(MimeMessageBuilder.java:197)

        at hudson.tasks.MailSender.createEmptyMail(MailSender.java:401)

       at hudson.tasks.MailSender.createUnstableMail(MailSender.java:224)

       at hudson.tasks.MailSender.createMail(MailSender.java:186)

       at hudson.tasks.MailSender.run(MailSender.java:112)

       at hudson.tasks.MailSender.execute(MailSender.java:106)

       at hudson.maven.reporters.MavenMailer.end(MavenMailer.java:77)

       at hudson.maven.AbstractMavenBuilder.end(AbstractMavenBuilder.java:104) 

       at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:885)               at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)

       at hudson.model.Run.execute(Run.java:1880) 

       at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543) 

       at hudson.model.ResourceController.execute(ResourceController.java:97)

       at hudson.model.Executor.run(Executor.java:428)

[htmlpublisher] Archiving HTML reports...

[htmlpublisher] Archiving at BUILD level C:\Program Files (x86)\Jenkins\workspace\BLOOM-PREPROD-PUBLISHER-FUNCTIONAL_TG\BloomPublisher-KeyFunctionalities-Parallel to C:\Program Files (x86)\Jenkins\jobs\BLOOM-PREPROD-PUBLISHER-FUNCTIONAL_TG\builds\79\htmlreports\Extent_20Report

FATAL: null

java.lang.NullPointerException

        at javax.mail.internet.InternetAddress.toString(InternetAddress.java:472) 

       at javax.mail.internet.MimeMessage.setAddressHeader(MimeMessage.java:733) 

       at javax.mail.internet.MimeMessage.setFrom(MimeMessage.java:382) 

       at jenkins.plugins.mailer.tasks.MimeMessageBuilder.buildMimeMessage(MimeMessageBuilder.java:197)

       at hudson.tasks.MailSender.createEmptyMail(MailSender.java:401)

        at hudson.tasks.MailSender.createFailureMail(MailSender.java:266)

        at hudson.tasks.MailSender.createMail(MailSender.java:181)

        at hudson.tasks.MailSender.run(MailSender.java:112)

        at hudson.tasks.MailSender.execute(MailSender.java:106)

        at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.cleanUp(MavenModuleSetBuild.java:1095)

        at hudson.model.Run.execute(Run.java:1927)

        at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)

        at hudson.model.ResourceController.execute(ResourceController.java:97)

        at hudson.model.Executor.run(Executor.java:428)

Finished: FAILURE

 


Originally reported by jsanthoshkumarj, imported from: Email functionality is not working after Jenkins upgrade
  • status: Open
  • priority: Critical
  • resolution: Unresolved
  • imported: 2022/01/10
timja commented 4 years ago

jsanthoshkumarj:

The issue is with emails not getting triggered when there is a job failure. Emails are flowing for success scenarios. As part of debugging, we have tried the following:

 

Regards,

J Santhosh Kumar

timja commented 4 years ago

jsanthoshkumarj:

Hi Team,

Could you please check and update asap ?

Thanks.

 

Regards,

J Santhosh Kumar

timja commented 4 years ago

slide_o_mix:

This is not an issue with email-ext. It looks like it would be the maven plugin.

timja commented 4 years ago

jslobello:

I upgraded Jenkins yesterday & am seeing a similar stacktrace, but its not involving the maven plugin...

 

ERROR: Build step failed with exceptionERROR: Build step failed with exceptionjava.lang.NullPointerException at javax.mail.internet.InternetAddress.toString(InternetAddress.java:472) at javax.mail.internet.MimeMessage.setAddressHeader(MimeMessage.java:733) at javax.mail.internet.MimeMessage.setFrom(MimeMessage.java:382) at jenkins.plugins.mailer.tasks.MimeMessageBuilder.buildMimeMessage(MimeMessageBuilder.java:197) at hudson.tasks.MailSender.createEmptyMail(MailSender.java:401) at hudson.tasks.MailSender.createBackToNormalMail(MailSender.java:204) at hudson.tasks.MailSender.createMail(MailSender.java:195) at hudson.tasks.MailSender.run(MailSender.java:112) at hudson.tasks.Mailer.perform(Mailer.java:171) at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690) at hudson.model.Build$BuildExecution.post2(Build.java:186) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635) at hudson.model.Run.execute(Run.java:1905) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:428)Build step 'E-mail Notification' marked build as failureNotifying upstream projects of job completionFinished: FAILURE

timja commented 4 years ago

alfabravoteam:

It's an odd message because it seems to fail while building an empty message and trying to set the 'from' value with a null value. And the normalized value for that field would only be null if you set something that is not an email address and you don't have a default suffix configured.

timja commented 4 years ago

andrewn:

Same issue here. Thanks to Andres’s comment, as a workaround, I set a value for “Default user e-mail suffix” under “E-mail Notification” (not “Extended E-mail Notification”) on https://jenkins.example.org/configure, and jobs are sending email again.