[JIRA] [workflow-plugin] (JENKINS-26761) WorkflowJob.getSCMs throws NullPointerException from notifyCommit hooks after Jenkins Restart

240 views
Skip to first unread message

hahn@univention.de (JIRA)

unread,
May 6, 2015, 7:48:02 AM5/6/15
to jenkinsc...@googlegroups.com
Philipp Hahn commented on Bug JENKINS-26761
 
Re: WorkflowJob.getSCMs throws NullPointerException from notifyCommit hooks after Jenkins Restart

We have the same issue, but with using SVN instead of GIT.

After manually running the Job the SVN commit trigger started working again.

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

dev@baltrinic.com (JIRA)

unread,
May 21, 2015, 11:05:09 AM5/21/15
to jenkinsc...@googlegroups.com

FYI, this problem has yet again disappeared for us, but I will add the loggers and take the other debug steps mentioned should it re-appear.

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

unread,
May 27, 2015, 9:38:03 AM5/27/15
to jenkinsc...@googlegroups.com

jglick@cloudbees.com (JIRA)

unread,
Jul 22, 2015, 11:11:02 AM7/22/15
to jenkinsc...@googlegroups.com
Jesse Glick commented on Bug JENKINS-26761
 
Re: WorkflowJob.getSCMs throws NullPointerException from notifyCommit hooks after Jenkins Restart

A user reported that this is reproducible iff multiple jobs share a clone URL, but I have not yet managed to reproduce via the existing test:

diff --git a/aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/scm/GitStepRestartTest.java b/aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/scm/GitStepRestartTest.java
index bcf6da9..84276e9 100644
--- a/aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/scm/GitStepRestartTest.java
+++ b/aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/scm/GitStepRestartTest.java
@@ -76,6 +76,16 @@ public class GitStepRestartTest {
                 p.save();
                 WorkflowRun b = r.j.assertBuildStatusSuccess(p.scheduleBuild2(0));
                 r.j.assertLogContains("Cloning the remote Git repository", b);
+                p = r.j.jenkins.createProject(WorkflowJob.class, "p2");
+                p.addTrigger(new SCMTrigger(""));
+                p.setDefinition(new CpsFlowDefinition(
+                    "node('remote') {\n" +
+                    "    ws {\n" +
+                    "        git($/" + sampleRepo + "/$)\n" +
+                    "    }\n" +
+                    "}"));
+                p.save();
+                b = r.j.assertBuildStatusSuccess(p.scheduleBuild2(0));
             }
         });
         r.addStep(new Statement() {

jglick@cloudbees.com (JIRA)

unread,
Jul 22, 2015, 11:11:05 AM7/22/15
to jenkinsc...@googlegroups.com

jglick@cloudbees.com (JIRA)

unread,
Jul 28, 2015, 11:16:06 AM7/28/15
to jenkinsc...@googlegroups.com
 
Re: WorkflowJob.getSCMs throws NullPointerException from notifyCommit hooks after Jenkins Restart

I filed https://github.com/jenkinsci/workflow-plugin/pull/160 so if anyone is consistently affected by this, you may want to install a snapshot build from that and see if it helps. (Requires 1.609.x+; could be backported to 1.580.x as needed.)

scm_issue_link@java.net (JIRA)

unread,
Jul 29, 2015, 10:43:02 AM7/29/15
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Jesse Glick
Path:
job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java
job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java
http://jenkins-ci.org/commit/workflow-plugin/7d21f2d187a9f8973df403b47b5efd66e6b00bd2
Log:
JENKINS-26761 Recover gracefully from null WorkflowRun.checkouts, printing some diagnostics.

scm_issue_link@java.net (JIRA)

unread,
Jul 29, 2015, 10:43:03 AM7/29/15
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Jesse Glick
Path:

job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java
http://jenkins-ci.org/commit/workflow-plugin/ad9b6caf0428b9c85601ef9d349ca2691b7055be
Log:
JENKINS-26761 Try using a PersistedList rather than a LinkedList for new WorkflowRun.checkouts.
(Existing build records will continue to use LinkedList.) Possible advantages:
· If the bug was caused by an unreported failure to serialize/deserialize an SCM instance,
this would create a polite “old data” record instead.
(CopyOnWriteArrayList would also work, via RobustCollectionConverter.)
· The backing store is CopyOnWriteList, solving a hypothetical ConcurrentModificationException.
· Additions from onCheckout should be saved to disk immediately, rather than waiting for some other save trigger.

scm_issue_link@java.net (JIRA)

unread,
Jul 29, 2015, 10:44:01 AM7/29/15
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Jesse Glick
Path:

CHANGES.md
aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/scm/GitStepRestartTest.java
job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java
job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java
http://jenkins-ci.org/commit/workflow-plugin/f6f21ae0f0bf0d7970b3ae2372b1501717938ec4
Log:
JENKINS-26761 Merging #160.

Compare: https://github.com/jenkinsci/workflow-plugin/compare/121889f5cf4c...f6f21ae0f0bf

scm_issue_link@java.net (JIRA)

unread,
Jul 29, 2015, 4:52:07 PM7/29/15
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Jesse Glick
Path:

aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/scm/GitStepRestartTest.java
job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java
job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java
http://jenkins-ci.org/commit/workflow-plugin/11b2bb5d98ce023864ce9e09c957a0eb5b140721
Log:
JENKINS-26761 Merging #160.

(cherry picked from commit f6f21ae0f0bf0d7970b3ae2372b1501717938ec4)

Conflicts:
CHANGES.md
aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/scm/GitStepRestartTest.java
job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java

Compare: https://github.com/jenkinsci/workflow-plugin/compare/22c0ce651ef5^...11b2bb5d98ce

scm_issue_link@java.net (JIRA)

unread,
Jul 29, 2015, 5:15:01 PM7/29/15
to jenkinsc...@googlegroups.com

andrew.bayer@gmail.com (JIRA)

unread,
Dec 11, 2015, 1:24:04 PM12/11/15
to jenkinsc...@googlegroups.com

jglick@cloudbees.com (JIRA)

unread,
Jan 11, 2016, 6:27:05 PM1/11/16
to jenkinsc...@googlegroups.com

Yes, because the underlying problem was never resolved. The NPE is gone, but there is still something seriously wrong during deserialization of which the NPE was just a symptom.

dev@baltrinic.com (JIRA)

unread,
Jan 28, 2016, 8:05:13 AM1/28/16
to jenkinsc...@googlegroups.com

For what its worth we just got bit by this again on a machine w/an older version for workflow. As we now have Cloudbees support I opened an internal ticket (ironically failing to recognize the problem as being this one , and that ticket has an attached support bundle in case it helps run down the problem. See Cloudbees ZenDesk ticket #32944.

dev@baltrinic.com (JIRA)

unread,
Jan 28, 2016, 8:07:01 AM1/28/16
to jenkinsc...@googlegroups.com
Kenneth Baltrinic edited a comment on Bug JENKINS-26761
For what its worth we just got bit by this again on a machine w/an older version for workflow.  As we now have Cloudbees support I opened an internal ticket (ironically failing to recognize the problem as being this one :-)  ) , and that ticket has an attached support bundle in case it helps run down the problem.  See  Cloudbees ZenDesk ticket #32944.

jglick@cloudbees.com (JIRA)

unread,
Feb 1, 2016, 3:18:01 AM2/1/16
to jenkinsc...@googlegroups.com

I suspect this is actually just one of many symptoms of

JENKINS-22767 . If so, it should quietly disappear in 1.646+.

jglick@cloudbees.com (JIRA)

unread,
Mar 3, 2016, 3:40:02 PM3/3/16
to jenkinsc...@googlegroups.com
Jesse Glick resolved as Cannot Reproduce
 

Closing therefore.

Change By: Jesse Glick
Status: In Progress Resolved
Resolution: Cannot Reproduce

scm_issue_link@java.net (JIRA)

unread,
Apr 5, 2016, 4:19:08 PM4/5/16
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Jesse Glick
Path:

aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/scm/GitStepRestartTest.java
http://jenkins-ci.org/commit/workflow-scm-step-plugin/9c10531b3956312f7463a7d66ce45ad2b3f5c3fd
Log:

JENKINS-26761 Verifying that polling still works after a restart.
Originally-Committed-As: 646b3d58647012025e1f94081a7ce5be7ded65b3

scm_issue_link@java.net (JIRA)

unread,
Apr 5, 2016, 4:31:45 PM4/5/16
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Jesse Glick
Path:

job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowJob.java
job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java
http://jenkins-ci.org/commit/workflow-job-plugin/34802c5bfbccdf481794dce9409deeb2dfcfa9b1
Log:

JENKINS-26761 Recover gracefully from null WorkflowRun.checkouts, printing some diagnostics.
Originally-Committed-As: 7d21f2d187a9f8973df403b47b5efd66e6b00bd2

scm_issue_link@java.net (JIRA)

unread,
Apr 5, 2016, 4:31:46 PM4/5/16
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Jesse Glick
Path:

job/src/main/java/org/jenkinsci/plugins/workflow/job/WorkflowRun.java
http://jenkins-ci.org/commit/workflow-job-plugin/c1eb2e285c8264bf05dfc9b64ba1750c339818fe
Log:

JENKINS-26761 Try using a PersistedList rather than a LinkedList for new WorkflowRun.checkouts.
(Existing build records will continue to use LinkedList.) Possible advantages:
· If the bug was caused by an unreported failure to serialize/deserialize an SCM instance,
this would create a polite “old data” record instead.
(CopyOnWriteArrayList would also work, via RobustCollectionConverter.)
· The backing store is CopyOnWriteList, solving a hypothetical ConcurrentModificationException.
· Additions from onCheckout should be saved to disk immediately, rather than waiting for some other save trigger.
Originally-Committed-As: ad9b6caf0428b9c85601ef9d349ca2691b7055be
Reply all
Reply to author
Forward
0 new messages