[JIRA] (JENKINS-36748) Jobs with syntactically incorrect config missing the cron spec for a trigger produces NullPointerException

Visto 2 veces
Saltar al primer mensaje no leído

fbelzunc@gmail.com (JIRA)

no leída,
18 jul 2016, 2:23:0118/7/16
a jenkinsc...@googlegroups.com
Félix Belzunce Arcos created an issue
 
Jenkins / Bug JENKINS-36748
Jobs with syntactically incorrect config missing the cron spec for a trigger produces NullPointerException
Issue Type: Bug Bug
Assignee: Félix Belzunce Arcos
Components: core
Created: 2016/Jul/18 6:22 AM
Priority: Minor Minor
Reporter: Félix Belzunce Arcos

To re-produce you just need to use the https://wiki.jenkins-ci.org/display/JENKINS/GitHub+pull+request+builder+plugin and not use the "cron('H/5 * * * *')" as the documentation says.

Then, the following stacktrace is triggered:

Jun 23, 2016 10:35:00 AM hudson.triggers.Trigger$Cron doRun
WARNING: Cron thread throw an exception
java.lang.NullPointerException
    at hudson.triggers.Trigger.checkTriggers(Trigger.java:267)
    at hudson.triggers.Trigger$Cron.doRun(Trigger.java:221)
    at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:50)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

Any cron job on the instance will work because of this issue

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

fbelzunc@gmail.com (JIRA)

no leída,
18 jul 2016, 2:23:0218/7/16
a jenkinsc...@googlegroups.com
Félix Belzunce Arcos started work on Bug JENKINS-36748
 
Change By: Félix Belzunce Arcos
Status: Open In Progress

fbelzunc@gmail.com (JIRA)

no leída,
18 jul 2016, 2:47:0318/7/16
a jenkinsc...@googlegroups.com

dbeck@cloudbees.com (JIRA)

no leída,
25 jul 2016, 5:44:0125/7/16
a jenkinsc...@googlegroups.com
Daniel Beck resolved as Fixed
 

Fixed in 2.15

Change By: Daniel Beck
Status: In Progress Resolved
Resolution: Fixed

jglick@cloudbees.com (JIRA)

no leída,
27 jul 2016, 9:13:0127/7/16
a jenkinsc...@googlegroups.com
Jesse Glick commented on Bug JENKINS-36748
 
Re: Jobs with syntactically incorrect config missing the cron spec for a trigger produces NullPointerException

I would say this may not have been a defect to begin with. The plugin documentation describes the proper usage of this trigger with Job DSL. The Jenkins GUI will ensure that cron is non-null, but from a scripted client like Job DSL you are expected to define all mandatory fields. If cron is meaningfully optional in this context—some Trigger implementations do not really require it, because they have an empty run, though I think this one does—then Trigger.readResolve should set it to the empty string rather than null.

dbeck@cloudbees.com (JIRA)

no leída,
27 jul 2016, 9:26:0127/7/16
a jenkinsc...@googlegroups.com

Jesse Glick It's ugly – further investigation showed that the problem is that GhprbTrigger#readResolve doesn't call super.readResolve() – which would prevent the invalid trigger from being created.

Still a valid robustness improvement IMO.

scm_issue_link@java.net (JIRA)

no leída,
24 ago 2016, 19:15:0224/8/16
a jenkinsc...@googlegroups.com

Code changed in jenkins
User: Felix Belzunce Arcos
Path:
core/src/main/java/hudson/triggers/Trigger.java
test/src/test/java/hudson/triggers/TriggerTest.java
http://jenkins-ci.org/commit/jenkins/4278804582b34f123414bde521bd91b009d8e353
Log:
JENKINS-36748 Do not process null specs in triggers (#2482)

o.v.nenashev@gmail.com (JIRA)

no leída,
27 ago 2016, 17:12:0527/8/16
a jenkinsc...@googlegroups.com

dbeck@cloudbees.com (JIRA)

no leída,
31 ago 2016, 14:56:0831/8/16
a jenkinsc...@googlegroups.com

ogondza@gmail.com (JIRA)

no leída,
9 sept 2016, 3:04:059/9/16
a jenkinsc...@googlegroups.com

scm_issue_link@java.net (JIRA)

no leída,
9 sept 2016, 5:05:019/9/16
a jenkinsc...@googlegroups.com

Code changed in jenkins
User: Felix Belzunce Arcos
Path:
core/src/main/java/hudson/triggers/Trigger.java
test/src/test/java/hudson/triggers/TriggerTest.java


Log:
JENKINS-36748 Do not process null specs in triggers (#2482)

(cherry picked from commit 4278804582b34f123414bde521bd91b009d8e353)

Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos