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

Pipeline hides the cause of AbortException and make it harder to diagnose the root cause

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • workflow-cps-plugin
    • None
    • Jenkins ver. 2.7.21.1
      Pipeline 2.4

      When an AbortException is raised in a pipeline build, the console only display the String message of the AbortException (e.g. "ERROR: 'copyRemoteArtifacts' step could not complete") and does not display the stack trace that would help greatly to understand the cause.

      I had to wrap my failing step in "try {}catch(){}" to discover the root cause.

      I got a generic message that does not explain the cause :

      ERROR: 'copyRemoteArtifacts' step could not complete
      

      When the root exception displayed by "try {}catch(){}" was clear:

      hudson.AbortException: 'copyRemoteArtifacts' step could not complete
        at com.cloudbees.opscenter.artifacts.RemoteArtifactCopyStepExecution.abort(RemoteArtifactCopyStepExecution.java:159)
        at com.cloudbees.opscenter.artifacts.RemoteArtifactCopyStepExecution.run(RemoteArtifactCopyStepExecution.java:108)
        at com.cloudbees.opscenter.artifacts.RemoteArtifactCopyStepExecution.run(RemoteArtifactCopyStepExecution.java:34)
        at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:52)
        at hudson.security.ACL.impersonate(ACL.java:213)
        at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:49)
        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)
      Caused by: java.util.concurrent.ExecutionException: java.io.IOException: Source job does not exist or you do not have permission to see the source job
        at com.cloudbees.opscenter.context.rpc.RPCFuture.get(RPCFuture.java:272)
        at com.cloudbees.opscenter.artifacts.RemoteArtifactCopyCallable.invoke(RemoteArtifactCopyCallable.java:237)
        at com.cloudbees.opscenter.artifacts.RemoteArtifactCopyCallable.invoke(RemoteArtifactCopyCallable.java:174)
        at com.cloudbees.opscenter.artifacts.RemoteArtifactCopyStepExecution.run(RemoteArtifactCopyStepExecution.java:103)
        ... 9 more
      Caused by: java.io.IOException: Source job does not exist or you do not have permission to see the source job
        at com.cloudbees.opscenter.artifacts.RemoteArtifactCopyCallable.call(RemoteArtifactCopyCallable.java:447)
        at com.cloudbees.opscenter.artifacts.RemoteArtifactCopyCallable.call(RemoteArtifactCopyCallable.java:59)
        at com.cloudbees.opscenter.context.remote.RemoteAuthentication.impersonate(RemoteAuthentication.java:88)
        at com.cloudbees.opscenter.context.rpc.RPCRequest$1.call(RPCRequest.java:217)
        at hudson.remoting.LocalChannel$1.call(LocalChannel.java:52)
        at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
        ... 4 more
      

          [JENKINS-40026] Pipeline hides the cause of AbortException and make it harder to diagnose the root cause

          Neil D added a comment -

          Background: An abort may be issued when (A) there's a timeout, or (B) when a user clicks abort.

          Use case: We want to send a notification to the team when (A), NOT when (B), so that someone will fix the problem.

          Problem: We tried to check the result of getCause on the exception however no cause is filled out in either scenario, so there's no way to know what triggered the abort.

          Neil D added a comment - Background: An abort may be issued when (A) there's a timeout, or (B) when a user clicks abort. Use case: We want to send a notification to the team when (A), NOT when (B), so that someone will fix the problem. Problem: We tried to check the result of getCause on the exception however no cause is filled out in either scenario, so there's no way to know what triggered the abort.

          Dennis Wang added a comment - ndawson suggest this article for your requirement https://support.cloudbees.com/hc/en-us/articles/226554067-Pipeline-How-to-add-an-input-step-with-timeout-that-continues-if-timeout-is-reached-using-a-default-value

            Unassigned Unassigned
            cleclerc Cyrille Le Clerc
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: