-
Bug
-
Resolution: Fixed
-
Major
-
GIT LTS plugin on Linux
Since on of our recent updates of the jenkins LTS version and all available plugins, git checkout sometimes fail with the following exception:
FATAL: Could not checkout master with start point 94f70933316a337a21037ad791f6015ce7d561e5
hudson.plugins.git.GitException: Could not checkout master with start point 94f70933316a337a21037ad791f6015ce7d561e5
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.checkoutBranch(CliGitAPIImpl.java:1090)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:299)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:280)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:239)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:326)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: hudson.plugins.git.GitException: Result has multiple lines
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.firstLine(CliGitAPIImpl.java:422)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.revParse(CliGitAPIImpl.java:354)
at hudson.plugins.git.GitAPI.revParse(GitAPI.java:255)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.parseBranches(CliGitAPIImpl.java:1024)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getBranches(CliGitAPIImpl.java:1035)
at hudson.plugins.git.GitAPI.getBranches(GitAPI.java:153)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.checkoutBranch(CliGitAPIImpl.java:1081)
... 16 more
So ar this only happens in multi-configuration projects where we merge cchanges from a branch taht triggered the job back to the master branch. The error seems to occur randomly on one of the configurations, but not on the master job itself.
That message "Result has multiple lines" is not clear enough about what is really happening. Sorry about that.
I suspect the root cause of the problem is that the command "git rev-parse master^
{commit}" (or some variant) is reporting more than one line of output. That is unexpected, since master^{commit}should report that the working repository used by Jenkins for that specific job has an ambiguously revision named "master". There are two or more things which can legitimately resolve the name "master^
{commit}" for the "git rev-parse" command.If you're interested in seeing the test case in the git-client-plugin which shows the problem, look at test_jenkins_11177 in https://github.com/jenkinsci/git-client-plugin/blob/master/src/test/java/org/jenkinsci/plugins/gitclient/GitAPITestCase.java#L766 . The bug report which inspired that test was
JENKINS-11177.I'm not sure what's causing the case you've detected, since that bug was fixed over 6 months ago. Could you run the "git rev-parse master^{commit}
" command in that repository and attach its output? There must be more cases where that is not handled correctly.
Looking at the source code, and making guesses based on the stack trace, I think the problem comes from the revParse which is used to read the names of the branches.