Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-34021

NPE: Failed to abort CpsFlowExecutiontask.DurableTaskStep$Execution.stop(DurableTaskStep.java:140)

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      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)
      

        Attachments

          Issue Links

            Activity

            ssbarnea Sorin Sbarnea created issue -
            Hide
            ssbarnea Sorin Sbarnea added a comment -

            I am getting again the same bug, any ideas?

            Show
            ssbarnea Sorin Sbarnea added a comment - I am getting again the same bug, any ideas?
            ssbarnea Sorin Sbarnea made changes -
            Field Original Value New Value
            Link This issue is related to JENKINS-28183 [ JENKINS-28183 ]
            Hide
            jglick Jesse Glick added a comment -

            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?

            Show
            jglick Jesse Glick added a comment - 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 Jesse Glick made changes -
            Remote Link This issue links to "workflow-durable-task-step PR 7 (Web Link)" [ 14513 ]
            jglick Jesse Glick made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            Hide
            jglick Jesse Glick added a comment -

            Symptom fixed. Root cause unknown.

            Show
            jglick Jesse Glick added a comment - Symptom fixed. Root cause unknown.
            jglick Jesse Glick made changes -
            Status In Progress [ 3 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 170039 ] JNJira + In-Review [ 198769 ]
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            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

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - 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 Jesse Glick made changes -
            Link This issue depends on JENKINS-37486 [ JENKINS-37486 ]
            abayer Andrew Bayer made changes -
            Component/s pipeline-general [ 21692 ]
            abayer Andrew Bayer made changes -
            Component/s workflow-plugin [ 18820 ]
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-39134 [ JENKINS-39134 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "workflow-durable-task-step PR 28 (Web Link)" [ 15340 ]
            jglick Jesse Glick made changes -
            Component/s workflow-durable-task-step-plugin [ 21715 ]
            Component/s pipeline [ 21692 ]
            Hide
            amuniz Antonio Muñiz added a comment -

            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.

            Show
            amuniz Antonio Muñiz added a comment - 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.
            Hide
            benh57 Ben Hines added a comment -

            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.

            Show
            benh57 Ben Hines added a comment - 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.
            Hide
            jglick Jesse Glick added a comment -

            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.

            Show
            jglick Jesse Glick added a comment - 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.
            Hide
            amuniz Antonio Muñiz added a comment - - edited
            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 swallows the request and retries 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.

            Show
            amuniz Antonio Muñiz added a comment - - edited Jenkins 2.32 (with all default plugins, which I think is latest versions) workflow-basic-steps-plugin didn't have the fix for retry 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 swallows the request and 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 Jesse Glick I hope it helps.
            Hide
            jglick Jesse Glick added a comment -

            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.

            Show
            jglick Jesse Glick added a comment - 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.
            jglick Jesse Glick made changes -
            Remote Link This issue links to "PR 33 (Web Link)" [ 15624 ]
            Hide
            akostadinov akostadinov added a comment -

            Seeing a lot of these in the log:

            Jul 31, 2017 3:25:52 PM WARNING org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution logger
            
            JENKINS-34021: could not get TaskListener in CpsStepContext[15:sh]:Owner[New_Puddle_Detector/192:New_Puddle_Detector #192]
            java.io.IOException: cannot find current thread
            	at org.jenkinsci.plugins.workflow.cps.CpsStepContext.doGet(CpsStepContext.java:295)
            	at org.jenkinsci.plugins.workflow.support.DefaultStepContext.get(DefaultStepContext.java:61)
            	at org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.logger(DurableTaskStep.java:209)
            	at org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.access$700(DurableTaskStep.java:139)
            	at org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution$3.call(DurableTaskStep.java:308)
            	at org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution$3.call(DurableTaskStep.java:306)
            	at org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution$4.call(DurableTaskStep.java:359)
            	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:748)
            
            

            Any ideas how to debug what is causing the issue?

            Show
            akostadinov akostadinov added a comment - Seeing a lot of these in the log: Jul 31, 2017 3:25:52 PM WARNING org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution logger JENKINS-34021: could not get TaskListener in CpsStepContext[15:sh]:Owner[New_Puddle_Detector/192:New_Puddle_Detector #192] java.io.IOException: cannot find current thread at org.jenkinsci.plugins.workflow.cps.CpsStepContext.doGet(CpsStepContext.java:295) at org.jenkinsci.plugins.workflow.support.DefaultStepContext.get(DefaultStepContext.java:61) at org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.logger(DurableTaskStep.java:209) at org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.access$700(DurableTaskStep.java:139) at org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution$3.call(DurableTaskStep.java:308) at org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution$3.call(DurableTaskStep.java:306) at org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution$4.call(DurableTaskStep.java:359) 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:748) Any ideas how to debug what is causing the issue?
            Hide
            jglick Jesse Glick added a comment -

            akostadinov I think you are running an old version of the plugin.

            Show
            jglick Jesse Glick added a comment - akostadinov I think you are running an old version of the plugin.
            jamesdumay James Dumay made changes -
            Remote Link This issue links to "CloudBees Internal OSS-2020 (Web Link)" [ 18456 ]

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                ssbarnea Sorin Sbarnea
              • Votes:
                1 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: