[JIRA] [email-ext-plugin] (JENKINS-33690) NullPointer when using emailext templates with Groovy Trigger Script

10 views
Skip to first unread message

gustavocdc@gmail.com (JIRA)

unread,
Mar 21, 2016, 9:13:02 AM3/21/16
to jenkinsc...@googlegroups.com
Gustavo Cabral do Carmo created an issue
 
Jenkins / Bug JENKINS-33690
NullPointer when using emailext templates with Groovy Trigger Script
Issue Type: Bug Bug
Assignee: Alex Earl
Components: email-ext-plugin, emailext-template-plugin
Created: 2016/Mar/21 1:12 PM
Environment: Jenkins 1.653
Email Extension Plugin 2.41.3
Email Extension Template Plugin 0.4
Priority: Major Major
Reporter: Gustavo Cabral do Carmo

I have created a template with the following Trigger

Script - After Build
Trigger Script: build.result.toString().equals('SUCCESS') && build.getBuildVariables().get("publish").equals('true');

Then I assign it to the project, that is properly configured, it has a 'publish' variable that was checked in the build, and when I built the project I got this error.

Important Detail: With the exactly same configuration but without using templates, it work flawlessly.

BUILD SUCCESSFUL
Total time: 2 minutes 38 seconds
ERROR: Build step failed with exception
java.lang.NullPointerException
at hudson.plugins.emailext.plugins.trigger.AbstractScriptTrigger.createEngine(AbstractScriptTrigger.java:81)
at hudson.plugins.emailext.plugins.trigger.AbstractScriptTrigger.trigger(AbstractScriptTrigger.java:56)
at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:274)
at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:258)
at org.jenkinsci.plugins.emailext_template.ExtendedEmailTemplatePublisher.perform(ExtendedEmailTemplatePublisher.java:67)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
at hudson.model.Build$BuildExecution.post2(Build.java:185)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668)
at hudson.model.Run.execute(Run.java:1763)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Build step 'Editable Email Notification Templates' marked build as failure
Finished: FAILURE

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

gustavocdc@gmail.com (JIRA)

unread,
Mar 21, 2016, 9:15:02 AM3/21/16
to jenkinsc...@googlegroups.com

slide.o.mix@gmail.com (JIRA)

unread,
Mar 22, 2016, 12:15:03 AM3/22/16
to jenkinsc...@googlegroups.com
Alex Earl commented on Bug JENKINS-33690
 
Re: NullPointer when using emailext templates with Groovy Trigger Script

I haven't been able to reproduce this at all, can you share your job configuration at all?

gustavocdc@gmail.com (JIRA)

unread,
Mar 22, 2016, 12:28:02 PM3/22/16
to jenkinsc...@googlegroups.com
Gustavo Cabral do Carmo updated an issue
Attachment: TemplateCfg2.jpg
Attachment: TemplateCfg1.jpg
Attachment: JobCfg2.jpg
Attachment: JobCfg1.jpg

gustavocdc@gmail.com (JIRA)

unread,
Mar 22, 2016, 12:30:04 PM3/22/16
to jenkinsc...@googlegroups.com

gustavocdc@gmail.com (JIRA)

unread,
Mar 22, 2016, 12:32:03 PM3/22/16
to jenkinsc...@googlegroups.com
Gustavo Cabral do Carmo commented on Bug JENKINS-33690
 
Re: NullPointer when using emailext templates with Groovy Trigger Script

I create a test job just to reproduce the problem, you can see the pictures in the Attachments.

gustavocdc@gmail.com (JIRA)

unread,
Mar 22, 2016, 12:41:01 PM3/22/16
to jenkinsc...@googlegroups.com
I create a test job just to reproduce the problem, you can see the pictures in the Attachments.

Some menus and configs are in portuguese but I'm sure you'll understand everything.

bruno.lavit@forgerock.com (JIRA)

unread,
Mar 24, 2016, 4:07:01 AM3/24/16
to jenkinsc...@googlegroups.com

Hi,
I have the same issue with Jenkins LTS 1.625.3.
I've tried to create a job template with the email-ext plugin and a "Script - After Build" trigger.
I got the same NPE in the job using the template.

[TemplateProject] Starting publishers from: template - Docs


ERROR: Build step failed with exception
java.lang.NullPointerException

at hudson.plugins.emailext.plugins.trigger.AbstractScriptTrigger.createEngine(AbstractScriptTrigger.java:82)
at hudson.plugins.emailext.plugins.trigger.AbstractScriptTrigger.trigger(AbstractScriptTrigger.java:56)
at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:246)
at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:230)
at hudson.plugins.templateproject.ProxyPublisher.perform(ProxyPublisher.java:85)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1047)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
at hudson.model.Run.execute(Run.java:1766)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:408)

bruno.lavit@forgerock.com (JIRA)

unread,
Mar 24, 2016, 4:09:01 AM3/24/16
to jenkinsc...@googlegroups.com
Bruno Lavit edited a comment on Bug JENKINS-33690
Hi,
I have the same issue with Jenkins LTS 1.625.3
, Email-ext plugin 2 . 40.5 and Template plugin 1.5.2.
I've tried to create a job template with the email-ext plugin and a "Script - After Build" trigger.
I got the same NPE in the job using the template.

{quote}[TemplateProject] Starting publishers from: template - Docs

ERROR: Build step failed with exception
java.lang.NullPointerException
at hudson.plugins.emailext.plugins.trigger.AbstractScriptTrigger.createEngine(AbstractScriptTrigger.java:82)
at hudson.plugins.emailext.plugins.trigger.AbstractScriptTrigger.trigger(AbstractScriptTrigger.java:56)
at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:246)
at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:230)
at hudson.plugins.templateproject.ProxyPublisher.perform(ProxyPublisher.java:85)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1047)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
at hudson.model.Run.execute(Run.java:1766)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:408){quote}

bruno.lavit@forgerock.com (JIRA)

unread,
Mar 24, 2016, 4:12:02 AM3/24/16
to jenkinsc...@googlegroups.com
Bruno Lavit edited a comment on Bug JENKINS-33690
Hi,

I have the same issue with Jenkins LTS 1.625.3, Email-ext plugin 2.40.5 and Template plugin 1.5.2.

I've tried to create a job template with the email-ext plugin and a "Script - After Build" trigger :
{quote}build
. logFile.text.readLines().any { it =~ /^Build step 'Jenkins Text Finder' changed build result to UNSTABLE/ }
{quote}

I got the same NPE in the job using the template . :

{quote}[TemplateProject] Starting publishers from: template - Docs
ERROR: Build step failed with exception
java.lang.NullPointerException
at hudson.plugins.emailext.plugins.trigger.AbstractScriptTrigger.createEngine(AbstractScriptTrigger.java:82)
at hudson.plugins.emailext.plugins.trigger.AbstractScriptTrigger.trigger(AbstractScriptTrigger.java:56)
at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:246)
at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:230)
at hudson.plugins.templateproject.ProxyPublisher.perform(ProxyPublisher.java:85)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1047)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
at hudson.model.Run.execute(Run.java:1766)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:408){quote}

bruno.lavit@forgerock.com (JIRA)

unread,
Mar 24, 2016, 4:14:01 AM3/24/16
to jenkinsc...@googlegroups.com
Bruno Lavit edited a comment on Bug JENKINS-33690
Hi,

I have the same issue with Jenkins LTS 1.625.3, Email-ext plugin 2.40.5 and Template plugin 1.5.2.

I've tried to create a job template with the email-ext plugin and a "Script - After Build" trigger:
{ quote code:java }
build.logFile.text.readLines().any { it =~ /^Build step 'Jenkins Text Finder' changed build result to UNSTABLE/ }
{
quote code }

I got the same NPE in the job using the template:
{
quote code:java }
[TemplateProject] Starting publishers from: template - Docs
ERROR: Build step failed with exception
java.lang.NullPointerException
at hudson.plugins.emailext.plugins.trigger.AbstractScriptTrigger.createEngine(AbstractScriptTrigger.java:82)
at hudson.plugins.emailext.plugins.trigger.AbstractScriptTrigger.trigger(AbstractScriptTrigger.java:56)
at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:246)
at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:230)
at hudson.plugins.templateproject.ProxyPublisher.perform(ProxyPublisher.java:85)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1047)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
at hudson.model.Run.execute(Run.java:1766)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:408)

{ quote code }


slide.o.mix@gmail.com (JIRA)

unread,
Mar 24, 2016, 10:43:02 PM3/24/16
to jenkinsc...@googlegroups.com

Ok, I am able to reproduce this issue now and know what the issue is. I'll work on a fix. It will actually be a fix in the email-ext plugin, not the emailext-template plugin.

slide.o.mix@gmail.com (JIRA)

unread,
Mar 25, 2016, 1:05:02 AM3/25/16
to jenkinsc...@googlegroups.com
Alex Earl started work on Bug JENKINS-33690
 
Change By: Alex Earl
Status: Open In Progress

scm_issue_link@java.net (JIRA)

unread,
Mar 25, 2016, 10:19:02 AM3/25/16
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Alex Earl
Path:
src/main/java/hudson/plugins/emailext/plugins/trigger/AbstractScriptTrigger.java
src/test/java/hudson/plugins/emailext/AttachmentUtilsTest.java
http://jenkins-ci.org/commit/email-ext-plugin/6a17566feeab23d8a831bfbc30990ce54eae6c81
Log:
Fix JENKINS-33690

Removed explicit look for an ExtendedEmailPublisher instance to get the Jenkins url.

bruno.lavit@forgerock.com (JIRA)

unread,
Mar 25, 2016, 10:23:03 AM3/25/16
to jenkinsc...@googlegroups.com

slide.o.mix@gmail.com (JIRA)

unread,
Mar 26, 2016, 7:33:02 PM3/26/16
to jenkinsc...@googlegroups.com

gustavocdc@gmail.com (JIRA)

unread,
Mar 28, 2016, 7:48:02 AM3/28/16
to jenkinsc...@googlegroups.com

slide.o.mix@gmail.com (JIRA)

unread,
Apr 17, 2016, 9:53:01 PM4/17/16
to jenkinsc...@googlegroups.com

slide.o.mix@gmail.com (JIRA)

unread,
Apr 17, 2016, 9:53:02 PM4/17/16
to jenkinsc...@googlegroups.com
Alex Earl resolved as Fixed
Change By: Alex Earl
Status: In Progress Resolved
Resolution: Fixed

bruno.lavit@forgerock.com (JIRA)

unread,
Apr 18, 2016, 3:29:03 AM4/18/16
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages