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

catchError should give a visual hint in which stage the error occurred

    XMLWordPrintable

Details

    Description

      When using catchError in a stage and the steps in catchError fail, then no visual feedback on the pipeline view is given in which stage it failed. You have to click on each individual stage to find the bad one.

      It would be better if the stage would be rendered red as for normal failures

      Attachments

        1. bad_nodes.png
          159 kB
          Craig Rodrigues
        2. Screen Shot 2019-06-27 at 4.02.19 PM.png
          87 kB
          Alexandr Semak
        3. Screen Shot 2019-06-27 at 4.02.56 PM.png
          79 kB
          Alexandr Semak

        Activity

          rodrigc Craig Rodrigues added a comment - - edited

          I can reproduce this problem with this pipeline:

          pipeline {
              agent any
              
              stages {
                  stage("Remove file which does not exist") {
                      steps {
                         catchError {
                              sh("rm /nonexistent")
                          }
                      }
                  }
                  
                  stage("Hello!") {
                      steps {
                          sh("echo Hello1")
                      }
                  }
              }
          }
          

          The Remove file which does not exist node should be red, but it is green.

          rodrigc Craig Rodrigues added a comment - - edited I can reproduce this problem with this pipeline: pipeline { agent any stages { stage("Remove file which does not exist") { steps { catchError { sh("rm /nonexistent") } } } stage("Hello!") { steps { sh("echo Hello1") } } } } The Remove file which does not exist node should be red, but it is green.
          alexandr_semak Alexandr Semak added a comment - - edited
          node {
              stage("successful"){
                  echo "successful stage"
              }
              stage("unstable"){
                  catchError(buildResult: 'SUCCESS', stageResult: 'UNSTABLE'){
                      sh "gooo version"
                  }
              }
              stage("continue working"){
                  echo "continue working"
              }
          }
          

          I also have this is issue.
          Jenkins v2.164.3(Basic Steps 2.18) already installer doesn't work if I update Basic Steps but when I was testing on new spiup Jenkins with the same version 2.164.3 it is work

          alexandr_semak Alexandr Semak added a comment - - edited node { stage( "successful" ){ echo "successful stage" } stage( "unstable" ){ catchError(buildResult: 'SUCCESS' , stageResult: 'UNSTABLE' ){ sh "gooo version" } } stage( " continue working" ){ echo " continue working" } } I also have this is issue. Jenkins v2.164.3(Basic Steps 2.18) already installer doesn't work if I update Basic Steps but when I was testing on new spiup Jenkins with the same version 2.164.3 it is work

          having the same problem. Stage fails , but doesn't show up in OpenBlueOcean visualization.  Post stage action failure{} gets executed giving a hint that currentBuild.Result = FAILURE, but interestingly the following stages get executed while not expected to do so.

          anupamaj83 Anupama Janakiram added a comment - having the same problem. Stage fails , but doesn't show up in OpenBlueOcean visualization.  Post stage action failure{} gets executed giving a hint that currentBuild.Result = FAILURE, but interestingly the following stages get executed while not expected to do so.

          People

            Unassigned Unassigned
            kutzi kutzi
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated: