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

Improve display of non-AbortException stack traces such as MissingPropertyException

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      When a user makes an innocent mistake in pipeline script, the error message is overly intense. It contains too much information that are only relevant for a few people, and that ends up masking important information for users.

      A case in point is JENKINS-33629, but I have heard similar feedback from a number of people:

      groovy.lang.MissingPropertyException: No such property: scm for class: groovy.lang.Binding
          at groovy.lang.Binding.getVariable(Binding.java:62)
          at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onGetProperty(SandboxInterceptor.java:185)
          at org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:241)
          at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:238)
          at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:221)
          at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:221)
          at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.getProperty(SandboxInvoker.java:23)
          at com.cloudbees.groovy.cps.impl.PropertyAccessBlock.rawGet(PropertyAccessBlock.java:17)
          at WorkflowScript.run(WorkflowScript:16)
          at ___cps.transform___(Native Method)
          at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.get(PropertyishBlock.java:62)
          at com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30)
          at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.fixName(PropertyishBlock.java:54)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:497)
          at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
          at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
          at com.cloudbees.groovy.cps.Next.step(Next.java:58)
          at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:154)
          at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:19)
          at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:33)
          at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:30)
          at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:106)
          at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:30)
          at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:164)
          at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:277)
          at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$000(CpsThreadGroup.java:77)
          at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:186)
          at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:184)
          at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:47)
          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)
      

      This should really be reported as the following:

      Undefined variable 'scm'
        at Jenkinsfile:16
      

      The full stack trace can be hidden under the "details" button of something similar.

      Attention like this makes a big difference in the impression of pipeline to new users, as everyone makes mistakes and how quickly we can get them unstuck is a critical part of the user experience.

        Attachments

          Issue Links

            Activity

            kohsuke Kohsuke Kawaguchi created issue -
            jglick Jesse Glick made changes -
            Field Original Value New Value
            Summary Error reporting from pipeline script has to be much better Improve display of non-AbortException stack traces such as MissingPropertyException
            jglick Jesse Glick made changes -
            Epic Link JENKINS-35396 [ 171189 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 171555 ] JNJira + In-Review [ 184355 ]
            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 -
            Component/s workflow-job-plugin [ 21716 ]
            Component/s pipeline [ 21692 ]
            jglick Jesse Glick made changes -
            Component/s workflow-cps-plugin [ 21713 ]
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-32059 [ JENKINS-32059 ]
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-31838 [ JENKINS-31838 ]
            jequals5 Marky Jackson made changes -
            Epic Link JENKINS-35396 [ 171189 ]

              People

              Assignee:
              jglick Jesse Glick
              Reporter:
              kohsuke Kohsuke Kawaguchi
              Votes:
              3 Vote for this issue
              Watchers:
              11 Start watching this issue

                Dates

                Created:
                Updated: