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

Link to log of failed step

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      When a flow involves many steps, long logs, and/or many branches, it can be hard for a developer receiving a failure email (for example) to quickly see what part of the build actually failed and why. I think it would be useful for the catchError step to do a DFS search on the Throwable and its cause chain through the FlowNode graph starting at the end of the catch step, looking for ErrorAction, and setting/appending an environment variable with the URL of the LogAction. Or provide a new step to do the same. Thus you could write

      def runStuff(param) {
        ...
      }
      try {
        parallel a: {runStuff 'a'}, b: {runStuff 'b'}
      } catch (e) {
        mail to: '...', subject: 'Failure!', body: "Build failed: ${errorUrl(e)}"
      }
      

      and get a link to http://jenkins/job/myflow/123/flowGraph/77/console or the like, according to the actual step in one of the branches that threw the error.

        Attachments

          Issue Links

            Activity

            Hide
            jpruud Juan Pablo Bottinelli added a comment -

            Hi. Is this still being worked on?

            Thanks

            Show
            jpruud Juan Pablo Bottinelli added a comment - Hi. Is this still being worked on? Thanks
            Hide
            roel0 roel postelmans added a comment -

            You can use the rest api that comes with the stage view plugin:

            https://github.com/jenkinsci/pipeline-stage-view-plugin/tree/master/rest-api

             

            to obtain a stage-seperated log

            Show
            roel0 roel postelmans added a comment - You can use the rest api that comes with the stage view plugin: https://github.com/jenkinsci/pipeline-stage-view-plugin/tree/master/rest-api   to obtain a stage-seperated log
            Hide
            jpruud Juan Pablo Bottinelli added a comment -

            I'll take a look at that. Thanks roel postelmans

            Show
            jpruud Juan Pablo Bottinelli added a comment - I'll take a look at that. Thanks roel postelmans
            Hide
            heckebbg Hans Ecke added a comment -

            FWIW, I'm looking at the exact same usecase. Currently I email currentBuild.rawBuild.getLog(1000) to the stakeholders of the run, but it contains much unrelated chaff.

            Show
            heckebbg Hans Ecke added a comment - FWIW, I'm looking at the exact same usecase. Currently I email  currentBuild.rawBuild.getLog(1000) to the stakeholders of the run, but it contains much unrelated chaff.
            Hide
            ringerc Craig Ringer added a comment -

            This becomes even more relevant when working with Blue Ocean etc. The URLs are something like `jobname/6/pipeline/79` where the /79 is a node in the graph of steps and parallel tasks. It doesn't seem to be predictable, so it's not clear how you can generate a URL that points to exactly one parallel step, for example.

            Show
            ringerc Craig Ringer added a comment - This becomes even more relevant when working with Blue Ocean etc. The URLs are something like `jobname/6/pipeline/79` where the /79 is a node in the graph of steps and parallel tasks. It doesn't seem to be predictable, so it's not clear how you can generate a URL that points to exactly one parallel step, for example.

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                jglick Jesse Glick
              • Votes:
                32 Vote for this issue
                Watchers:
                46 Start watching this issue

                Dates

                • Created:
                  Updated: