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

Jenkinsfile errors shows Java stacktrace without Jenkinsfile line number

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • workflow-cps-plugin
    • None

      When there is an error in my Jenkinsfile (for example, trying to invoke a null function variable) I see a Java stacktrace without details about where the error occurred (see screenshot). I understand that my groovy code is converted to Java, but there are no hints given about where in the Groovy code I should look (no line number, function or variable names, etc).

      I would expect to see a line number of where the error occurred inside the Jenkinsfile, and if  possible the function name it occurred in.

          [JENKINS-47131] Jenkinsfile errors shows Java stacktrace without Jenkinsfile line number

          Andrew Bayer added a comment -

          It's a little obscure, but WorkflowScript is what you're looking for. That's the fake class name we use for the Pipeline script, whether it comes from a Jenkinsfile or a script in the job config itself, etc.

          Andrew Bayer added a comment - It's a little obscure, but WorkflowScript is what you're looking for. That's the fake class name we use for the Pipeline script, whether it comes from a Jenkinsfile or a script in the job config itself, etc.

          Craig Ringer added a comment -

          It'd be a massive help to transform `WorkflowScript` in traces to the value of `${pipeline-script}` or annotate it with the same. Even better to also abbreviate the trace after `WorkflowScript.run`.

          See related JENKINS-35308 .

          Craig Ringer added a comment - It'd be a massive help to transform `WorkflowScript` in traces to the value of `${pipeline-script}` or annotate it with the same. Even better to also abbreviate the trace after `WorkflowScript.run`. See related  JENKINS-35308 .

          p cowlinator added a comment - - edited

          Why isn't "WorkflowScript.run means Jenkinsfile" documented anywhere?

          p cowlinator added a comment - - edited Why isn't "WorkflowScript.run means Jenkinsfile" documented anywhere?

            Unassigned Unassigned
            laszlopandy Laszlo Pandy
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: