jenkinsci / jenkinsci/git-client-plugin

[JENKINS-54097] git config --get submodule fails with GIT_SSH credentials

Open
#1,586 5 comments 0 reactions 0 assignees View on GitHub
component:git-client-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
152
Forks
402
Avg merge
6h 47m
Merged PRs (30d)
4

Description

When trying to checkout a Git project with several submodules, I get an error on one of them.

 

All public available GIT submodules are checked out correctly. However one GIT submodule is proprietary and needs the use of GIT_SSH to set the credentials. It has been configured to "Use credentials from default remote of parent repository" in advanced sub-modules behaviour.

 

he error log:

 

Cloning the remote Git repository

Cloning repository ssh://git@​bitbucket.televic.com:7999/tra_mec/33.96.8002.git

> git init /media/Data/workspace/33.96.8002/sources # timeout=10

Fetching upstream changes from ssh://git@​bitbucket.televic.com:7999/tra_mec/33.96.8002.git

> git --version # timeout=10

using GIT_SSH to set credentials

> git fetch --tags --progress ssh://git@​bitbucket.televic.com:7999/tra_mec/33.96.8002.git +refs/heads/:refs/remotes/sources/

> git config remote.sources.url ssh://git@​bitbucket.televic.com:7999/tra_mec/33.96.8002.git # timeout=10

> git config --add remote.sources.fetch +refs/heads/:refs/remotes/sources/ # timeout=10

> git config remote.sources.url ssh://git@​bitbucket.televic.com:7999/tra_mec/33.96.8002.git # timeout=10

Fetching upstream changes from ssh://git@​bitbucket.televic.com:7999/tra_mec/33.96.8002.git

using GIT_SSH to set credentials

> git fetch --tags --progress ssh://git@​bitbucket.televic.com:7999/tra_mec/33.96.8002.git +refs/heads/:refs/remotes/sources/

> git rev-parse refs/remotes/sources/feature/gitsubmodules^{commit} # timeout=10

> git rev-parse refs/remotes/sources/sources/feature/gitsubmodules^{commit} # timeout=10

Checking out Revision 4511e708dedab56c7b23324e0e21afb3666fbaec (refs/remotes/sources/feature/gitsubmodules)

> git config core.sparsecheckout # timeout=10

> git checkout -f 4511e708dedab56c7b23324e0e21afb3666fbaec

Commit message: "added git submodule info to inject in /etc/jenkins.build file"

> git rev-list --no-walk 4511e708dedab56c7b23324e0e21afb3666fbaec # timeout=10

> git remote # timeout=10

> git submodule init # timeout=10

> git submodule sync # timeout=10

> git config --get remote.sources.url # timeout=10

> git submodule init # timeout=10

> git config -f .gitmodules --get-regexp ^submodule\.(.+)\.url # timeout=10

> git config --get submodule.poky.url # timeout=10

> git remote # timeout=10

> git config --get remote.sources.url # timeout=10

> git config -f .gitmodules --get submodule.poky.path # timeout=10

using GIT_SSH to set credentials

> git submodule update --init --recursive poky

> git config --get submodule.meta-openembedded.url # timeout=10

> git remote # timeout=10

> git config --get remote.sources.url # timeout=10

> git config -f .gitmodules --get submodule.meta-openembedded.path # timeout=10

using GIT_SSH to set credentials

> git submodule update --init --recursive meta-openembedded

> git config --get submodule.meta-virtualization.url # timeout=10

> git remote # timeout=10

> git config --get remote.sources.url # timeout=10

> git config -f .gitmodules --get submodule.meta-virtualization.path # timeout=10

using GIT_SSH to set credentials

> git submodule update --init --recursive meta-virtualization

> git config --get submodule.meta-xilinx.url # timeout=10

> git remote # timeout=10

> git config --get remote.sources.url # timeout=10

> git config -f .gitmodules --get submodule.meta-xilinx.path # timeout=10

using GIT_SSH to set credentials

> git submodule update --init --recursive meta-xilinx

> git config --get submodule.meta-ti.url # timeout=10

> git remote # timeout=10

> git config --get remote.sources.url # timeout=10

> git config -f .gitmodules --get submodule.meta-ti.path # timeout=10

using GIT_SSH to set credentials

> git submodule update --init --recursive meta-ti

> git config --get submodule.meta-security.url # timeout=10

> git remote # timeout=10

> git config --get remote.sources.url # timeout=10

> git config -f .gitmodules --get submodule.meta-security.path # timeout=10

using GIT_SSH to set credentials

> git submodule update --init --recursive meta-security

> git config --get submodule.33.97.1231.url # timeout=10

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

stdout:

stderr:

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2016)

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1984)

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1980)

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1612)

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1624)

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getSubmoduleUrl(CliGitAPIImpl.java:1224)

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$7.execute(CliGitAPIImpl.java:1150)

at hudson.plugins.git.extensions.impl.SubmoduleOption.onCheckoutCompleted(SubmoduleOption.java:108)

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:1264)

at hudson.scm.SCM.checkout(SCM.java:504)

at hudson.model.AbstractProject.checkout(AbstractProject.java:1208)

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:1794)

at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)

at hudson.model.ResourceController.execute(ResourceController.java:97)

at hudson.model.Executor.run(Executor.java:429)

---
Originally reported by pietercardoen, imported from: git config --get submodule fails with GIT_SSH credentials


  • status: Open
  • priority: Major
  • component(s): git-client-plugin
  • label(s): git
  • resolution: Unresolved
  • votes: 0
  • watchers: 3
  • imported: 20251211-071809

Raw content of original issue

When trying to checkout a Git project with several submodules, I get an error on one of them.

 

All public available GIT submodules are checked out correctly. However one GIT submodule is proprietary and needs the use of GIT_SSH to set the credentials. It has been configured to "Use credentials from default remote of parent repository" in advanced sub-modules behaviour.

 

he error log:

 

Cloning the remote Git repository
Cloning repository ssh://git@bitbucket.televic.com:7999/tra_mec/33.96.8002.git
> git init /media/Data/workspace/33.96.8002/sources # timeout=10
Fetching upstream changes from ssh://git@bitbucket.televic.com:7999/tra_mec/33.96.8002.git
> git --version # timeout=10
using GIT_SSH to set credentials
> git fetch --tags --progress ssh://git@bitbucket.televic.com:7999/tra_mec/33.96.8002.git +refs/heads/:refs/remotes/sources/
> git config remote.sources.url ssh://git@bitbucket.televic.com:7999/tra_mec/33.96.8002.git # timeout=10
> git config --add remote.sources.fetch +refs/heads/:refs/remotes/sources/ # timeout=10
> git config remote.sources.url ssh://git@bitbucket.televic.com:7999/tra_mec/33.96.8002.git # timeout=10
Fetching upstream changes from ssh://git@bitbucket.televic.com:7999/tra_mec/33.96.8002.git
using GIT_SSH to set credentials
> git fetch --tags --progress ssh://git@bitbucket.televic.com:7999/tra_mec/33.96.8002.git +refs/heads/:refs/remotes/sources/
> git rev-parse refs/remotes/sources/feature/gitsubmodules^{commit} # timeout=10
> git rev-parse refs/remotes/sources/sources/feature/gitsubmodules^{commit} # timeout=10
Checking out Revision 4511e708dedab56c7b23324e0e21afb3666fbaec (refs/remotes/sources/feature/gitsubmodules)
> git config core.sparsecheckout # timeout=10
> git checkout -f 4511e708dedab56c7b23324e0e21afb3666fbaec
Commit message: "added git submodule info to inject in /etc/jenkins.build file"
> git rev-list --no-walk 4511e708dedab56c7b23324e0e21afb3666fbaec # timeout=10
> git remote # timeout=10
> git submodule init # timeout=10
> git submodule sync # timeout=10
> git config --get remote.sources.url # timeout=10
> git submodule init # timeout=10
> git config -f .gitmodules --get-regexp ^submodule\.(.+)\.url # timeout=10
> git config --get submodule.poky.url # timeout=10
> git remote # timeout=10
> git config --get remote.sources.url # timeout=10
> git config -f .gitmodules --get submodule.poky.path # timeout=10
using GIT_SSH to set credentials
> git submodule update --init --recursive poky
> git config --get submodule.meta-openembedded.url # timeout=10
> git remote # timeout=10
> git config --get remote.sources.url # timeout=10
> git config -f .gitmodules --get submodule.meta-openembedded.path # timeout=10
using GIT_SSH to set credentials
> git submodule update --init --recursive meta-openembedded
> git config --get submodule.meta-virtualization.url # timeout=10
> git remote # timeout=10
> git config --get remote.sources.url # timeout=10
> git config -f .gitmodules --get submodule.meta-virtualization.path # timeout=10
using GIT_SSH to set credentials
> git submodule update --init --recursive meta-virtualization
> git config --get submodule.meta-xilinx.url # timeout=10
> git remote # timeout=10
> git config --get remote.sources.url # timeout=10
> git config -f .gitmodules --get submodule.meta-xilinx.path # timeout=10
using GIT_SSH to set credentials
> git submodule update --init --recursive meta-xilinx
> git config --get submodule.meta-ti.url # timeout=10
> git remote # timeout=10
> git config --get remote.sources.url # timeout=10
> git config -f .gitmodules --get submodule.meta-ti.path # timeout=10
using GIT_SSH to set credentials
> git submodule update --init --recursive meta-ti
> git config --get submodule.meta-security.url # timeout=10
> git remote # timeout=10
> git config --get remote.sources.url # timeout=10
> git config -f .gitmodules --get submodule.meta-security.path # timeout=10
using GIT_SSH to set credentials
> git submodule update --init --recursive meta-security
> git config --get submodule.33.97.1231.url # timeout=10
hudson.plugins.git.GitException: Command "git config --get submodule.33.97.1231.url" returned status code 1:
stdout:
stderr:
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2016)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1984)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1980)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1612)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1624)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getSubmoduleUrl(CliGitAPIImpl.java:1224)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$7.execute(CliGitAPIImpl.java:1150)
at hudson.plugins.git.extensions.impl.SubmoduleOption.onCheckoutCompleted(SubmoduleOption.java:108)
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:1264)
at hudson.scm.SCM.checkout(SCM.java:504)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1208)
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:1794)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)

environment

```
Jenkins 2.121.1

Git Client Plugin 2.7.3
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.