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

Unable to checkout repository with git-plugin ArrayIndexOutOfBoundsException

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • git-client-plugin
    • None
    • Windows Server 2016 64-bit

      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)
      

          [JENKINS-45894] Unable to checkout repository with git-plugin ArrayIndexOutOfBoundsException

          Chris Franco created issue -
          Chris Franco made changes -
          Environment Original: Windows Server 2016 64-bot
          New: Windows Server 2016 64-bit
          Chris Franco made changes -
          Description Original: 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)
          New: 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)

          Chris Franco added a comment -

          Hey I'm happy to work on this. Making a fork from the Github but I'm unsure how to hook it back into JIRA here.
          Is there an easy way? I'll just name my branch the same name as this ticket.

          Chris Franco added a comment - Hey I'm happy to work on this. Making a fork from the Github but I'm unsure how to hook it back into JIRA here. Is there an easy way? I'll just name my branch the same name as this ticket.
          Mark Waite made changes -
          Assignee Original: Mark Waite [ markewaite ]
          Mark Waite made changes -
          Description Original: 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)
          New: 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]

          {noformat}
          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)
          {noformat}

          Mark Waite added a comment -

          Glad to have you work on it.

          That exception seems to indicate that the output of "git branch -v" in that repository contains unexpected output. The unexpected output is longer than 44 characters and includes a space character in the string, but it does not appear to have a space character after the first two characters of the string.

          That method is parsing the output of git branch -v --no-abbrev, and I'm not aware of any output of git branch -v --no-abbrev which has leading spaces, is at least 44 characters long, but includes no spaces after the initial two characters.

          I would be suspicious of some unexpected condition on that repository or on that machine.

          Does that repository fail to clone on every Jenkins agent, or only on a specific agent?

          What is the output of git branch -v --no-abbrev on that agent, in that working directory?

          Mark Waite added a comment - Glad to have you work on it. That exception seems to indicate that the output of "git branch -v" in that repository contains unexpected output. The unexpected output is longer than 44 characters and includes a space character in the string, but it does not appear to have a space character after the first two characters of the string. That method is parsing the output of git branch -v --no-abbrev , and I'm not aware of any output of git branch -v --no-abbrev which has leading spaces, is at least 44 characters long, but includes no spaces after the initial two characters. I would be suspicious of some unexpected condition on that repository or on that machine. Does that repository fail to clone on every Jenkins agent, or only on a specific agent? What is the output of git branch -v --no-abbrev on that agent, in that working directory?

          Chris Franco added a comment - - edited

          Hi Mark.

          It's only for about 2 repositories that we use (that I've tested thus far) 

          I've run git branch -v --no-abbrev, on our remote branch and nothing seems to not meet those conditions.
          They all look similar to this:

          origin-http/xx-xxxx-xxxxxxxxxxx-xxxxxxxxx-xxxx-xxxxxxxxxxx                 4419xxxxxxxxxxxxxxxxxxxxxxxxxxx4cfa347e8 xx-xxxx Xxx xxx xxx xxxxx xxx xxx xxxx.

          However. I followed your instructions and ran it on the specific agent itself in the working directory and I've found the problem:

          • (HEAD detached at 4d5095049) 4d50950494af2182e52755406e72b0e55bced6dd Merge pull request #1826 in xx/xx from bugfix/xx-xxxxx-xxxxx-raised-by-xxxxxxxxxxxxxxxxxxxxxxxxxxxxx to dev

          It's the 'HEAD detached' part which is causing the error. I'm unsure what's causing this.
          This is the first command I'm calling:

          git(url: "ssh://git@xxx:xxxx/xxxx/xxxxx.git", branch: "dev", credentialsId: 'xxxx')

          So nothing should be moving it out.

          Chris Franco added a comment - - edited Hi Mark. It's only for about 2 repositories that we use (that I've tested thus far)  I've run  git branch -v --no-abbrev , on our remote branch and nothing seems to not meet those conditions. They all look similar to this: origin-http/xx-xxxx-xxxxxxxxxxx-xxxxxxxxx-xxxx-xxxxxxxxxxx                 4419xxxxxxxxxxxxxxxxxxxxxxxxxxx4cfa347e8 xx-xxxx Xxx xxx xxx xxxxx xxx xxx xxxx. However. I followed your instructions and ran it on the specific agent itself in the working directory and I've found the problem: (HEAD detached at 4d5095049) 4d50950494af2182e52755406e72b0e55bced6dd Merge pull request #1826 in xx/xx from bugfix/xx-xxxxx-xxxxx-raised-by-xxxxxxxxxxxxxxxxxxxxxxxxxxxxx to dev It's the 'HEAD detached' part which is causing the error. I'm unsure what's causing this. This is the first command I'm calling: git(url: "ssh://git@xxx:xxxx/xxxx/xxxxx.git", branch: "dev", credentialsId: 'xxxx') So nothing should be moving it out.

          Mark Waite added a comment - - edited

          I see that same output when I checkout a detached head (which the git plugin does very frequently). The git plugin is willing to operate on a repository that is checked out at a specific SHA1, without any branch at that point.

          You can see that type of condition if you use the command git checkout HEAD^. That will checkout the source code as it existed one commit prior to the current location.

          Since I see that condition on multiple git versions and on multiple machines, I'm skeptical that is the root cause of the problem. However, it certainly could be. If it is the root of the problem, then I am perplexed why thousands of users are not reporting the same problem. It is a very common use case that the git plugin performs a checkout with a detached HEAD.

          Mark Waite added a comment - - edited I see that same output when I checkout a detached head (which the git plugin does very frequently). The git plugin is willing to operate on a repository that is checked out at a specific SHA1, without any branch at that point. You can see that type of condition if you use the command git checkout HEAD^ . That will checkout the source code as it existed one commit prior to the current location. Since I see that condition on multiple git versions and on multiple machines, I'm skeptical that is the root cause of the problem. However, it certainly could be. If it is the root of the problem, then I am perplexed why thousands of users are not reporting the same problem. It is a very common use case that the git plugin performs a checkout with a detached HEAD.

          Chris Franco added a comment -

          Hmmm I agree that it's a little odd that thousands of users are not reporting the same problem.

          However, I did go to the same agent and look at a repository where it worked using the exact same code and noticed that it was on the dev branch and not a detached head.

          • dev 8abf5d0fa92810e3ba2739802bb77452cf9eedbd Merge pull request #894

          I'm beginning to think something is causing the repository to checkout in a detached state. I've done a comparison between the two repositories on our SCM and can't notice any differences. I'm totally perplexed.

          Chris Franco added a comment - Hmmm I agree that it's a little odd that thousands of users are not reporting the same problem. However, I did go to the same agent and look at a repository where it worked using the exact same code and noticed that it was on the dev branch and not a detached head. dev 8abf5d0fa92810e3ba2739802bb77452cf9eedbd Merge pull request #894 I'm beginning to think something is causing the repository to checkout in a detached state. I've done a comparison between the two repositories on our SCM and can't notice any differences. I'm totally perplexed.

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

              Created:
              Updated:
              Resolved: