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

Honor SCM checkout retry count from CpsScmFlowDefinition

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • workflow-cps-plugin
    • None
    • Pipeline Groovy 2.44

      Hi Team,

      We have set the value of SCM checkout retry count to 5. This is working well for free style jobs. The same is not working while loading pipeline using "Pipeline script from scm" option.

      This could be a bug. Can you please check into this.

      Thanks!

        1. Pipeline_Configuration.PNG
          Pipeline_Configuration.PNG
          38 kB
        2. Pipeline_Output.PNG
          Pipeline_Output.PNG
          117 kB
        3. FreeStyle_Output.PNG
          FreeStyle_Output.PNG
          159 kB
        4. FreeStyle_Configuration.PNG
          FreeStyle_Configuration.PNG
          48 kB
        5. SCMRetryCount.PNG
          SCMRetryCount.PNG
          13 kB

          [JENKINS-39194] Honor SCM checkout retry count from CpsScmFlowDefinition

          Anudeep Lalam created issue -
          Anudeep Lalam made changes -
          Description Original: Hi Team,

          We have set the value of {{SCM checkout retry count}} to 5. This is working well for free style jobs. The same is not working while loading pipeline using "Pipeline script from scm" option.

          This could be a bug. Can you please check into this.

          Thanks!
          New: Hi Team,

          We have set the value of {color:red}SCM checkout retry count{color} to 5. This is working well for free style jobs. The same is not working while loading pipeline using "Pipeline script from scm" option.

          This could be a bug. Can you please check into this.

          Thanks!
          Mark Waite made changes -
          Assignee Original: Mark Waite [ markewaite ]

          Mark Waite added a comment -

          anudeeplalam can you provide more details, including step by step instructions and specific examples so that others can duplicate the problem you are reporting?

          For example, please provide the pipeline script you're using which is not honoring the retry count, a description of how you detect the failure when the retry count is not honored, a detailed description of how you configured the working freestyle job (or a copy of the job configuration file), and the types of failures which cause the job to retry.

          Mark Waite added a comment - anudeeplalam can you provide more details, including step by step instructions and specific examples so that others can duplicate the problem you are reporting? For example, please provide the pipeline script you're using which is not honoring the retry count, a description of how you detect the failure when the retry count is not honored, a detailed description of how you configured the working freestyle job (or a copy of the job configuration file), and the types of failures which cause the job to retry.
          Anudeep Lalam made changes -
          Attachment New: FreeStyle_Configuration.PNG [ 34470 ]
          Attachment New: FreeStyle_Output.PNG [ 34471 ]
          Attachment New: SCMRetryCount.PNG [ 34472 ]
          Anudeep Lalam made changes -
          Attachment New: Pipeline_Configuration.PNG [ 34473 ]
          Attachment New: Pipeline_Output.PNG [ 34474 ]

          Anudeep Lalam added a comment -

          markewaite - Thanks for your comment. Here is the scenario.

          In Manage Jenkins -> Configure System, I have put the SCM checkout retry count to 5.

          Now to test the retry, I have created a free style job to clone a Git repository https://github.com/anudeeplalam/JenkinsTest1.git , which does not exist.

          When I build this job, As you can see in the below picture, The retry is happening.(The retry happened 5 times. To keep short I have captured single retry.)

          Now, When I try to use this in a Pipeline Job for loading Jenkinsfile using "Pipeline script from scm", it's not working

          As you can see in the below picture, The pipeline job exited immediately after the first attempt. Ideally it has to retry "5 Times" just like the Free style Job.

          Anudeep Lalam added a comment - markewaite - Thanks for your comment. Here is the scenario. In Manage Jenkins -> Configure System, I have put the SCM checkout retry count to 5. Now to test the retry, I have created a free style job to clone a Git repository https://github.com/anudeeplalam/JenkinsTest1.git , which does not exist. When I build this job, As you can see in the below picture, The retry is happening.(The retry happened 5 times. To keep short I have captured single retry.) Now, When I try to use this in a Pipeline Job for loading Jenkinsfile using "Pipeline script from scm", it's not working As you can see in the below picture, The pipeline job exited immediately after the first attempt. Ideally it has to retry "5 Times" just like the Free style Job.

          Anudeep Lalam added a comment -

          markewaite - Sorry for a very big message. But I thought it would be better to show all the steps I followed so that it will be easy for you to understand what went wrong.

          So, now coming to the point. Am I missing something here. Ideally my expectation is SCM checkout retry count should work for both Freestyle and Pipeline Jobs.

          This is really a blocker for us. We would really appreciate if someone look into this.

          Thanks!

          Anudeep Lalam added a comment - markewaite - Sorry for a very big message. But I thought it would be better to show all the steps I followed so that it will be easy for you to understand what went wrong. So, now coming to the point. Am I missing something here. Ideally my expectation is SCM checkout retry count should work for both Freestyle and Pipeline Jobs. This is really a blocker for us. We would really appreciate if someone look into this. Thanks!

          Mark Waite added a comment -

          Thanks for the description. That's exactly what is needed.

          I don't expect to investigate it further for at least several months due to other, more common use cases which need investigation and fixes. I wanted enough of a description in the bug report that others might be able to investigate if they encounter the same problem.

          I don't know if the global SCM retry setting that you are using should be honored in pipeline jobs or not. I'm not sure which layer of the Jenkins code implements that retry mechanism. I suspect it is in some component outside the git plugin, since it mentions "SCM checkout retry count" rather than "Git retry count".

          Mark Waite added a comment - Thanks for the description. That's exactly what is needed. I don't expect to investigate it further for at least several months due to other, more common use cases which need investigation and fixes. I wanted enough of a description in the bug report that others might be able to investigate if they encounter the same problem. I don't know if the global SCM retry setting that you are using should be honored in pipeline jobs or not. I'm not sure which layer of the Jenkins code implements that retry mechanism. I suspect it is in some component outside the git plugin, since it mentions "SCM checkout retry count" rather than "Git retry count".
          Mark Waite made changes -
          Component/s Original: git-client-plugin [ 17423 ]

            mmitche Matthew Mitchell
            anudeeplalam Anudeep Lalam
            Votes:
            2 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: