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

Multibranch pipeline failing at Checkout SCM step (unable to resolve tag)

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: Major Major
    • git-client-plugin
    • Jenkins ver. 2.60.3
      Latest version for installed plugins
      Debian 8 / 64bit
      openjdk-8-jdk + openjdk-8-jre 8u102-b14.1-1~bpo8+1

      Hello,

      I'm facing a strange issue since the last upgrade (when Blue Ocean was released in 1.2.0).

      I tried to downgrade almost everything (both jenkins to 2.60.2 and every plugins who might be related to git/scm). But I couldn't make it work again...

      The issue occurs whenever I try to launch a build or "Scan Multibranch Pipeline Now".

      Here is the errog log I get everytime :

      Démarré par l'utilisateur segdim
       > git rev-parse --is-inside-work-tree # timeout=10
      Setting origin to https://git_url/ORG/repo.git
       > git config remote.origin.url https://git_url/ORG/repo.git # timeout=10
      Fetching origin...
      Fetching upstream changes from origin
       > git --version # timeout=10
       > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
      hudson.plugins.git.GitException: Command "git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*" returned status code 1:
      stdout:
      stderr: error: unable to resolve reference refs/tags/20170825-fc97b4e: Argument invalide
      Depuis https://git_url/ORG/repo.git
       ! [nouvelle étiquette] 20170825-fc97b4e -> 20170825-fc97b4e  (impossible de mettre à jour la référence locale)
      
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1924)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1643)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:71)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:352)
          at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:344)
          at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:358)
          at jenkins.scm.api.SCMSource.fetch(SCMSource.java:564)
          at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:95)
          at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:263)
          at hudson.model.ResourceController.execute(ResourceController.java:97)
          at hudson.model.Executor.run(Executor.java:405)
      Finished: FAILURE
      

      I also tried to run manually the git commands SCM Checkout Jenkins is using :

      git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
      

      It works fine for me and the tag 20170825-fc97b4e does exist inside my repository.

      I tried on multiple branches and other repositories and I got the same result.

      Thanks

          [JENKINS-46683] Multibranch pipeline failing at Checkout SCM step (unable to resolve tag)

          Dimitri SEGARD created issue -
          Dimitri SEGARD made changes -
          Description Original: Hello,

          I'm facing a strange issue since the last upgrade (when Blue Ocean was released in 1.2.0).

          I tried to downgrade almost everything (both jenkins to 2.60.2 and every plugins who might be related to git/scm). But I couldn't make it work again...

          The issue occurs whenever I try to launch a build or "Scan Multibranch Pipeline Now".

          Here is the errog log I get everytime :
          {code:java}
          Démarré par l'utilisateur segdim
           > git rev-parse --is-inside-work-tree # timeout=10
          Setting origin to https://git_url/ORG/repo.git
           > git config remote.origin.url https://git_url/ORG/repo.git # timeout=10
          Fetching origin...
          Fetching upstream changes from origin
           > git --version # timeout=10
           > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
          hudson.plugins.git.GitException: Command "git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*" returned status code 1:
          stdout:
          stderr: error: unable to resolve reference refs/tags/20170825-fc97b4e: Argument invalide
          Depuis https://git_url/ORG/repo.git
           ! [nouvelle étiquette] 20170825-fc97b4e -> 20170825-fc97b4e  (impossible de mettre à jour la référence locale)

              at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1924)
              at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1643)
              at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:71)
              at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:352)
              at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:344)
              at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:358)
              at jenkins.scm.api.SCMSource.fetch(SCMSource.java:564)
              at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:95)
              at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:263)
              at hudson.model.ResourceController.execute(ResourceController.java:97)
              at hudson.model.Executor.run(Executor.java:405)
          Finished: FAILURE
          {code}
          I also tried to run manually the git commands SCM Checkout Jenkin is using :
          {code:java}
          git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
          {code}
          It works fine for me and the tag 20170825-fc97b4e does exist inside my repository.

          Thanks :)
          New: Hello,

          I'm facing a strange issue since the last upgrade (when Blue Ocean was released in 1.2.0).

          I tried to downgrade almost everything (both jenkins to 2.60.2 and every plugins who might be related to git/scm). But I couldn't make it work again...

          The issue occurs whenever I try to launch a build or "Scan Multibranch Pipeline Now".

          Here is the errog log I get everytime :
          {code:java}
          Démarré par l'utilisateur segdim
           > git rev-parse --is-inside-work-tree # timeout=10
          Setting origin to https://git_url/ORG/repo.git
           > git config remote.origin.url https://git_url/ORG/repo.git # timeout=10
          Fetching origin...
          Fetching upstream changes from origin
           > git --version # timeout=10
           > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
          hudson.plugins.git.GitException: Command "git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*" returned status code 1:
          stdout:
          stderr: error: unable to resolve reference refs/tags/20170825-fc97b4e: Argument invalide
          Depuis https://git_url/ORG/repo.git
           ! [nouvelle étiquette] 20170825-fc97b4e -> 20170825-fc97b4e  (impossible de mettre à jour la référence locale)

              at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1924)
              at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1643)
              at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:71)
              at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:352)
              at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:344)
              at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:358)
              at jenkins.scm.api.SCMSource.fetch(SCMSource.java:564)
              at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:95)
              at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:263)
              at hudson.model.ResourceController.execute(ResourceController.java:97)
              at hudson.model.Executor.run(Executor.java:405)
          Finished: FAILURE
          {code}
          I also tried to run manually the git commands SCM Checkout Jenkins is using :
          {code:java}
          git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
          {code}
          It works fine for me and the tag 20170825-fc97b4e does exist inside my repository.

          I tried on multiple branches and other repositories and I got the same result.

          Thanks :)
          Dimitri SEGARD made changes -
          Labels Original: error git scm New: Jenkinsfile error git multibranch scm
          Mark Waite made changes -
          Assignee Original: Mark Waite [ markewaite ]
          Mark Waite made changes -
          Summary Original: Multibranch pipeline failing at Checkout SCM step (git unable to resolve reference) New: Multibranch pipeline failing at Checkout SCM step (git unable to resolve tag)
          Mark Waite made changes -
          Summary Original: Multibranch pipeline failing at Checkout SCM step (git unable to resolve tag) New: Multibranch pipeline failing at Checkout SCM step (unable to resolve tag)

          Mark Waite added a comment -

          I believe you were relying on fetching of tags which was implicit in multi-branch pipeline polling with versions of the git plugin prior to release 3.4.0.  Tags are intentionally no longer fetched by default.

          Try adding the "Additional Behaviour" for the "Advanced clone options".  Adding that behavior to the multi-branch pipeline will enable fetching of tags, unless you check the checkbox to disable fetching of tags.  It also allows you to use other options if needed (like a reference repository and shallow clone).

          stephenc provided a better description in another bug report, but I can't find that other bug report in my JIRA searching.

          Mark Waite added a comment - I believe you were relying on fetching of tags which was implicit in multi-branch pipeline polling with versions of the git plugin prior to release 3.4.0.  Tags are intentionally no longer fetched by default. Try adding the "Additional Behaviour" for the "Advanced clone options".  Adding that behavior to the multi-branch pipeline will enable fetching of tags, unless you check the checkbox to disable fetching of tags.  It also allows you to use other options if needed (like a reference repository and shallow clone). stephenc provided a better description in another bug report, but I can't find that other bug report in my JIRA searching.

          https://github.com/jenkinsci/git-plugin/pull/528 is probably what you are after if you want to build tags

          Stephen Connolly added a comment - https://github.com/jenkinsci/git-plugin/pull/528 is probably what you are after if you want to build tags

          Mark Waite added a comment -

          segdim if you would like to assist with the evaluation of the pull request that stephenconnolly mentioned, you can download the git.hpi and install it on a test system.

          Mark Waite added a comment - segdim if you would like to assist with the evaluation of the pull request that stephenconnolly mentioned, you can download the git.hpi and install it on a test system.

          Dimitri SEGARD added a comment - - edited

          Thanks for your response.

          I configured my multibranch pipeline in a really simple way (Project repository URL + Discover branches behaviour)

          I'm not relying on tags for my build (I don't use them inside my Jenkinsfile). I'm not trying to build tags I just want the Checkout SCM to fetch the last commit from the specified branch.

          When I add the "Advanced clone behaviours" and  whether I check or not the "Do not fetch tags" checkbox I get the same result... Jenkins is still trying to run the command with the --tags argument.

          git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*

           

          Dimitri SEGARD added a comment - - edited Thanks for your response. I configured my multibranch pipeline in a really simple way (Project repository URL + Discover branches behaviour) I'm not relying on tags for my build (I don't use them inside my Jenkinsfile). I'm not trying to build tags I just want the Checkout SCM to fetch the last commit from the specified branch. When I add the "Advanced clone behaviours" and  whether I check or not the "Do not fetch tags" checkbox I get the same result... Jenkins is still trying to run the command with the --tags argument. git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*  

            Unassigned Unassigned
            segdim Dimitri SEGARD
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: