[JIRA] [workflow-plugin] (JENKINS-34021) NPE: Failed to abort CpsFlowExecutiontask.DurableTaskStep$Execution.stop(DurableTaskStep.java:140)

8 views
Skip to first unread message

sorin.sbarnea@gmail.com (JIRA)

unread,
Apr 5, 2016, 7:10:01 AM4/5/16
to jenkinsc...@googlegroups.com
Sorin Sbarnea created an issue
 
Jenkins / Bug JENKINS-34021
NPE: Failed to abort CpsFlowExecutiontask.DurableTaskStep$Execution.stop(DurableTaskStep.java:140)
Issue Type: Bug Bug
Assignee: Jesse Glick
Components: workflow-plugin
Created: 2016/Apr/05 11:09 AM
Priority: Critical Critical
Reporter: Sorin Sbarnea
Apr 05, 2016 10:56:52 AM org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$6 onSuccess
WARNING: Failed to abort CpsFlowExecution[Owner[bmlltech/lux/master/2:bmlltech/lux/master #2]]
java.lang.NullPointerException
	at org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.stop(DurableTaskStep.java:140)
	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$6.onSuccess(CpsFlowExecution.java:760)
	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$6.onSuccess(CpsFlowExecution.java:755)
	at org.jenkinsci.plugins.workflow.support.concurrent.Futures$1.run(Futures.java:150)
	at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:253)
	at com.google.common.util.concurrent.ExecutionList$RunnableExecutorPair.execute(ExecutionList.java:149)
	at com.google.common.util.concurrent.ExecutionList.execute(ExecutionList.java:134)
	at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:170)
	at com.google.common.util.concurrent.SettableFuture.set(SettableFuture.java:53)
	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$5.onSuccess(CpsFlowExecution.java:644)
	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$5.onSuccess(CpsFlowExecution.java:631)
	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution$4$1.run(CpsFlowExecution.java:568)
	at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$1.run(CpsVmExecutorService.java:32)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	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)
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

sorin.sbarnea@gmail.com (JIRA)

unread,
Apr 25, 2016, 4:36:01 PM4/25/16
to jenkinsc...@googlegroups.com

jglick@cloudbees.com (JIRA)

unread,
May 19, 2016, 10:39:03 AM5/19/16
to jenkinsc...@googlegroups.com

If you are still using the doDelete hack, stop. As of

JENKINS-25550 it is no longer necessary.

Offhand it looks like DurableTaskStep.Execution.listener is null, which should not happen, and I cannot really guess why. Is there a known way to reproduce?

jglick@cloudbees.com (JIRA)

unread,
Jun 15, 2016, 4:46:01 PM6/15/16
to jenkinsc...@googlegroups.com
Jesse Glick started work on Bug JENKINS-34021
 
Change By: Jesse Glick
Status: Open In Progress
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

jglick@cloudbees.com (JIRA)

unread,
Jul 6, 2016, 4:19:01 PM7/6/16
to jenkinsc...@googlegroups.com
Jesse Glick resolved as Fixed
 

Symptom fixed. Root cause unknown.

Change By: Jesse Glick
Status: In Progress Resolved
Resolution: Fixed

scm_issue_link@java.net (JIRA)

unread,
Aug 3, 2016, 12:40:13 PM8/3/16
to jenkinsc...@googlegroups.com
SCM/JIRA link daemon commented on Bug JENKINS-34021
 
Re: NPE: Failed to abort CpsFlowExecutiontask.DurableTaskStep$Execution.stop(DurableTaskStep.java:140)

Code changed in jenkins
User: Jesse Glick
Path:
durable-task-step/src/main/java/org/jenkinsci/plugins/workflow/steps/durable_task/DurableTaskStep.java
http://jenkins-ci.org/commit/pipeline-plugin/344aa77547276f9ddd260868276ff0c535340bb7
Log:
JENKINS-34021 If DurableTaskStep.Execution.listener is sometimes null
Backported from https://github.com/jenkinsci/workflow-durable-task-step-plugin/pull/7.

Compare: https://github.com/jenkinsci/pipeline-plugin/compare/fe82acdc7a93...344aa7754727

jglick@cloudbees.com (JIRA)

unread,
Jan 26, 2017, 2:19:01 PM1/26/17
to jenkinsc...@googlegroups.com
Jesse Glick updated an issue
 
Change By: Jesse Glick
Component/s: workflow-durable-task-step-plugin
Component/s: pipeline

amuniz@cloudbees.com (JIRA)

unread,
Feb 23, 2017, 4:15:02 AM2/23/17
to jenkinsc...@googlegroups.com
Antonio Muñiz commented on Bug JENKINS-34021
 
Re: NPE: Failed to abort CpsFlowExecutiontask.DurableTaskStep$Execution.stop(DurableTaskStep.java:140)

Reproducible by hard killing this:

retry (10) {
    node { 
        sh 'sleep 30'   
    }
}

The I see the warning message in the logs indefinitely.

Maybe this specific case is fixed by https://github.com/jenkinsci/workflow-basic-steps-plugin/pull/35, I don't know, didn't try.

bhines@alumni.ucsd.edu (JIRA)

unread,
Feb 23, 2017, 7:09:02 PM2/23/17
to jenkinsc...@googlegroups.com

We are also experiencing this error log spam, i suspect after hard killing a job too, but i wasn't able to reproduce the error log spam using Antonio's test script and /kill on the job.

Though that was on a different instance of Jenkins with some slightly different plugin versions. Tried both 2.3 and 2.4 of basic steps.

jglick@cloudbees.com (JIRA)

unread,
Feb 24, 2017, 1:20:02 PM2/24/17
to jenkinsc...@googlegroups.com

Antonio Muñiz please reopen if you know exactly how to reproduce from scratch. Need to know plugin versions and exactly what you did to kill the build.

amuniz@cloudbees.com (JIRA)

unread,
Mar 7, 2017, 5:50:02 AM3/7/17
to jenkinsc...@googlegroups.com
  1. Jenkins 2.32 (with all default plugins, which I think is latest versions)
  2. workflow-basic-steps-plugin didn't have the fix for retry at that time (which makes the case easier to reproduce)
  3. Create a pipeline with the script I posted before
  4. Trigger a build
  5. Click on the build stop button
  6. retry swallow the request and retry its body
  7. The halt link is printed in the console log, click on it
  8. The kill link is printed in the console log, click on it
  9. The build is killed, but a warning is continuously printed in Jenkins global log

Jesse Glick I hope it helps.

This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

jglick@cloudbees.com (JIRA)

unread,
Mar 7, 2017, 3:27:02 PM3/7/17
to jenkinsc...@googlegroups.com

With 2.32.3, workflow-durable-task-step 2.9, and workflow-cps 2.29, and this script

while (true) {
    try {
        node {
            sh 'sleep 30'
        }
    } catch (e) {
        echo "ignoring $e"
    }
}

I do get some errors, mainly

java.io.IOException: cannot find current thread
	at org.jenkinsci.plugins.workflow.cps.CpsStepContext.doGet(CpsStepContext.java:296)
	at org.jenkinsci.plugins.workflow.support.DefaultStepContext.get(DefaultStepContext.java:61)
	at org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.logger(DurableTaskStep.java:200)
	at org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.check(DurableTaskStep.java:301)
	at org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.run(DurableTaskStep.java:276)
	at …

Everything does stop cleanly and there are no recurring warnings.

amuniz@cloudbees.com (JIRA)

unread,
Mar 17, 2017, 7:04:01 AM3/17/17
to jenkinsc...@googlegroups.com
Antonio Muñiz edited a comment on Bug JENKINS-34021
# Jenkins 2.32 (with all default plugins, which I think is latest versions)
# {{workflow-basic-steps-plugin}} didn't have [the fix for retry|https://github.com/jenkinsci/workflow-basic-steps-plugin/pull/35] at that time (which makes the case easier to reproduce)
# Create a pipeline with the script I posted before
# Trigger a build
# Click on the build stop button
# {{retry}}
swallow swallows the request and retry retries its body
# The halt link is printed in the console log, click on it
# The kill link is printed in the console log, click on it
# The build is killed, but a warning is continuously printed in Jenkins global log

[~jglick] I hope it helps.
Reply all
Reply to author
Forward
0 new messages