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

2.4.5 bad regression: unable to handle previously-acceptable branch names

    Details

    • Similar Issues:

      Description

      Git client plugin 2.4.5 (latest released) is unable to handle %2F in a branch name.

      E.g:

      The git project has a branch called "feature/story-cb-807" in a multi-branch project. We have Gerrit rules that change code review behaviour when the branch startts with "feature/". Git branch scanning in the multi-branch project causes the sub-job in Jenkins to be called "feature%2Fstory-cb-807".

      With git-client 2.1.0, this build completes without error.

      With git-client 2.4.5, this build almost instantly aborts with

      Cloning the remote Git repository
      Cloning repository ssh://jmellor@gerrit.internal:29418/soa-workers/soa-workers-common-packages
      > /usr/bin/git init /var/lib/jenkins/workspace/soa_workers_common_packages/feature%2Fstory-cb-807 # timeout=10
      Fetching upstream changes from ssh://jmellor@gerrit.internal:29418/soa-workers/soa-workers-common-packages
      > /usr/bin/git --version # timeout=10
      using GIT_SSH to set credentials
      > /usr/bin/git fetch --tags --progress ssh://jmellor@gerrit.internal:29418/soa-workers/soa-workers-common-packages +refs/heads/:refs/remotes/origin/
      ERROR: Error cloning remote repo 'origin'
      hudson.plugins.git.GitException
      : Command "/usr/bin/git fetch --tags --progress ssh://jmellor@gerrit.internal:29418/soa-workers/soa-workers-common-packages +refs/heads/:refs/remotes/origin/" returned status code 128:
      stdout:
      stderr: percent_expand: unknown key %2
      fatal: Could not read from remote repository.

      Please make sure you have the correct access rights
      and the repository exists.

      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1877)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1596)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:71)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:348)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:545)
      at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153)
      at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146)
      at hudson.remoting.UserRequest.perform(UserRequest.java:120)
      at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      at hudson.remoting.Request$2.run(Request.java:332)
      at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:745)
      at ......remote call to buildslave3(Native Method)
      at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1416)
      at hudson.remoting.UserResponse.retrieve(UserRequest.java:220)
      at hudson.remoting.Channel.call(Channel.java:781)
      at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:146)
      at sun.reflect.GeneratedMethodAccessor154.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:132)
      at com.sun.proxy.$Proxy73.execute(Unknown Source)
      at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1054)
      at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1094)
      at hudson.scm.SCM.checkout(SCM.java:485)
      at hudson.model.AbstractProject.checkout(AbstractProject.java:1269)
      at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:607)
      at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
      at hudson.model.Run.execute(Run.java:1738)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:98)
      at hudson.model.Executor.run(Executor.java:410)
      ERROR: null

      This is a typical example, but we have a large number of builds depending on the now-broken functionality.

      Git client 2.4.5 is broken. Git client 2.1.0 handles this branch name without issue.

        Attachments

          Issue Links

            Activity

            Hide
            markewaite Mark Waite added a comment -

            I've created a pull request which includes a fix for this. The pull request build is available for test now. Could you test it within the next few days and report results?

            I'd like to release either Saturday 20 May 2017 or Tuesday 23 May 2017.

            Show
            markewaite Mark Waite added a comment - I've created a pull request which includes a fix for this. The pull request build is available for test now. Could you test it within the next few days and report results? I'd like to release either Saturday 20 May 2017 or Tuesday 23 May 2017.
            Hide
            alt_jmellor John Mellor added a comment -

            I have dropped the new git-client.hpi into my primary Jenkins install, and can confirm that this appears to correct the issue.

            Thanks for the quick turnaround!

            Show
            alt_jmellor John Mellor added a comment - I have dropped the new git-client.hpi into my primary Jenkins install, and can confirm that this appears to correct the issue. Thanks for the quick turnaround!
            Hide
            markewaite Mark Waite added a comment -

            Fixed in git client plugin 2.4.6 released 24 May 2017

            Show
            markewaite Mark Waite added a comment - Fixed in git client plugin 2.4.6 released 24 May 2017

              People

              • Assignee:
                markewaite Mark Waite
                Reporter:
                alt_jmellor John Mellor
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: