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

Include failed step's error to it's log

    Details

    • Similar Issues:
    • Sprint:
      frank, tethys, christmas

      Description

      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 Sam Van Oort, 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.

        Attachments

          Issue Links

            Activity

            Show
            jamesdumay James Dumay added a comment - Vivek Pandey here's the example Sam Van Oort gave https://github.com/jenkinsci/pipeline-stage-view-plugin/blob/master/rest-api/src/main/java/com/cloudbees/workflow/rest/external/ErrorExt.java#L62
            Hide
            jamesdumay James Dumay added a comment -

            Need to understand scope

            Show
            jamesdumay James Dumay added a comment - Need to understand scope
            Hide
            michaelneale Michael Neale added a comment - - edited

            Vivek Pandey 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?

            Show
            michaelneale Michael Neale added a comment - - edited Vivek Pandey 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?
            Hide
            michaelneale Michael Neale added a comment -

            Had a discussion with Sam Van Oort and vivek and agreed this is doable

            Show
            michaelneale Michael Neale added a comment - Had a discussion with Sam Van Oort and vivek and agreed this is doable
            Hide
            jamesdumay James Dumay added a comment -

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

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

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: