using GIT plugin: cannot clone submodule

2,316 views
Skip to first unread message

Emil Petkov

unread,
Sep 18, 2012, 11:50:01 AM9/18/12
to jenkins...@googlegroups.com
Hello,

I have set up Jenkins and installed the GIT plugin (https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin).

1. First, I created a depot of my repository by executing:

git clone --bare /home/git_repos/admin_pci.git /home/jenkins_bare_repos/admin_pci.git

2. Added the clone as the remote origin for the original so I can push to the clone:

cd /home/git_repos/admin_pci.git

git remote add origin /home/jenkins_bare_repos/admin_pci.git

3. Then created a job in Jenkins: selected GIT for "Source Code Management", Repository URL = /home/jenkins_bare_repos/admin_pci.git, "Branches to Build" = 'master', etc

4. Ran the job and got the following error:

Started by user anonymous
Building in workspace /var/lib/jenkins/jobs/admin_pci specs/workspace
Checkout:workspace / /var/lib/jenkins/jobs/admin_pci specs/workspace - hudson.remoting.LocalChannel@4eeaabad
Using strategy: Default
Last Built Revision: Revision 0654d4080e49815ce1869bea3260ecfa2334f5fd (origin/app_testing)
Fetching changes from 1 remote Git repository
Fetching upstream changes from /home/jenkins_bare_repos/admin_pci.git
Commencing build of Revision fee7f8c3386e79bd27459fb76b0085d679ec5012 (origin/master)
Checking out Revision fee7f8c3386e79bd27459fb76b0085d679ec5012 (origin/master)
FATAL: Command "git submodule update" returned status code 1:
stdout: Cloning into vendor/plugins/secure_gate...

stderr: Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,password).
fatal: The remote end hung up unexpectedly
Clone of 'ssh://git_de...@10.100.25.14/home/git_repo/gw_plugin.git' into submodule path 'vendor/plugins/secure_gate' failed

hudson.plugins.git.GitException: Command "git submodule update" returned status code 1:
stdout: Cloning into vendor/plugins/secure_gate...

stderr: Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,password).
fatal: The remote end hung up unexpectedly
Clone of 'ssh://git_de...@10.100.25.14/home/git_repo/gw_plugin.git' into submodule path 'vendor/plugins/secure_gate' failed

	at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:855)
	at hudson.plugins.git.GitAPI.launchCommand(GitAPI.java:817)
	at hudson.plugins.git.GitAPI.submoduleUpdate(GitAPI.java:446)
	at hudson.plugins.git.GitSCM$4.invoke(GitSCM.java:1308)
	at hudson.plugins.git.GitSCM$4.invoke(GitSCM.java:1269)
	at hudson.FilePath.act(FilePath.java:842)
	at hudson.FilePath.act(FilePath.java:824)
	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1269)
	at hudson.model.AbstractProject.checkout(AbstractProject.java:1256)
	at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:589)
	at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:494)
	at hudson.model.Run.execute(Run.java:1502)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
	at hudson.model.ResourceController.execute(ResourceController.java:88)
	at hudson.model.Executor.run(Executor.java:236)

It seems that the submodule of the project cannot be cloned correctly. Is this a well known issue with GIT submodules? Any ideas how to resolve it?

Thanks in advance.


nicolas de loof

unread,
Sep 18, 2012, 4:09:32 PM9/18/12
to jenkins...@googlegroups.com
submodule indeed are only redirections to external repo and - as such - still point to the canonical git repository, even you created a local clone. I don't know any workaround but get access to the target repo.

2012/9/18 Emil Petkov <emil.s...@gmail.com>

Emil Petkov

unread,
Sep 19, 2012, 3:58:34 AM9/19/12
to jenkins...@googlegroups.com
I do have access to the target repo where the GIT submodule is. It's just that it asks for a password since it is shared repo accessible to developers via SSH. Seems the GIT plugin breaks on trying to clone the gitsubmodule since it has no way of knowing the SSH password, basically the GIT plugin hangs.

Any ideas whether this is supported as part of the GIT plugin somehow?

Thanks

Andrew Melo

unread,
Sep 19, 2012, 4:01:29 AM9/19/12
to jenkins...@googlegroups.com
On Wed, Sep 19, 2012 at 2:58 AM, Emil Petkov <emil.s...@gmail.com> wrote:
I do have access to the target repo where the GIT submodule is. It's just that it asks for a password since it is shared repo accessible to developers via SSH. Seems the GIT plugin breaks on trying to clone the gitsubmodule since it has no way of knowing the SSH password, basically the GIT plugin hangs.

Any ideas whether this is supported as part of the GIT plugin somehow?

I would use passwordless SSH keys to access the submodule, in that case.



--
--
Andrew Melo

nicolas de loof

unread,
Sep 19, 2012, 5:12:01 AM9/19/12
to jenkins...@googlegroups.com
Indeed,

I've plan to integrate git-plugin with ssh-credentials plugin so it gets more flexible, but have no better workaround for short term

2012/9/19 Andrew Melo <andre...@gmail.com>

Emil Petkov

unread,
Sep 19, 2012, 12:35:40 PM9/19/12
to jenkins...@googlegroups.com
Is it a good idea then to not use the GIT plugin and instead clone the project and update the submodule in a Jenkins build step directly?

Thanks

Emil Petkov

unread,
Sep 28, 2012, 2:15:16 PM9/28/12
to jenkins...@googlegroups.com
THis is exactly what I did to circumvent the problem, I will work without the GIT plugin until the SSH credentials are better integrated.
Reply all
Reply to author
Forward
0 new messages