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

Git checkout fails if submodule defined in .gitmodules don't exist

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • git-client-plugin
    • None
    • Jenkins 2.46.2
      Git Client 2.4.5
      Git Plugin 3.3.0

      If a submodule is defined in .gitmodules but doesn't actually exist in the repo, the Git Plugin fails to checkout the repo:

      hudson.plugins.git.GitException: Command "git config --get submodule.callme2.url" returned status code 1:

      The checkout only succeeds after the following is removed from .gitmodules:

      [submodule "callme2"]
      	path = callme2
      	url = ../callme_2

      This is a minor bug, since the reference to "callme2" could be removed from .gitmodules since it was not actually being used. However, it seems like the Git Plugin should not have to depend on the .gitmodules file being 100% accurate in order to function correctly. 

       

      This was not an issue with the previous version of Git Client Plugin or Git Plugin

       

          [JENKINS-43977] Git checkout fails if submodule defined in .gitmodules don't exist

          Greg Hull added a comment -

          Just in case this helps someone else. The url in .gitmodules is case sensitive for the plugin. Running git in a command line is not case sensitive. This caused me some confusion since the git submodule update --init –recursive command would work from a command line, but I would get the following exception from the plugin. Once I changed the case in .gitmodules to match the case in the git repo the plugin worked.
          hudson.plugins.git.GitException: Command "git config --get submodule.xxxxx/xxxxxxx.url" returned status code 1:
          stdout:
          stderr:
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1996)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1964)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1960)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1597)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1609)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getSubmoduleUrl(CliGitAPIImpl.java:1209)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$7.execute(CliGitAPIImpl.java:1135)
          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:207)
          at hudson.remoting.UserRequest.perform(UserRequest.java:53)
          at hudson.remoting.Request$2.run(Request.java:358)
          at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
          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 java.lang.Thread.run(Thread.java:748)
          Caused: java.io.IOException: Could not perform submodule update
          at hudson.plugins.git.extensions.impl.SubmoduleOption.onCheckoutCompleted(SubmoduleOption.java:113)
          at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1238)
          at hudson.scm.SCM.checkout(SCM.java:495)
          at hudson.model.AbstractProject.checkout(AbstractProject.java:1202)
          at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
          at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
          at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
          at hudson.model.Run.execute(Run.java:1724)
          at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
          at hudson.model.ResourceController.execute(ResourceController.java:97)
          at hudson.model.Executor.run(Executor.java:429)
           

          Greg Hull added a comment - Just in case this helps someone else. The url in .gitmodules is case sensitive for the plugin. Running git in a command line is not case sensitive. This caused me some confusion since the git submodule update --init –recursive command would work from a command line, but I would get the following exception from the plugin. Once I changed the case in .gitmodules to match the case in the git repo the plugin worked. hudson.plugins.git.GitException: Command "git config --get submodule.xxxxx/xxxxxxx.url" returned status code 1: stdout: stderr: at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1996) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1964) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1960) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1597) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1609) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getSubmoduleUrl(CliGitAPIImpl.java:1209) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$7.execute(CliGitAPIImpl.java:1135) 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:207) at hudson.remoting.UserRequest.perform(UserRequest.java:53) at hudson.remoting.Request$2.run(Request.java:358) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) 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 java.lang.Thread.run(Thread.java:748) Caused: java.io.IOException: Could not perform submodule update at hudson.plugins.git.extensions.impl.SubmoduleOption.onCheckoutCompleted(SubmoduleOption.java:113) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1238) at hudson.scm.SCM.checkout(SCM.java:495) at hudson.model.AbstractProject.checkout(AbstractProject.java:1202) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499) at hudson.model.Run.execute(Run.java:1724) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429)  

            Unassigned Unassigned
            mksmith Matthew Smith
            Votes:
            5 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: