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

Retry block in Jenkins workflow script is executed in a different context

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      I set up a workflow script using a Git repository. The workflow script performs some Git actions using SSH.

          sh "git checkout develop"
      
          //Retry pushing to develop several times because it could be that a developer pushes before this finishes
          retry(5) {
              sh 'git pull --no-edit'
              sh "git push origin develop"
          }
      

      This script fails however with the error message that there is no remote branch tracked by the current branch.

      We've been using this script for a long time now on release 1.10.1 of the workflow plugin, but this issue started occurring after the upgrade to release 2.

      I downgraded to release 1.10.1 again and everything started working again.

        Attachments

          Activity

          Hide
          jglick Jesse Glick added a comment -

          Probably some mistake in Git usage. No steps to reproduce from scratch given, so cannot be sure.

          Show
          jglick Jesse Glick added a comment - Probably some mistake in Git usage. No steps to reproduce from scratch given, so cannot be sure.
          Hide
          drieselliott Dries Elliott added a comment -

          I find it a bit astonishing that after four months someone finally looks at this issue and the first reaction is to just close it.

          I believe in my original description I provided all the information you need in order to reproduce this issue. If this is not the case then you should provide an indication of what's missing.

          I hope this time I don't have to wait 4 months in order to get at least some kind of comment from someone working on Jenkins.

          Show
          drieselliott Dries Elliott added a comment - I find it a bit astonishing that after four months someone finally looks at this issue and the first reaction is to just close it. I believe in my original description I provided all the information you need in order to reproduce this issue. If this is not the case then you should provide an indication of what's missing. I hope this time I don't have to wait 4 months in order to get at least some kind of comment from someone working on Jenkins.
          Hide
          jglick Jesse Glick added a comment -

          Please read the standard guide and provide a complete, self-contained, minimal set of steps to reproduce the problem from scratch, including all files, scripts, etc. etc. which would be needed for someone to see your problem occur locally without trying to guess at your intent, plus complete output of your own run for reference.

          Show
          jglick Jesse Glick added a comment - Please read the standard guide and provide a complete, self-contained, minimal set of steps to reproduce the problem from scratch, including all files, scripts, etc. etc. which would be needed for someone to see your problem occur locally without trying to guess at your intent, plus complete output of your own run for reference.

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            drieselliott Dries Elliott
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: