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)

          I thought the error was happening during Checkout SCM.

          But when I'm looking at the last successful build it looks like the git fetch --tags command is executed before the actual Checkout SCM step.
          Here is an extract from the last successful build :

          > 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/*
          Seen branch in repository origin/dev
          Seen branch in repository origin/master
          Seen branch in repository origin/testing
          Seen 3 remote branches
          Obtained Jenkinsfile from fc97b4e2eff380cbbc2e45215b45fc9f65b841a0
          [Pipeline] node
          Running on maître in /opt/jenkins/workspace/repo_dev-OU35GOR6Z36TOQ75SC4PF75S6MDNBWN4ZD5YQCGK3CC3QNMEM4WA
          [Pipeline] {
          [Pipeline] stage
          [Pipeline] { (Declarative: Checkout SCM)
          [Pipeline] checkout
          Cloning the remote Git repository
          Cloning with configured refspecs honoured and without tags
          Cloning repository https://git_url/ORG/repo.git
          > git init /opt/jenkins/workspace/repo_dev-OU35GOR6Z36TOQ75SC4PF75S6MDNBWN4ZD5YQCGK3CC3QNMEM4WA # timeout=10
          Fetching upstream changes from https://git_url/ORG/repo.git
          > git --version # timeout=10
          > git fetch --no-tags --progress https://git_url/ORG/repo.git +refs/heads/*:refs/remotes/origin/*
          

          Dimitri SEGARD added a comment - I thought the error was happening during Checkout SCM. But when I'm looking at the last successful build it looks like the git fetch --tags command is executed before the actual Checkout SCM step. Here is an extract from the last successful build : > 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/* Seen branch in repository origin/dev Seen branch in repository origin/master Seen branch in repository origin/testing Seen 3 remote branches Obtained Jenkinsfile from fc97b4e2eff380cbbc2e45215b45fc9f65b841a0 [Pipeline] node Running on maître in /opt/jenkins/workspace/repo_dev-OU35GOR6Z36TOQ75SC4PF75S6MDNBWN4ZD5YQCGK3CC3QNMEM4WA [Pipeline] { [Pipeline] stage [Pipeline] { (Declarative: Checkout SCM) [Pipeline] checkout Cloning the remote Git repository Cloning with configured refspecs honoured and without tags Cloning repository https: //git_url/ORG/repo.git > git init /opt/jenkins/workspace/repo_dev-OU35GOR6Z36TOQ75SC4PF75S6MDNBWN4ZD5YQCGK3CC3QNMEM4WA # timeout=10 Fetching upstream changes from https: //git_url/ORG/repo.git > git --version # timeout=10 > git fetch --no-tags --progress https: //git_url/ORG/repo.git +refs/heads/*:refs/remotes/origin/*

          Mark Waite added a comment -

          A stackoverflow article suggests that you may need to remove the reference to that branch from the workspace.  You could test that theory by copying the pipeline job to a new name, and then check if the problem occurs with the new pipeline job.

          A different stackoverflow article suggests that sometimes an "invalid argument" message from git may indicate that a file in the repository contains an illegal character for the target platform (like ':' for Windows)

          Mark Waite added a comment - A stackoverflow article suggests that you may need to remove the reference to that branch from the workspace.  You could test that theory by copying the pipeline job to a new name, and then check if the problem occurs with the new pipeline job. A different stackoverflow article suggests that sometimes an "invalid argument" message from git may indicate that a file in the repository contains an illegal character for the target platform (like ':' for Windows)

          Dimitri SEGARD added a comment - - edited

          Jenkins is running on a Linux platform and our code is also written on Linux. This is happening for all our repositories and we don't use special characters for filenames (only - _ and .)

          When I'm executing the same commands ran by Jenkins on the same server I don't have any issue (the tags are properly fetched).

           

          git init test
          git config remote.origin.url https://git_url/ORG/repo.git
          git fetch --tags --progress origin '+refs/heads/*:refs/remotes/origin/*'
          

           

          I also tried to create an entire new multibranch pipeline with a different name and I get the same result.

           

          Dimitri SEGARD added a comment - - edited Jenkins is running on a Linux platform and our code is also written on Linux. This is happening for all our repositories and we don't use special characters for filenames (only - _ and .) When I'm executing the same commands ran by Jenkins on the same server I don't have any issue (the tags are properly fetched).   git init test git config remote.origin.url https: //git_url/ORG/repo.git git fetch --tags --progress origin '+refs/heads/*:refs/remotes/origin/*'   I also tried to create an entire new multibranch pipeline with a different name and I get the same result.  

          Mark Waite added a comment -

          Are you sure that you're running your "outside Jenkins" test in the same locale as you're running inside Jenkins?

          The message from command line git seems to indicate it is running in a French locale.  I can't tell if that French locale is UTF-8 aware or if it is an ISO 8859-1 locale.

          Is the failure specific to this repository?  For example, can you run a multi-branch pipeline from another repository?

          Mark Waite added a comment - Are you sure that you're running your "outside Jenkins" test in the same locale as you're running inside Jenkins? The message from command line git seems to indicate it is running in a French locale.  I can't tell if that French locale is UTF-8 aware or if it is an ISO 8859-1 locale. Is the failure specific to this repository?  For example, can you run a multi-branch pipeline from another repository?

          I ran my test on the same server as Jenkins. The locale defined on this server is fr_FR.UTF-8

          I deleted the specific tag from the repository and now it works...

           

          Dimitri SEGARD added a comment - I ran my test on the same server as Jenkins. The locale defined on this server is fr_FR.UTF-8 I deleted the specific tag from the repository and now it works...  

          This is happening for all our repositories and we don't use special characters for filenames (only - _ and .)

          By any chance do you have a shared global library defined? You'll either need the advanced behaviour there too or use the PR I have created and add Discover Tags to the shared library definition

          Stephen Connolly added a comment - This is happening for all our repositories and we don't use special characters for filenames (only - _ and .) By any chance do you have a shared global library defined? You'll either need the advanced behaviour there too or use the PR I have created and add Discover Tags to the shared library definition

          Should be fixed with the current release of the git plugin AIUI

          Stephen Connolly added a comment - Should be fixed with the current release of the git plugin AIUI

          Please reopen if not fixed in current git plugin release

          Stephen Connolly added a comment - Please reopen if not fixed in current git plugin release

          ASHOK MOHANTY added a comment -

          We are using git-client 3.0 and git plugin 4.0. Facing this error intermittently (inside a JNLP node). For cloning we are using a generic LDAP user without password.

          And/or please let me know the matching ticket where I can update this issue !!
          > GitLab: Your account has been blocked.
          fatal: Could not read from remote repository.

          On re-try/re-play it works fine.

          ASHOK MOHANTY added a comment - We are using git-client 3.0 and git plugin 4.0. Facing this error intermittently (inside a JNLP node). For cloning we are using a generic LDAP user without password. And/or please let me know the matching ticket where I can update this issue !! > GitLab: Your account has been blocked. fatal: Could not read from remote repository. On re-try/re-play it works fine.

          Mark Waite added a comment -

          akmjenkins asking unrelated questions on closed issues is unlikely to get you the help you want. Questions are best asked in the chat channels or on the mailing lists.

          Mark Waite added a comment - akmjenkins asking unrelated questions on closed issues is unlikely to get you the help you want. Questions are best asked in the chat channels or on the mailing lists .

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

              Created:
              Updated:
              Resolved: