[JIRA] [build-flow-plugin] (JENKINS-33235) post groovy script throws Null Exception

6 views
Skip to first unread message

gauthamrathinakumar@gmail.com (JIRA)

unread,
Mar 1, 2016, 5:24:01 AM3/1/16
to jenkinsc...@googlegroups.com
Gautham Rathina kumar created an issue
 
Jenkins / Bug JENKINS-33235
post groovy script throws Null Exception
Issue Type: Bug Bug
Assignee: Unassigned
Components: build-flow-plugin, groovy-postbuild-plugin
Created: 01/Mar/16 10:23 AM
Environment: jenkins version-1.644
Plugins
ant 1.2 true false
antisamy-markup-formatter 1.1 true false
build-flow-extensions-plugin 0.1.1 true false
build-flow-plugin 0.18 true false
build-flow-test-aggregator 1.2 true false
build-name-setter 1.5.1 true false
buildgraph-view 1.1.1 true false
conditional-buildstep 1.3.3 true false
credentials 1.18 true false
cvs 2.11 true false
email-ext 2.41.3 true false
envinject 1.92.1 true false
external-monitor-job 1.4 true false
fail-the-build-plugin 1.0 true false
groovy-postbuild 2.3.1 true false
javadoc 1.1 true false
jenkins-multijob-plugin 1.20 true false
junit 1.10 true true
ldap 1.11 true false
mailer 1.11 true false
matrix-auth 1.1 true false
matrix-project 1.4.1 true false
maven-plugin 2.7.1 true false
pam-auth 1.1 true false
parameterized-trigger 2.30 true false
run-condition 1.0 true false
script-security 1.17 true true
simple-theme-plugin 0.3 true false
ssh-credentials 1.10 true false
ssh-slaves 1.9 true false
subversion 1.54 true false
tag-profiler 0.2 true false
token-macro 1.12.1 true false
translation 1.10 true false
ui-samples-plugin 2.0 true false
windows-slaves 1.0 true false
Priority: Major Major
Reporter: Gautham Rathina kumar

I am using the build flow project for combining the two different project test results.Then i am in need to change the build status of the aggregated test results so i am using groovy postbuild to change my build status.In that script if any one of the test fails gets failed in any of the projects then i am trying to change the build status to unstable.For that i am calculating the fail counts from both results using groovy script.But when i am trying this it throws the NULL pointer Exception.
The script i used in the groovy postbuild is

def testResult = manager.build.testResultAction.result
def fail = testResult.failCount
if(fail==NULL)

{ manager.buildSuccess() }

else

{ manager.buildUnstable() }

It throws the exception as
ava.lang.NullPointerException: Cannot get property 'result' on null object
at org.codehaus.groovy.runtime.NullObject.getProperty(NullObject.java:56)
at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:156)
at org.codehaus.groovy.runtime.callsite.NullCallSite.getProperty(NullCallSite.java:44)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:227)
at Script1.run(Script1.groovy:1)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:580)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:618)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:589)
at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SecureGroovyScript.evaluate(SecureGroovyScript.java:166)
at org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder.perform(GroovyPostbuildRecorder.java:362)
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)

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

devld@ikedam.jp (JIRA)

unread,
Mar 2, 2016, 6:35:01 AM3/2/16
to jenkinsc...@googlegroups.com
ikedam commented on Bug JENKINS-33235
 
Re: post groovy script throws Null Exception

I can't get what you want at all.
It threw null pointer exception as you accessed null.
It is an issue not of plugins, but of your script, isn't it?

gauthamrathinakumar@gmail.com (JIRA)

unread,
Mar 3, 2016, 12:57:01 AM3/3/16
to jenkinsc...@googlegroups.com

i dont think so because i tested some code taken from GITHUB it also throws the same type of exception

devld@ikedam.jp (JIRA)

unread,
Mar 3, 2016, 4:38:02 AM3/3/16
to jenkinsc...@googlegroups.com
ikedam resolved as Not A Defect
 
Change By: ikedam
Status: Open Resolved
Resolution: Not A Defect

devld@ikedam.jp (JIRA)

unread,
Mar 3, 2016, 4:52:01 AM3/3/16
to jenkinsc...@googlegroups.com
ikedam commented on Bug JENKINS-33235
 
Re: post groovy script throws Null Exception

It's not a bug of plugins, but the issue of the user script or the configuration.

Jenkins users group might help you if you don't know how to write groovy codes.

gauthamrathinakumar@gmail.com (JIRA)

unread,
Mar 3, 2016, 4:55:02 AM3/3/16
to jenkinsc...@googlegroups.com

can u please check the code that is given below and tell me whether the code is or not

gauthamrathinakumar@gmail.com (JIRA)

unread,
Mar 3, 2016, 4:55:03 AM3/3/16
to jenkinsc...@googlegroups.com
Gautham Rathina kumar reopened an issue
 
Change By: Gautham Rathina kumar
Resolution: Not A Defect
Status: Resolved Reopened

devld@ikedam.jp (JIRA)

unread,
Mar 3, 2016, 6:37:07 PM3/3/16
to jenkinsc...@googlegroups.com
ikedam updated an issue

No.
Here is not the place to review your configuration.
And I already checked your code and said it threw NPE as you accessed null, and that's all.
If you yet can't get what I mean, try following code. It causes the same result with your code and it shows that this is an issue of your code:

null.result
Change By: ikedam
Component/s: groovy-postbuild-plugin
Reply all
Reply to author
Forward
0 new messages