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
            heyleke Jan Heylen added a comment - - edited

            Is there already any way to get the link to 'blue/rest/organizations/jenkins/pipelines/<jobname>/runs/<build-id>/nodes/<PipelineNodeImpl-id>/log/ from within a pipeline parallel node?

            Show
            heyleke Jan Heylen added a comment - - edited Is there already any way to get the link to 'blue/rest/organizations/jenkins/pipelines/<jobname>/runs/<build-id>/nodes/<PipelineNodeImpl-id>/log/ from within a pipeline parallel node?
            Hide
            erikvv Erik van Velzen added a comment - - edited

            Gonna be  harsh here, but rightfully so. I feel burned, I worked many days to set up docker containers, scripts and even fixing and compiling plugins, and I now find out that it's for naught.

            "run a command and produce a URL to the output" is basic functionality of a CI tool.

            There's no point in using Jenkins without it (for me).

            Show
            erikvv Erik van Velzen added a comment - - edited Gonna be  harsh here, but rightfully so. I feel burned, I worked many days to set up docker containers, scripts and even fixing and compiling plugins, and I now find out that it's for naught. "run a command and produce a URL to the output" is basic functionality of a CI tool. There's no point in using Jenkins without it (for me).
            Hide
            erikvv Erik van Velzen added a comment -

            Perhaps a workaround would be to pipe the output within the step to a file and publish it as an artifact.

            Show
            erikvv Erik van Velzen added a comment - Perhaps a workaround would be to pipe the output within the step to a file and publish it as an artifact.
            Hide
            thangbn thang bui added a comment - - edited

            Erik van Velzen if you are using blue ocean, you can just have the link to the build and once the page open it will automatically scroll to the failed step.

            also another work around https://stackoverflow.com/questions/53444196/get-log-for-each-jenkins-pipeline-stage 

            Show
            thangbn thang bui added a comment - - edited Erik van Velzen if you are using blue ocean, you can just have the link to the build and once the page open it will automatically scroll to the failed step. also another work around  https://stackoverflow.com/questions/53444196/get-log-for-each-jenkins-pipeline-stage  
            Hide
            gl1koz3 Edgars Batna added a comment -

            +1 The advent of Blue Ocean came and went. Jenkins is still a powerful tool, but I feel weird seeing many functional improvements get so stale.

            Show
            gl1koz3 Edgars Batna added a comment - +1 The advent of Blue Ocean came and went. Jenkins is still a powerful tool, but I feel weird seeing many functional improvements get so stale.

              People

              Assignee:
              jglick Jesse Glick
              Reporter:
              jglick Jesse Glick
              Votes:
              48 Vote for this issue
              Watchers:
              63 Start watching this issue

                Dates

                Created:
                Updated: