[JIRA] [workflow-plugin] (JENKINS-28119) Link to log of failed step

8 views
Skip to first unread message

jglick@cloudbees.com (JIRA)

unread,
Aug 19, 2015, 10:15:01 AM8/19/15
to jenkinsc...@googlegroups.com
Jesse Glick commented on Improvement JENKINS-28119
 
Re: Link to log of failed step

Should also be able to get a tail of the log.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

michael.neale@gmail.com (JIRA)

unread,
Sep 14, 2015, 6:44:06 PM9/14/15
to jenkinsc...@googlegroups.com

In a freestyle job the config is still simpler than the proposed above, having a global "catch all" that sends failure (with pertinent details) would be nice to bring it up to parity.

michael.neale@gmail.com (JIRA)

unread,
Oct 5, 2015, 10:46:01 PM10/5/15
to jenkinsc...@googlegroups.com

Given a common use for this will be to slap a try/catch around everything to get failure messages, would it be possible to have a:

onFailure DSL that effectively does the same thing? (not sure if this is possible in the current form of things). Ideally this could be scoped to stage, but that may be just too much to ask. The ideal is to make it not too much more work than what people experience now with freestyle, in WF terms.

mstewart@riotgames.com (JIRA)

unread,
Mar 7, 2016, 2:48:01 AM3/7/16
to jenkinsc...@googlegroups.com

This is going to be a primary blocker to my users not adopting pipeline DSL over say, Job DSL (perhaps with some pipeline in it). It's way too cumbersome to require all that raw Groovy code just to send an email on failure.

The mail post-build step wrapper doesn't actually execute right now because the pipeline DSL aborts the run before it finishes.

I can of course, create a global wrapper for "node" that embeds a default mail handler and exception trap, but inside that global method I lose access to global variables, like JOB_NAME and other things that make sending the mail more intuitive.

michael.neale@gmail.com (JIRA)

unread,
Mar 7, 2016, 7:24:01 PM3/7/16
to jenkinsc...@googlegroups.com

peter.marcoen@outlook.com (JIRA)

unread,
Mar 10, 2016, 3:55:02 AM3/10/16
to jenkinsc...@googlegroups.com

I agree with Michael and Maxfield. It feels like I'm taking a step back when using Pipeline. It used to be as simple as providing the emailaddress to send a mail to when the build failed. Now I have to start coding it in with try-catches.

I too would prefer a onFailure DSL to avoid all that complexity.

martin.danjou14@gmail.com (JIRA)

unread,
Mar 30, 2016, 3:01:02 PM3/30/16
to jenkinsc...@googlegroups.com

It might reduce the volume of code if you push everything down, and try-catch only once at the top:

main()
def main() {
    try {
        core()
    } catch (Exception e) {
        mail to: 'dest@domain', subject: "Failure of Jenkins", body: e.getMessage()+"\nTry harder the next time."
        error(e.getMessage())
    }
}

def core() {
    node {
        sh "exit 1"
    }
}

Hope this helps.

jglick@cloudbees.com (JIRA)

unread,
Apr 8, 2016, 2:47:04 PM4/8/16
to jenkinsc...@googlegroups.com

inside that global method I lose access to global variables, like JOB_NAME

Not true, these are still accessible.

jglick@cloudbees.com (JIRA)

unread,
Apr 8, 2016, 10:53:04 PM4/8/16
to jenkinsc...@googlegroups.com

Should rather return a Serializable struct with @Whitelisted properties that can be used to customize error handling:

  • original exception (e.g., for calling .message)
  • full stack trace of exception (as a convenience)
  • URL of LogAction
  • tail of log file leading up to error
  • label associated with failing step (using FlowNodeSerialWalker from JENKINS-26132, and especially useful in conjunction with JENKINS-26107)

jglick@cloudbees.com (JIRA)

unread,
Apr 11, 2016, 5:00:06 PM4/11/16
to jenkinsc...@googlegroups.com
Jesse Glick started work on Improvement JENKINS-28119
 
Change By: Jesse Glick
Status: Open In Progress

jglick@cloudbees.com (JIRA)

unread,
Apr 11, 2016, 5:24:01 PM4/11/16
to jenkinsc...@googlegroups.com

As per JENKINS-32059, we lack API-level metadata about source line location.

lklrmn@gmail.com (JIRA)

unread,
Aug 25, 2016, 3:52:03 PM8/25/16
to jenkinsc...@googlegroups.com

I'm interested in ensuring that the solution works with a parallel() that has a large number of sub-jobs...that all of the jobs get completed and multiple failures can be identified.

This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

jglick@cloudbees.com (JIRA)

unread,
Aug 29, 2016, 1:56:08 PM8/29/16
to jenkinsc...@googlegroups.com
Jesse Glick updated an issue
 
Jenkins / Improvement JENKINS-28119
Change By: Jesse Glick
Component/s: workflow-basic-steps-plugin
Component/s: pipeline

jpruud@gmail.com (JIRA)

unread,
Mar 6, 2018, 8:40:03 PM3/6/18
to jenkinsc...@googlegroups.com
Juan Pablo Bottinelli commented on Improvement JENKINS-28119
 
Re: Link to log of failed step

Hi. Is this still being worked on?

Thanks

This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

postelmansroel@gmail.com (JIRA)

unread,
Mar 7, 2018, 4:08:03 AM3/7/18
to jenkinsc...@googlegroups.com

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

jpruud@gmail.com (JIRA)

unread,
Mar 7, 2018, 9:56:03 AM3/7/18
to jenkinsc...@googlegroups.com

hecke@bloomberg.ent (JIRA)

unread,
Oct 16, 2018, 11:33:03 AM10/16/18
to jenkinsc...@googlegroups.com

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.

This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

craig@2ndquadrant.com (JIRA)

unread,
Jan 21, 2019, 3:07:03 AM1/21/19
to jenkinsc...@googlegroups.com

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.

michael.hartmann@qtronic.de (JIRA)

unread,
Apr 10, 2019, 3:49:03 AM4/10/19
to jenkinsc...@googlegroups.com

Is this still in progress?

jglick@cloudbees.com (JIRA)

unread,
Apr 10, 2019, 10:58:07 AM4/10/19
to jenkinsc...@googlegroups.com
Jesse Glick updated an issue

Not really. I suppose I could revisit this, given the high vote count.

Change By: Jesse Glick
Labels: stalled-pr

david@famriemens.nl (JIRA)

unread,
Apr 18, 2019, 5:32:04 AM4/18/19
to jenkinsc...@googlegroups.com
David Riemens commented on Improvement JENKINS-28119
 
Re: Link to log of failed step

just up-voted;
Me too, I have similar usecase. In our testenvironment, we run many tools, each generating a separate logfile. We have one generic log shown in the console.
If one test fails, we can see that it failed, and typically have an exception message shown in the console, but the actual (detailed) reason is hidden in one of
the  detailed logs. For that reason we want to include a link to the workspace directory on the exception text, such that all the log-files are just one click away.
For the pipeline jobs that link is not easy to derive; it is hidden in one of the pipeline steps. as also indicated by Craig Ringer
My feeling says that making sure that link, or the ID is available at runtime should be possible ... right ?

heyleke@gmail.com (JIRA)

unread,
Sep 27, 2019, 8:30:17 AM9/27/19
to jenkinsc...@googlegroups.com

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

This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

heyleke@gmail.com (JIRA)

unread,
Sep 27, 2019, 8:30:18 AM9/27/19
to jenkinsc...@googlegroups.com
Jan Heylen edited a comment on Improvement JENKINS-28119
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 ?

evvelzen@vcn.nl (JIRA)

unread,
Jan 24, 2020, 1:12:07 PM1/24/20
to jenkinsc...@googlegroups.com
Erik van Velzen edited a comment on Improvement JENKINS-28119
Gonna be a bit harsh here, but rightfully so.

I go through all the effort of setting up docker containers,
script 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 this (for me).

evvelzen@vcn.nl (JIRA)

unread,
Jan 24, 2020, 1:12:08 PM1/24/20
to jenkinsc...@googlegroups.com

Gonna be a bit harsh here, but rightfully so.

I go through all the effort of setting up docker containers, script 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 this (for me).

evvelzen@vcn.nl (JIRA)

unread,
Jan 24, 2020, 1:13:05 PM1/24/20
to jenkinsc...@googlegroups.com
Erik van Velzen edited a comment on Improvement JENKINS-28119
Gonna be a bit harsh here, but rightfully so.

I go through all the effort of setting 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 this it (for me).

evvelzen@vcn.nl (JIRA)

unread,
Jan 24, 2020, 1:14:06 PM1/24/20
to jenkinsc...@googlegroups.com
Erik van Velzen edited a comment on Improvement JENKINS-28119
Gonna be a bit harsh here, but rightfully so.

I feel a bit burned, I go through all the effort days of setting effort 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).

evvelzen@vcn.nl (JIRA)

unread,
Jan 24, 2020, 1:15:03 PM1/24/20
to jenkinsc...@googlegroups.com
Erik van Velzen edited a comment on Improvement JENKINS-28119
Gonna be a bit harsh here, but rightfully so.

I feel a bit burned, I go through worked many days of effort 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).

evvelzen@vcn.nl (JIRA)

unread,
Jan 24, 2020, 1:16:03 PM1/24/20
to jenkinsc...@googlegroups.com
Erik van Velzen edited a comment on Improvement JENKINS-28119
Gonna be a bit   harsh here, but rightfully so.

I feel a bit 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).

evvelzen@vcn.nl (JIRA)

unread,
Jan 24, 2020, 7:02:03 PM1/24/20
to jenkinsc...@googlegroups.com

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

thang.buinguyen@yahoo.com.vn (JIRA)

unread,
Apr 17, 2020, 2:47:05 AM4/17/20
to jenkinsc...@googlegroups.com

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.

This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

thang.buinguyen@yahoo.com.vn (JIRA)

unread,
Apr 17, 2020, 2:58:03 AM4/17/20
to jenkinsc...@googlegroups.com
thang bui edited a comment on Improvement JENKINS-28119
[~erikvv] 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
Reply all
Reply to author
Forward
0 new messages