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

Unable to checkout repository with git-plugin ArrayIndexOutOfBoundsException

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: git-client-plugin
    • Labels:
      None
    • Environment:
      Windows Server 2016 64-bit
    • Similar Issues:

      Description

      Currently running the latest version of Jenkins with the latest plugins required for Blue Ocean.

      Jenkins is unable to check-out certain repositories that we use for an unknown reason.
      The ArrayIndexOutOfBoundsException us occurring here:

      https://github.com/jenkinsci/git-client-plugin/blob/master/src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java#L2043

      java.lang.ArrayIndexOutOfBoundsException: 1
       at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.parseBranches(CliGitAPIImpl.java:2043)
       at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getBranches(CliGitAPIImpl.java:2064)
       at hudson.plugins.git.GitAPI.getBranches(GitAPI.java:195)
       at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:2199)
       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:153)
       at hudson.remoting.UserRequest.perform(UserRequest.java:50)
       at hudson.remoting.Request$2.run(Request.java:336)
       at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
       at java.util.concurrent.FutureTask.run(FutureTask.java:266)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
       at hudson.remoting.Engine$1$1.run(Engine.java:94)
       at java.lang.Thread.run(Thread.java:748)
       at ......remote call to JNLP4-connect connection from JENKINSSLAVE01/10.200.8.6:57602(Native Method)
       at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1545)
       at hudson.remoting.UserResponse.retrieve(UserRequest.java:253)
       at hudson.remoting.Channel.call(Channel.java:830)
       at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:146)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:498)
       at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:132)
       at com.sun.proxy.$Proxy105.execute(Unknown Source)
       at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1167)
       at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:113)
       at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:85)
       at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:75)
       at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
       at hudson.security.ACL.impersonate(ACL.java:260)
       at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
       at java.util.concurrent.FutureTask.run(FutureTask.java:266)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
       at java.lang.Thread.run(Thread.java:748)
      

        Attachments

          Issue Links

            Activity

            Hide
            markewaite Mark Waite added a comment -

            Luke Last I'm open to a pull request with one or more tests which show the problem, or even to a description of the specific branch names which cause the problem. I'm hesitant to insert bounds checking for a case that isn't duplicated by a test in the code.

            I'm not sure what Chris Franco means as a "fullstop" in a branch name, though I assume he means ASCII 2E. If that's the case, then I don't see how that would cause a problem as a branch name, since '.' (ASCII 2E) is allowed as a character in a branch name.

            I could see that could being broken by a newline (or other end of line character) in the branch name. However, if a branch name includes some form of line break character (newline, carriage return, etc.) then it is not a valid git branch name, at least per the definition of the valid characters in the git man page.

            I've placed a test in my regression test kit which checks for ASCII 2E in a branch name. The test passes. Unfortunately, that means I still can't duplicate this problem.

            Show
            markewaite Mark Waite added a comment - Luke Last I'm open to a pull request with one or more tests which show the problem, or even to a description of the specific branch names which cause the problem. I'm hesitant to insert bounds checking for a case that isn't duplicated by a test in the code. I'm not sure what Chris Franco means as a "fullstop" in a branch name, though I assume he means ASCII 2E . If that's the case, then I don't see how that would cause a problem as a branch name, since '.' (ASCII 2E) is allowed as a character in a branch name. I could see that could being broken by a newline (or other end of line character) in the branch name. However, if a branch name includes some form of line break character (newline, carriage return, etc.) then it is not a valid git branch name , at least per the definition of the valid characters in the git man page . I've placed a test in my regression test kit which checks for ASCII 2E in a branch name. The test passes. Unfortunately, that means I still can't duplicate this problem.
            Hide
            francommit Chris Franco added a comment -

            Luke Last the solution I also came across to fix the problem was deleting multiple branches until it worked.

            Show
            francommit Chris Franco added a comment - Luke Last the solution I also came across to fix the problem was deleting multiple branches until it worked.
            Hide
            markewaite Mark Waite added a comment -

            Thanks to Vadivel Natarajan, I've finally understood the condition. Luke Last was correct that bounds checking is what is needed. Sorry for my slow comprehension!

            The bounds checking which Luke recommended (along with an automated test) was provided about 3 weeks ago in a merge to the master branch. It will be included in the next release of the git client plugin.

            You can test an early build by downloading the latest artifact from the ci.jenkins.io build.

            Show
            markewaite Mark Waite added a comment - Thanks to Vadivel Natarajan , I've finally understood the condition. Luke Last was correct that bounds checking is what is needed. Sorry for my slow comprehension! The bounds checking which Luke recommended (along with an automated test) was provided about 3 weeks ago in a merge to the master branch . It will be included in the next release of the git client plugin. You can test an early build by downloading the latest artifact from the ci.jenkins.io build .
            Hide
            markewaite Mark Waite added a comment -

            Will be fixed with release of git client plugin 2.6.0

            Show
            markewaite Mark Waite added a comment - Will be fixed with release of git client plugin 2.6.0
            Hide
            markewaite Mark Waite added a comment -

            Included in git client plugin 2.6.0, released 27 Oct 2017

            Show
            markewaite Mark Waite added a comment - Included in git client plugin 2.6.0, released 27 Oct 2017

              People

              • Assignee:
                markewaite Mark Waite
                Reporter:
                francommit Chris Franco
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: