• frank, tethys, christmas

      A pipeline step's failure does not get reported in it's log. For example archiver step failure gets reported in overall run's log.

      As discussed with svanoort, a possible hack around it would be to use failed step's flowNode's ErrorAction, FlowNode.getError().getError().getMessage() and append it to the step's log.

      In blueocean API, step's log is AnnotatedLargeText, and it can be served in streaming fashion, it should be done in such a way to correctly append it to the end of step's log.

          [JENKINS-39658] Include failed step's error to it's log

          James Dumay added a comment - vivek here's the example svanoort gave https://github.com/jenkinsci/pipeline-stage-view-plugin/blob/master/rest-api/src/main/java/com/cloudbees/workflow/rest/external/ErrorExt.java#L62

          James Dumay added a comment -

          Need to understand scope

          James Dumay added a comment - Need to understand scope

          Michael Neale added a comment - - edited

          vivek would this include cases like https://issues.jenkins-ci.org/browse/JENKINS-39440 (eg a syntax error which only happens dynamically) or a failure to provision an agent before the pipeline starts (which is captured in the overall log only) as well?

          For example, this script will cause a failure that shows up nothing in node logs (stack trace in main log):

          def foo = null
          
          node {
              stage('blah') {
                  sh "echo 42"
                  foo.bar = 42
                  
              }
          }
          

          And this case shows it failing to start, but not showing up anything in step logs:

          stage('boo') {
              node('nfdslfdsklfjlkdsjlk') {
                  sh "echo 42"
              }
              
          }
          

          In both cases above, the full log shows what is needed but the step logs do not. Will the scope include these?

          Michael Neale added a comment - - edited vivek would this include cases like https://issues.jenkins-ci.org/browse/JENKINS-39440 (eg a syntax error which only happens dynamically) or a failure to provision an agent before the pipeline starts (which is captured in the overall log only) as well? For example, this script will cause a failure that shows up nothing in node logs (stack trace in main log): def foo = null node { stage('blah') { sh "echo 42" foo.bar = 42 } } And this case shows it failing to start, but not showing up anything in step logs: stage('boo') { node('nfdslfdsklfjlkdsjlk') { sh "echo 42" } } In both cases above, the full log shows what is needed but the step logs do not. Will the scope include these?

          Michael Neale added a comment -

          Had a discussion with svanoort and vivek and agreed this is doable

          Michael Neale added a comment - Had a discussion with svanoort and vivek and agreed this is doable

          James Dumay added a comment -

          vivek this is another one to look at over the next week if you find time.

          James Dumay added a comment - vivek this is another one to look at over the next week if you find time.

            vivek Vivek Pandey
            vivek Vivek Pandey
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: