[JIRA] (JENKINS-49183) Retry in Declarative options passes stage but causes false fail in pipeline

1 view
Skip to first unread message

prince96raj@gmail.com (JIRA)

unread,
Apr 12, 2018, 2:23:02 PM4/12/18
to jenkinsc...@googlegroups.com
Prince Raj Kumar updated an issue
 
Jenkins / Bug JENKINS-49183
Retry in Declarative options passes stage but causes false fail in pipeline
Change By: Prince Raj Kumar
Priority: Minor Major
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

o.v.nenashev@gmail.com (JIRA)

unread,
Apr 24, 2018, 7:27:02 PM4/24/18
to jenkinsc...@googlegroups.com
Oleg Nenashev updated an issue
Change By: Oleg Nenashev
Component/s: pipeline-stage-view-plugin
Component/s: pipeline-model-definition-plugin

o.v.nenashev@gmail.com (JIRA)

unread,
Apr 24, 2018, 7:27:03 PM4/24/18
to jenkinsc...@googlegroups.com

o.v.nenashev@gmail.com (JIRA)

unread,
Apr 24, 2018, 7:27:03 PM4/24/18
to jenkinsc...@googlegroups.com
Oleg Nenashev commented on Bug JENKINS-49183
 
Re: Retry in Declarative options passes stage but causes false fail in pipeline

According to the screenshot, it is an issue in Pipeline Stage view Plugin.
CC Sam Van Oort

jonh.wendell@gmail.com (JIRA)

unread,
Apr 24, 2018, 8:35:03 PM4/24/18
to jenkinsc...@googlegroups.com
Jonh Wendell updated an issue
 
Change By: Jonh Wendell
Attachment: Screenshot from 2018-04-24 21-32-39.png

jonh.wendell@gmail.com (JIRA)

unread,
Apr 24, 2018, 8:39:02 PM4/24/18
to jenkinsc...@googlegroups.com
Jonh Wendell commented on Bug JENKINS-49183
 
Re: Retry in Declarative options passes stage but causes false fail in pipeline

I'm also suffering from this issue as you can see in the screenshot above. Even open ocean recognizes the job failed when in fact only 1 step within the retry clause failed, at the first time. Second time it worked fine.

The state of the build is failed - in all jenkins views - when in fact it succeeded.

I'm using Jenkins 2.89.4 + Pipeline declarative 1.2.7 + Build Pipeline plugin 1.5.8.

svanoort@cloudbees.com (JIRA)

unread,
Apr 24, 2018, 9:05:02 PM4/24/18
to jenkinsc...@googlegroups.com
Sam Van Oort updated an issue
 
Change By: Sam Van Oort
Component/s: pipeline-model-definition-plugin
Component/s: pipeline-stage-view-plugin

svanoort@cloudbees.com (JIRA)

unread,
Apr 24, 2018, 9:06:02 PM4/24/18
to jenkinsc...@googlegroups.com

svanoort@cloudbees.com (JIRA)

unread,
Apr 24, 2018, 9:10:02 PM4/24/18
to jenkinsc...@googlegroups.com
Sam Van Oort commented on Bug JENKINS-49183
 
Re: Retry in Declarative options passes stage but causes false fail in pipeline

Oleg Nenashev I'm unclear why you reassigned this, given that Andrew had already self-assigned this to himself and marked it as a Declarative issue, suggesting he thinks it's an issue with Declarative. That's what my gut says too – likely Declarative is doing something that creates odd status codings here, probably some small bug is resulting in the retry marking the build a failure.

Stage View is only providing a visualization of that data, they just provided a screenshot that shows this, and Blue Ocean matches that.

o.v.nenashev@gmail.com (JIRA)

unread,
Apr 25, 2018, 3:03:01 AM4/25/18
to jenkinsc...@googlegroups.com

Sam Van Oort sorry for messing up the ticket. It was actually not assigned to anybody, so I have thought I am doing triaging. Thanks for the update

prince96raj@gmail.com (JIRA)

unread,
Apr 26, 2018, 2:12:02 AM4/26/18
to jenkinsc...@googlegroups.com

Andrew Bayer,

Is there any ETA, to fix this issue?

I am also getting the same issue. Can you please fix this issue as soon as possible, It will be good for me.

Thanks in advance! I am looking forward to your reply.

delgod@delgod.com (JIRA)

unread,
Jun 11, 2018, 10:29:02 AM6/11/18
to jenkinsc...@googlegroups.com

morlinest@gmail.com (JIRA)

unread,
Jun 26, 2018, 10:48:02 AM6/26/18
to jenkinsc...@googlegroups.com

Have same problem. Running stage 3 times with retry option, but it always keeps FAILURE status at the end, even if second/third time the build (stage) is successful. I wanted to reset `currentBuild.result` as workaround on start of stage, but it can not be changed from FAILURE to SUCCESS based on my tests, only SUCCESS to FAILURE. Are there any solution?

This message was sent by Atlassian JIRA (v7.10.1#710002-sha1:6efc396)

christopher.kush@monotype.com (JIRA)

unread,
Sep 18, 2018, 4:58:02 PM9/18/18
to jenkinsc...@googlegroups.com

Yeah, irritating. Whole point of retry is that one of my stages is not reliable.

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

morlinest@gmail.com (JIRA)

unread,
Sep 18, 2018, 6:47:02 PM9/18/18
to jenkinsc...@googlegroups.com
Peter Žeby edited a comment on Bug JENKINS-49183
Have same problem. Running stage 3 times with retry option, but it always keeps FAILURE status at the end, even if second/third time the build (stage) is successful. I wanted to reset `currentBuild.result` as workaround on start of stage, but it can not be changed from FAILURE to SUCCESS based on my tests, only from SUCCESS to FAILURE. Are Is there any solution?

jsailer@in-technology.eu (JIRA)

unread,
Sep 19, 2018, 2:50:02 AM9/19/18
to jenkinsc...@googlegroups.com

As a workaround I use the retry step instead of retry option. That works for me...

stage('name') {
  steps {
    retry(3) {
      ...
    }
  }
}

mnemyx@gmail.com (JIRA)

unread,
Sep 27, 2018, 6:02:03 PM9/27/18
to jenkinsc...@googlegroups.com

Joachim Sailer Thanks for the workaround!

I ended up using it; just the downside is if a user cancels a build that's on a step wrapped with a retry, it stills keep retrying. Lesser of the two evils, I guess.

dnusbaum@cloudbees.com (JIRA)

unread,
Jun 11, 2019, 10:35:10 AM6/11/19
to jenkinsc...@googlegroups.com

I think this is a dupe of JENKINS-46354, which was fixed in Pipeline Declarative Plugin version 1.3.8. Here is the Pipeline I used to verify that the issue was fixed: 

pipeline {
    agent any
    stages {
        stage("test") {
            options {
                retry(3)
            }
            steps {
                sh 'if (( $RANDOM % 2 )); then exit 0; else exit 1; fi;'
            }
        }
    }
}

Here is the log output from a build with one retry: 

Started by user unknown or anonymous
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] Start of Pipeline
[Pipeline] node
Running on Jenkins in /Users/dnusbaum/Projects/pipeline-model-definition-plugin/pipeline-model-definition/work/workspace/retry
[Pipeline] {
[Pipeline] stage
[Pipeline] { (test)
[Pipeline] retry
[Pipeline] {
[Pipeline] sh
+ ((  5334 % 2  ))
+ exit 1
[Pipeline] }
ERROR: script returned exit code 1
Retrying
[Pipeline] {
[Pipeline] sh
+ ((  24899 % 2  ))
+ exit 0
[Pipeline] }
[Pipeline] // retry
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS

I also tested with the options at the top level rather than in the stage, and got the same result. I am going to close this as a dupe of JENKINS-46354, feel free to reopen if you are still seeing the issue. If you do reopen the ticket, please include a simple Pipeline that reproduces the problem so we can understand how it differs from JENKINS-46354.

dnusbaum@cloudbees.com (JIRA)

unread,
Jun 11, 2019, 10:35:13 AM6/11/19
to jenkinsc...@googlegroups.com
Devin Nusbaum resolved as Duplicate
 
Change By: Devin Nusbaum
Status: Open Resolved
Resolution: Duplicate
Released As: pipeline-model-definition 1.3.8

bitwiseman@gmail.com (JIRA)

unread,
Oct 22, 2019, 11:25:59 PM10/22/19
to jenkinsc...@googlegroups.com
Liam Newman closed an issue as Duplicate
 

Bulk closing resolved issues.

Change By: Liam Newman
Status: Resolved Closed
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages