Jenkins Pipeline Troubleshooting

Created by Tass Skoudros, Modified on Fri, 11 Nov, 2022 at 9:49 AM by Tass Skoudros

Pipeline Steps

Even though Pipeline provides a stage view and details of the complete build, it is very beneficial to know the troubleshooting issues using Pipeline steps.

Pipeline steps can view directly by clicking on Pipeline steps menu bar inside the build (or) using any of the below direct links.

The Pipeline Steps screen is also the way to get to the workspace from the web interface. Prior to Jenkins 2, there was a Workspace link on the output page for a build. This link is not surfaced any longer on that page. Instead, you have to dig deeper through this area to find it.

Since a workspace is associated with a node, you first click on the console output icon for a pipeline step associated with allocating a node.

Identifying the Line that caused error:

It is challenging to pin point the actual line of code that is causing the error. Consider the following Pipeline code.

pipeline {
  agent {
    label 'jenkins-agent'
  }
  stages{
    stage ('Execute'){
      steps {
        script {
          var = ['a','b']
          echo a
        }
      }
    }
  }
}


Attempting to run this, we get output like the following error below:

Looking at this output, it can be challenging to quickly identify the line that is actually causing the problem. The key here is finding the line that has Workflow Script in it. That line will provide the exact line number (in this case, line 10) where the script is failing.

Knowing the line number is the first step in debugging, such as finding where an exception is being thrown. But exceptions can sometimes be expected and helpful.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article