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

Misconfiguration of submodules not clearly reported by git plugin

    Details

    • Similar Issues:

      Description

      I'm trying to clone a git repository that is hosted on a Atlassian Stash instance.
      The special case about the repository is that it has several submodules in it.

      Here is what I did to get to the error:
      1) I installed the latest git-plugin (2.4.0) / git-client-plugin (1.19.0) in Jenkins
      2) setup a ssh rsa key in Stash
      3) configured a Jenkins job to clone the repository from the Stash remote host (via ssh://)
      4) configured the ssh key & credentials in the Jenkins job git-plugin settings

      now when I run the build, Jenkins sucessfully clones the top-level git repository, but fails when trying to update the submodules (the error looks like Jenkins is trying to read username & password from a CLI, but only for the submodules)

      Gestartet durch Benutzer anonymous
      Baue in Arbeitsbereich C:\Program Files (x86)\Jenkins\jobs\test node\workspace
      No JDK named 'null' found
      No JDK named 'null' found
       > git.exe rev-parse --is-inside-work-tree # timeout=10
      Fetching changes from the remote Git repository
       > git.exe config remote.origin.url ssh://git@jenkinshost:7999/ipp/ipp-project.git # timeout=10
      Fetching upstream changes from ssh://git@jenkinshost:7999/ipp/ipp-project.git
       > git.exe --version # timeout=10
      using GIT_SSH to set credentials 
       > git.exe -c core.askpass=true fetch --tags --progress ssh://git@jenkinshost:7999/ipp/ipp-project.git +refs/heads/*:refs/remotes/origin/*
       > git.exe rev-parse "refs/remotes/origin/master^{commit}" # timeout=10
       > git.exe rev-parse "refs/remotes/origin/origin/master^{commit}" # timeout=10
      Checking out Revision a27c48024088c36e6eff3420c699ea1d1977e5cd (refs/remotes/origin/master)
      No JDK named 'null' found
       > git.exe config core.sparsecheckout # timeout=10
       > git.exe checkout -f a27c48024088c36e6eff3420c699ea1d1977e5cd
       > git.exe rev-list a27c48024088c36e6eff3420c699ea1d1977e5cd # timeout=10
       > git.exe remote # timeout=10
       > git.exe submodule init # timeout=10
       > git.exe submodule sync # timeout=10
       > git.exe config --get remote.origin.url # timeout=10
       > git.exe submodule update
      FATAL: Command "git.exe submodule update" returned status code 1:
      stdout: 
      stderr: Cloning into 'apps/ipp-app'...
      error: cannot spawn echo : No such file or directory
      bash: /dev/tty: No such device or address
      error: failed to execute prompt script (exit code 1)
      fatal: could not read Username for 'http://jenkinshost:7990': No error
      Clone of 'http://jenkinshost:7990/scm/ipp/ipp-app.git' into submodule path 'apps/ipp-app' failed
      
      hudson.plugins.git.GitException: Command "git.exe submodule update" returned status code 1:
      stdout: 
      stderr: Cloning into 'apps/ipp-app'...
      error: cannot spawn echo : No such file or directory
      bash: /dev/tty: No such device or address
      error: failed to execute prompt script (exit code 1)
      fatal: could not read Username for 'http://jenkinshost:7990': No error
      Clone of 'http://jenkinshost:7990/scm/ipp/ipp-app.git' into submodule path 'apps/ipp-app' failed
      
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1640)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:62)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$6.execute(CliGitAPIImpl.java:904)
      	at hudson.plugins.git.extensions.impl.SubmoduleOption.onCheckoutCompleted(SubmoduleOption.java:83)
      	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1074)
      	at hudson.scm.SCM.checkout(SCM.java:485)
      	at hudson.model.AbstractProject.checkout(AbstractProject.java:1275)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:610)
      	at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:532)
      	at hudson.model.Run.execute(Run.java:1741)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	at hudson.model.ResourceController.execute(ResourceController.java:98)
      	at hudson.model.Executor.run(Executor.java:410)
      Finished: FAILURE
      

        Attachments

          Activity

          drywolf Wolfgang Steiner created issue -
          drywolf Wolfgang Steiner made changes -
          Field Original Value New Value
          Description I'm trying to clone a git repository that is hosted on a Atlassian Stash instance.
          The special case about the repository is that it has several submodules in it.

          Here is what I did to get to the error:
          1) I installed the latest git-plugin (2.4.0) / git-client-plugin (1.19.0) in Jenkins
          2) setup a ssh rsa key in Stash
          3) configured a Jenkins job to clone the repository from the Stash remote host (via ssh://)
          4) configured the ssh key & credentials in the Jenkins job git-plugin settings

          now when I run the build, Jenkins sucessfully clones the top-level git repository, but fails when trying to update the submodules (the error looks like Jenkins is trying to read username & password from a CLI, but only for the submodules)


          {code:java}
          Gestartet durch Benutzer anonymous
          Baue in Arbeitsbereich C:\Program Files (x86)\Jenkins\jobs\test node\workspace
          No JDK named 'null' found
          No JDK named 'null' found
           > git.exe rev-parse --is-inside-work-tree # timeout=10
          Fetching changes from the remote Git repository
           > git.exe config remote.origin.url ssh://git@logicxklubuild:7999/ipp/ipp-project.git # timeout=10
          Fetching upstream changes from ssh://git@logicxklubuild:7999/ipp/ipp-project.git
           > git.exe --version # timeout=10
          using GIT_SSH to set credentials
           > git.exe -c core.askpass=true fetch --tags --progress ssh://git@logicxklubuild:7999/ipp/ipp-project.git +refs/heads/*:refs/remotes/origin/*
           > git.exe rev-parse "refs/remotes/origin/master^{commit}" # timeout=10
           > git.exe rev-parse "refs/remotes/origin/origin/master^{commit}" # timeout=10
          Checking out Revision a27c48024088c36e6eff3420c699ea1d1977e5cd (refs/remotes/origin/master)
          No JDK named 'null' found
           > git.exe config core.sparsecheckout # timeout=10
           > git.exe checkout -f a27c48024088c36e6eff3420c699ea1d1977e5cd
           > git.exe rev-list a27c48024088c36e6eff3420c699ea1d1977e5cd # timeout=10
           > git.exe remote # timeout=10
           > git.exe submodule init # timeout=10
           > git.exe submodule sync # timeout=10
           > git.exe config --get remote.origin.url # timeout=10
           > git.exe submodule update
          FATAL: Command "git.exe submodule update" returned status code 1:
          stdout:
          stderr: Cloning into 'apps/ipp-app'...
          error: cannot spawn echo : No such file or directory
          bash: /dev/tty: No such device or address
          error: failed to execute prompt script (exit code 1)
          fatal: could not read Username for 'http://logicxklubuild:7990': No error
          Clone of 'http://logicxklubuild:7990/scm/ipp/ipp-app.git' into submodule path 'apps/ipp-app' failed

          hudson.plugins.git.GitException: Command "git.exe submodule update" returned status code 1:
          stdout:
          stderr: Cloning into 'apps/ipp-app'...
          error: cannot spawn echo : No such file or directory
          bash: /dev/tty: No such device or address
          error: failed to execute prompt script (exit code 1)
          fatal: could not read Username for 'http://logicxklubuild:7990': No error
          Clone of 'http://logicxklubuild:7990/scm/ipp/ipp-app.git' into submodule path 'apps/ipp-app' failed

          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1640)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:62)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$6.execute(CliGitAPIImpl.java:904)
          at hudson.plugins.git.extensions.impl.SubmoduleOption.onCheckoutCompleted(SubmoduleOption.java:83)
          at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1074)
          at hudson.scm.SCM.checkout(SCM.java:485)
          at hudson.model.AbstractProject.checkout(AbstractProject.java:1275)
          at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:610)
          at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
          at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:532)
          at hudson.model.Run.execute(Run.java:1741)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          at hudson.model.ResourceController.execute(ResourceController.java:98)
          at hudson.model.Executor.run(Executor.java:410)
          Finished: FAILURE
          {code}
          I'm trying to clone a git repository that is hosted on a Atlassian Stash instance.
          The special case about the repository is that it has several submodules in it.

          Here is what I did to get to the error:
          1) I installed the latest git-plugin (2.4.0) / git-client-plugin (1.19.0) in Jenkins
          2) setup a ssh rsa key in Stash
          3) configured a Jenkins job to clone the repository from the Stash remote host (via ssh://)
          4) configured the ssh key & credentials in the Jenkins job git-plugin settings

          now when I run the build, Jenkins sucessfully clones the top-level git repository, but fails when trying to update the submodules (the error looks like Jenkins is trying to read username & password from a CLI, but only for the submodules)


          {code:java}
          Gestartet durch Benutzer anonymous
          Baue in Arbeitsbereich C:\Program Files (x86)\Jenkins\jobs\test node\workspace
          No JDK named 'null' found
          No JDK named 'null' found
           > git.exe rev-parse --is-inside-work-tree # timeout=10
          Fetching changes from the remote Git repository
           > git.exe config remote.origin.url ssh://git@jenkinshost:7999/ipp/ipp-project.git # timeout=10
          Fetching upstream changes from ssh://git@jenkinshost:7999/ipp/ipp-project.git
           > git.exe --version # timeout=10
          using GIT_SSH to set credentials
           > git.exe -c core.askpass=true fetch --tags --progress ssh://git@jenkinshost:7999/ipp/ipp-project.git +refs/heads/*:refs/remotes/origin/*
           > git.exe rev-parse "refs/remotes/origin/master^{commit}" # timeout=10
           > git.exe rev-parse "refs/remotes/origin/origin/master^{commit}" # timeout=10
          Checking out Revision a27c48024088c36e6eff3420c699ea1d1977e5cd (refs/remotes/origin/master)
          No JDK named 'null' found
           > git.exe config core.sparsecheckout # timeout=10
           > git.exe checkout -f a27c48024088c36e6eff3420c699ea1d1977e5cd
           > git.exe rev-list a27c48024088c36e6eff3420c699ea1d1977e5cd # timeout=10
           > git.exe remote # timeout=10
           > git.exe submodule init # timeout=10
           > git.exe submodule sync # timeout=10
           > git.exe config --get remote.origin.url # timeout=10
           > git.exe submodule update
          FATAL: Command "git.exe submodule update" returned status code 1:
          stdout:
          stderr: Cloning into 'apps/ipp-app'...
          error: cannot spawn echo : No such file or directory
          bash: /dev/tty: No such device or address
          error: failed to execute prompt script (exit code 1)
          fatal: could not read Username for 'http://jenkinshost:7990': No error
          Clone of 'http://jenkinshost:7990/scm/ipp/ipp-app.git' into submodule path 'apps/ipp-app' failed

          hudson.plugins.git.GitException: Command "git.exe submodule update" returned status code 1:
          stdout:
          stderr: Cloning into 'apps/ipp-app'...
          error: cannot spawn echo : No such file or directory
          bash: /dev/tty: No such device or address
          error: failed to execute prompt script (exit code 1)
          fatal: could not read Username for 'http://jenkinshost:7990': No error
          Clone of 'http://jenkinshost:7990/scm/ipp/ipp-app.git' into submodule path 'apps/ipp-app' failed

          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1640)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:62)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$6.execute(CliGitAPIImpl.java:904)
          at hudson.plugins.git.extensions.impl.SubmoduleOption.onCheckoutCompleted(SubmoduleOption.java:83)
          at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1074)
          at hudson.scm.SCM.checkout(SCM.java:485)
          at hudson.model.AbstractProject.checkout(AbstractProject.java:1275)
          at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:610)
          at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
          at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:532)
          at hudson.model.Run.execute(Run.java:1741)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          at hudson.model.ResourceController.execute(ResourceController.java:98)
          at hudson.model.Executor.run(Executor.java:410)
          Finished: FAILURE
          {code}
          Hide
          drywolf Wolfgang Steiner added a comment -

          Right after I created the issue I found out what the problem actually was and it is not related to Jenkins.

          I had used absolute paths using the http:// protocol in the top-level repository's .gitmodules file.
          This of course caused trouble when Jenkins tried to clone the submodules, since it had to authenticate with something other than the ssh key that I provided.
          (a good explaination how to fix this in the .gitmodules file can be found at this website ... http://blog.tremily.us/posts/Relative_submodules/)

          What still could be discussed in this is issue is the error reporting by Jenkins / the GIT plugins in such a case. I guess it would be possible to put an additional warning or error message in the build log if a GIT repository uses submodules inside a repository that have the same host URL but use different protocols (http, https, ssh).

          A warning that such a scenario could be a potential missconfiguration in .gitmodules would make it more obvious that the error might be not coming from Jenkins or GIT themselves.

          Show
          drywolf Wolfgang Steiner added a comment - Right after I created the issue I found out what the problem actually was and it is not related to Jenkins. I had used absolute paths using the http:// protocol in the top-level repository's .gitmodules file. This of course caused trouble when Jenkins tried to clone the submodules, since it had to authenticate with something other than the ssh key that I provided. (a good explaination how to fix this in the .gitmodules file can be found at this website ... http://blog.tremily.us/posts/Relative_submodules/ ) What still could be discussed in this is issue is the error reporting by Jenkins / the GIT plugins in such a case. I guess it would be possible to put an additional warning or error message in the build log if a GIT repository uses submodules inside a repository that have the same host URL but use different protocols (http, https, ssh). A warning that such a scenario could be a potential missconfiguration in .gitmodules would make it more obvious that the error might be not coming from Jenkins or GIT themselves.
          markewaite Mark Waite made changes -
          Component/s credentials-plugin [ 16523 ]
          Component/s git-client-plugin [ 17423 ]
          markewaite Mark Waite made changes -
          Assignee stephenconnolly [ stephenconnolly ]
          markewaite Mark Waite made changes -
          Summary GIT plugin does use provided ssh key credentials for top-level repository, but not for submodules Misconfiguration of submodules not well diagnosed by git plugin
          markewaite Mark Waite made changes -
          Summary Misconfiguration of submodules not well diagnosed by git plugin Misconfiguration of submodules not clearly reported by git plugin
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 166494 ] JNJira + In-Review [ 182396 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              drywolf Wolfgang Steiner
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: