[JIRA] (JENKINS-38763) NPE while loading build with workflow job

2 views
Skip to first unread message

olamy@apache.org (JIRA)

unread,
Oct 5, 2016, 7:40:01 PM10/5/16
to jenkinsc...@googlegroups.com
olamy created an issue
 
Jenkins / Bug JENKINS-38763
NPE while loading build with workflow job
Issue Type: Bug Bug
Assignee: Unassigned
Components: workflow-job-plugin
Created: 2016/Oct/05 11:39 PM
Priority: Major Major
Reporter: olamy

I have a plugin https://github.com/olamy/loadgenerator-plugin.
The pipeline generate a NPE (because of lazyLoading I guess).
Is there any way to avoid that?

SEVERE: Could not load actions from jenkins.tasks.SimpleBuildStep$LastBuildActionFactory@c048368 for org.jenkinsci.plugins.workflow.job.WorkflowJob@108825b[pipeline-test]
java.lang.NullPointerException
	at org.jenkinsci.plugins.workflow.job.WorkflowJob.getLastBuild(WorkflowJob.java:235)
	at org.jenkinsci.plugins.workflow.job.WorkflowJob.getLastBuild(WorkflowJob.java:105)
	at com.webtide.jetty.load.generator.jenkins.LoadGeneratorProjectAction.<init>(LoadGeneratorProjectAction.java:63)
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

jglick@cloudbees.com (JIRA)

unread,
Oct 24, 2016, 4:08:06 PM10/24/16
to jenkinsc...@googlegroups.com
Jesse Glick resolved as Cannot Reproduce
 

The buildMixIn should be initialized in all usage modes. If it is unset, something is deeply wrong with the Jenkins item tree. Any known way to reproduce from scratch?

Change By: Jesse Glick
Status: Open Resolved
Resolution: Cannot Reproduce

olamy@apache.org (JIRA)

unread,
Oct 24, 2016, 8:22:01 PM10/24/16
to jenkinsc...@googlegroups.com
olamy commented on Bug JENKINS-38763
 
Re: NPE while loading build with workflow job

Resolved? really
I'm reproducing that everyday until the first run of the project.
The code plugin is here: https://github.com/olamy/loadgenerator-plugin
Line https://github.com/olamy/loadgenerator-plugin/blob/master/src/main/java/com/webtide/jetty/load/generator/jenkins/LoadGeneratorProjectAction.java#L66
I have added an ugly workaround to prevent NPE.
Well after the job has been executed, it works again and I can see previous results.
Not a big problem but not really convenient when developing the plugin and restarted very frequently (hpi:run)

olamy@apache.org (JIRA)

unread,
Oct 24, 2016, 8:22:03 PM10/24/16
to jenkinsc...@googlegroups.com
olamy reopened an issue
 
Change By: olamy
Resolution: Cannot Reproduce
Status: Resolved Reopened

jglick@cloudbees.com (JIRA)

unread,
Oct 25, 2016, 2:13:01 PM10/25/16
to jenkinsc...@googlegroups.com
Jesse Glick commented on Bug JENKINS-38763
 
Re: NPE while loading build with workflow job

I know nothing about the thing you are pointing to. Are there specific instructions to reproduce the problem from scratch?

olamy@apache.org (JIRA)

unread,
Oct 25, 2016, 5:25:05 PM10/25/16
to jenkinsc...@googlegroups.com
olamy commented on Bug JENKINS-38763

This is a plugin I'm hacking and I got the issue with.
By the way the issue happen with non pipeline project as well.
I have created a sample plugin to reproduce.
https://github.com/olamy/JENKINS-38763
use

mvn hpi:run

Use this plugin as a build step. Run one build.
Now restart hpi:run then go to the project page see the logs.
Run the project once again no more NPE.

Caused by: java.lang.NullPointerException
    at hudson.model.AbstractProject._getRuns (AbstractProject.java:954)
    at hudson.model.AbstractProject._getRuns (AbstractProject.java:145)
    at hudson.model.Job.getBuilds (Job.java:683)
    at org.olamy.jenkins.foo.FooProjectAction.getData (FooProjectAction.java:37)
    at org.olamy.jenkins.foo.FooProjectAction.doTrend (FooProjectAction.java:32)

I hope it help to reproduce.

jglick@cloudbees.com (JIRA)

unread,
Oct 26, 2016, 3:54:01 PM10/26/16
to jenkinsc...@googlegroups.com
Jesse Glick resolved as Not A Defect
 

The mistake is in your sample plugin. FooProjectAction.project should be made transient and initialized by implementing RunAction2.

Change By: Jesse Glick
Status: Reopened Resolved
Resolution: Not A Defect

olamy@apache.org (JIRA)

unread,
Oct 27, 2016, 12:41:04 AM10/27/16
to jenkinsc...@googlegroups.com
olamy commented on Bug JENKINS-38763
 
Re: NPE while loading build with workflow job

Oh I didn't know this trick Thanks a lot Jesse Glick

Reply all
Reply to author
Forward
0 new messages