hudson.plugins.git.GitException: Could not checkout null

Jenkins JIRA | Jonas Rabbe | 3 years ago
  1. 0

    Upgraded to version 2.0 of the Git plugin today when it was available in my plugin manager. Created an {{jgit}} Git plugin in the settings, and updated my git settings as shown in the {{config.xml}} below. The build fails quickly with the following error when trying to check out {{origin/master}}. {code} Started by user Jonas Rabbe [EnvInject] - Loading node environment variables. Building remotely on Regular Jenkins Slave (i-1dc1d27a) in workspace /home/jenkins/workspace/radius-master [ssh-agent] Using credentials git (Radius repo deploy key) [ssh-agent] Looking for ssh-agent implementation... [ssh-agent] Java/JNR ssh-agent [ssh-agent] Started. Wiping out workspace first. Cloning the remote Git repository remote: Counting objects remote: Compressing objects Receiving objects Resolving deltas Updating references Checking out Revision 5bd8914ecb46307249add0916b3493160c882096 (origin/master) FATAL: Could not checkout null hudson.plugins.git.GitException: Could not checkout null at org.jenkinsci.plugins.gitclient.JGitAPIImpl.checkout(JGitAPIImpl.java:202) at org.jenkinsci.plugins.gitclient.JGitAPIImpl.checkoutBranch(JGitAPIImpl.java:239) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) 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.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:724) Caused by: org.eclipse.jgit.api.errors.InvalidRefNameException: Branch name <null> is not allowed at org.eclipse.jgit.api.CheckoutCommand.processOptions(CheckoutCommand.java:471) at org.eclipse.jgit.api.CheckoutCommand.call(CheckoutCommand.java:200) at org.jenkinsci.plugins.gitclient.JGitAPIImpl.checkout(JGitAPIImpl.java:187) ... 16 more {code} My {{config.xml}} for the SCM part looks like this: {code} <scm class="hudson.plugins.git.GitSCM" plugin="git@2.0"> <configVersion>2</configVersion> <userRemoteConfigs> <hudson.plugins.git.UserRemoteConfig> <url>git@github.com:RadiusIntelligence/radius.git</url> <credentialsId>6893051d-565e-4a85-8c56-5d6f88f45d1a</credentialsId> </hudson.plugins.git.UserRemoteConfig> </userRemoteConfigs> <branches> <hudson.plugins.git.BranchSpec> <name>origin/master</name> </hudson.plugins.git.BranchSpec> </branches> <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations> <gitTool>jgit</gitTool> <submoduleCfg class="list"/> <extensions> <hudson.plugins.git.extensions.impl.WipeWorkspace/> </extensions> </scm> {code}

    Jenkins JIRA | 3 years ago | Jonas Rabbe
    hudson.plugins.git.GitException: Could not checkout null
  2. 0

    Upgraded to version 2.0 of the Git plugin today when it was available in my plugin manager. Created an {{jgit}} Git plugin in the settings, and updated my git settings as shown in the {{config.xml}} below. The build fails quickly with the following error when trying to check out {{origin/master}}. {code} Started by user Jonas Rabbe [EnvInject] - Loading node environment variables. Building remotely on Regular Jenkins Slave (i-1dc1d27a) in workspace /home/jenkins/workspace/radius-master [ssh-agent] Using credentials git (Radius repo deploy key) [ssh-agent] Looking for ssh-agent implementation... [ssh-agent] Java/JNR ssh-agent [ssh-agent] Started. Wiping out workspace first. Cloning the remote Git repository remote: Counting objects remote: Compressing objects Receiving objects Resolving deltas Updating references Checking out Revision 5bd8914ecb46307249add0916b3493160c882096 (origin/master) FATAL: Could not checkout null hudson.plugins.git.GitException: Could not checkout null at org.jenkinsci.plugins.gitclient.JGitAPIImpl.checkout(JGitAPIImpl.java:202) at org.jenkinsci.plugins.gitclient.JGitAPIImpl.checkoutBranch(JGitAPIImpl.java:239) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) 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.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:724) Caused by: org.eclipse.jgit.api.errors.InvalidRefNameException: Branch name <null> is not allowed at org.eclipse.jgit.api.CheckoutCommand.processOptions(CheckoutCommand.java:471) at org.eclipse.jgit.api.CheckoutCommand.call(CheckoutCommand.java:200) at org.jenkinsci.plugins.gitclient.JGitAPIImpl.checkout(JGitAPIImpl.java:187) ... 16 more {code} My {{config.xml}} for the SCM part looks like this: {code} <scm class="hudson.plugins.git.GitSCM" plugin="git@2.0"> <configVersion>2</configVersion> <userRemoteConfigs> <hudson.plugins.git.UserRemoteConfig> <url>git@github.com:RadiusIntelligence/radius.git</url> <credentialsId>6893051d-565e-4a85-8c56-5d6f88f45d1a</credentialsId> </hudson.plugins.git.UserRemoteConfig> </userRemoteConfigs> <branches> <hudson.plugins.git.BranchSpec> <name>origin/master</name> </hudson.plugins.git.BranchSpec> </branches> <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations> <gitTool>jgit</gitTool> <submoduleCfg class="list"/> <extensions> <hudson.plugins.git.extensions.impl.WipeWorkspace/> </extensions> </scm> {code}

    Jenkins JIRA | 3 years ago | Jonas Rabbe
    hudson.plugins.git.GitException: Could not checkout null
  3. 0

    If I don't specify a particular branch name, using JGit integration, I get an error. Workaround is to specify one. Building remotely on jenkins-1 in workspace /jenkins/workspace/Realtime-dev-main Fetching changes from the remote Git repository Checking out Revision 6dff8ca0de2e9605c295d09106b756485dbbe22d (origin/dev/main) FATAL: Could not checkout null hudson.plugins.git.GitException: Could not checkout null at org.jenkinsci.plugins.gitclient.JGitAPIImpl.checkout(JGitAPIImpl.java:200) at org.jenkinsci.plugins.gitclient.JGitAPIImpl.checkoutBranch(JGitAPIImpl.java:231) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) 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(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: org.eclipse.jgit.api.errors.InvalidRefNameException: Branch name <null> is not allowed at org.eclipse.jgit.api.CheckoutCommand.processOptions(CheckoutCommand.java:471) at org.eclipse.jgit.api.CheckoutCommand.call(CheckoutCommand.java:200) at org.jenkinsci.plugins.gitclient.JGitAPIImpl.checkout(JGitAPIImpl.java:185) ... 17 more

    Jenkins JIRA | 3 years ago | magnayn
    hudson.plugins.git.GitException: Could not checkout null
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    If I don't specify a particular branch name, using JGit integration, I get an error. Workaround is to specify one. Building remotely on jenkins-1 in workspace /jenkins/workspace/Realtime-dev-main Fetching changes from the remote Git repository Checking out Revision 6dff8ca0de2e9605c295d09106b756485dbbe22d (origin/dev/main) FATAL: Could not checkout null hudson.plugins.git.GitException: Could not checkout null at org.jenkinsci.plugins.gitclient.JGitAPIImpl.checkout(JGitAPIImpl.java:200) at org.jenkinsci.plugins.gitclient.JGitAPIImpl.checkoutBranch(JGitAPIImpl.java:231) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) 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(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: org.eclipse.jgit.api.errors.InvalidRefNameException: Branch name <null> is not allowed at org.eclipse.jgit.api.CheckoutCommand.processOptions(CheckoutCommand.java:471) at org.eclipse.jgit.api.CheckoutCommand.call(CheckoutCommand.java:200) at org.jenkinsci.plugins.gitclient.JGitAPIImpl.checkout(JGitAPIImpl.java:185) ... 17 more

    Jenkins JIRA | 3 years ago | magnayn
    hudson.plugins.git.GitException: Could not checkout null
  6. 0

    After upgrading git-client to 1.4.5 and git to 2.0 still having problems with cloning GIT repository using https (see also: JENKINS-19938): After adding credentials and selecting credentials in job's config Jenkins seems to have access the repo (no error on leaving field with repo's URL - this is better than before concerning usage of credentials plugin). However - cloning the repo when executing build does not work (using any of available git clients: generic (1.7.1), jGit) Errors: * Log in Jenkin's job (machine's names etc. changed), generic command-line client {code} Started by an SCM change Building remotely on SOMEMACHINE in workspace /whatever/workspace/jobname Deleting project workspace... done Cloning the remote Git repository Cloning repository https://git.mysite/git/myrepo git --version git version 1.7.1 ERROR: Error cloning remote repo 'origin' hudson.plugins.git.GitException: Could not clone https://git.mysite/git/myrepo at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:298) at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:151) at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:144) 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(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at hudson.remoting.Engine$1$1.run(Engine.java:61) at java.lang.Thread.run(Thread.java:724) Caused by: hudson.plugins.git.GitException: Failed to connect to https://git.mysite/git/myrepo using credentials mybuilduser - build user at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getURLWithCrendentials(CliGitAPIImpl.java:1391) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getURLWithCrendentials(CliGitAPIImpl.java:1338) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:52) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:292) ... 12 more ERROR: null Archiving artifacts Finished: FAILURE {code} * error in Jenkins slave, all what happens during build's execution (failed because of clone problem): {code} Oct 25, 2013 3:02:13 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry INFO: I/O exception (javax.net.ssl.SSLException) caught when processing request: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty Oct 25, 2013 3:02:13 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry INFO: Retrying request Oct 25, 2013 3:02:13 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry INFO: I/O exception (javax.net.ssl.SSLException) caught when processing request: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty Oct 25, 2013 3:02:13 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry INFO: Retrying request Oct 25, 2013 3:02:13 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry INFO: I/O exception (javax.net.ssl.SSLException) caught when processing request: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty Oct 25, 2013 3:02:13 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry INFO: Retrying request Oct 25, 2013 3:02:13 PM hudson.plugins.logparser.LogParserStatusComputer computeStatusMatches INFO: Local temp file:/tmp/log-parser_S23_1_ARC_Spec_check_build_226 Oct 25, 2013 3:02:13 PM hudson.plugins.logparser.LogParserReader readLogPart INFO: Start reading log part 0 in thread #0 Oct 25, 2013 3:02:13 PM hudson.plugins.logparser.LogParserReader readLogPart INFO: Done reading log part 0 Oct 25, 2013 3:02:13 PM hudson.plugins.logparser.LogParserThread getLineStatuses INFO: LogParserThread: Start parsing log part 0 Oct 25, 2013 3:02:13 PM hudson.plugins.logparser.LogParserThread getLineStatuses INFO: LogParserThread: Done parsing log part 0 {code} * console output when using jGit: {code} Started by user twolak Building remotely on some_wn in workspace /whatever/workspace/jobname Deleting project workspace... done Cloning the remote Git repository remote: Counting objects remote: Compressing objects Receiving objects Resolving deltas Updating references Checking out Revision 520d39d92ee332fcc5213e0fcd8b465af2a7c244 (origin/jenkins) FATAL: Could not checkout null hudson.plugins.git.GitException: Could not checkout null at org.jenkinsci.plugins.gitclient.JGitAPIImpl.checkout(JGitAPIImpl.java:202) at org.jenkinsci.plugins.gitclient.JGitAPIImpl.checkoutBranch(JGitAPIImpl.java:239) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:282) at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:263) at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:222) 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(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at hudson.remoting.Engine$1$1.run(Engine.java:61) at java.lang.Thread.run(Thread.java:724) Caused by: org.eclipse.jgit.api.errors.InvalidRefNameException: Branch name <null> is not allowed at org.eclipse.jgit.api.CheckoutCommand.processOptions(CheckoutCommand.java:471) at org.eclipse.jgit.api.CheckoutCommand.call(CheckoutCommand.java:200) at org.jenkinsci.plugins.gitclient.JGitAPIImpl.checkout(JGitAPIImpl.java:187) ... 18 more {code} Please note that https auth. problem with cloning git repo exists for both major cases: * using the new credentials plugin * using {{.netrc}} (regardless of [the statement that should work in git-client 1.4.4|https://issues.jenkins-ci.org/browse/JENKINS-20175?focusedCommentId=187952&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-187952] - it is _not_ working, at least for our case). Could you please give fixing at least one way of auth. some high priority? It is impossible to use the plugin in this state...

    Jenkins JIRA | 3 years ago | Alex Cohen
    hudson.plugins.git.GitException: Could not checkout null

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.eclipse.jgit.api.errors.InvalidRefNameException

      Branch name <null> is not allowed

      at org.eclipse.jgit.api.CheckoutCommand.processOptions()
    2. JGit - Core
      CheckoutCommand.call
      1. org.eclipse.jgit.api.CheckoutCommand.processOptions(CheckoutCommand.java:471)
      2. org.eclipse.jgit.api.CheckoutCommand.call(CheckoutCommand.java:200)
      2 frames
    3. org.jenkinsci.plugins
      JGitAPIImpl.checkoutBranch
      1. org.jenkinsci.plugins.gitclient.JGitAPIImpl.checkout(JGitAPIImpl.java:187)
      2. org.jenkinsci.plugins.gitclient.JGitAPIImpl.checkoutBranch(JGitAPIImpl.java:239)
      2 frames
    4. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:606)
      4 frames
    5. Hudson :: Remoting Layer
      InterceptingExecutorService$1.call
      1. hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:299)
      2. hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:280)
      3. hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:239)
      4. hudson.remoting.UserRequest.perform(UserRequest.java:118)
      5. hudson.remoting.UserRequest.perform(UserRequest.java:48)
      6. hudson.remoting.Request$2.run(Request.java:326)
      7. hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
      7 frames
    6. Java RT
      Thread.run
      1. java.util.concurrent.FutureTask.run(FutureTask.java:262)
      2. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      3. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      4. java.lang.Thread.run(Thread.java:724)
      4 frames