[JIRA] (JENKINS-59183) Git clone submodule with token fails

9 views
Skip to first unread message

julien.staub@schneider-electric.com (JIRA)

unread,
Sep 2, 2019, 7:38:02 AM9/2/19
to jenkinsc...@googlegroups.com
julien staub created an issue
 
Jenkins / Bug JENKINS-59183
Git clone submodule with token fails
Issue Type: Bug Bug
Assignee: Mark Waite
Components: git-client-plugin, git-plugin
Created: 2019-09-02 11:36
Environment: git plugin 3.12.0
git client plugin 2.8.2
Jenkins 2.192
github branch source 2.5.6
Priority: Major Major
Reporter: julien staub

I use a token for github branch source plugin scanning repositories of an organization.

One of the repos has submodules and the submodules are in the same organization. However, it seems the submodules cannot be cloned using the token. The head repository is cloned correctly.

hudson.plugins.git.GitException: Command "C:\Program Files\git\cmd\git.exe submodule update --init --recursive Common" returned status code 1:
stdout:
stderr: Cloning into 'C:/Program Files (x86)/Jenkins/workspace/XXXXX/Common'...
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'g...@github.ENTREPRISE.com:ORGANIZATION/Cortex_FW_common.git' into submodule path 'C:/Program Files (x86)/Jenkins/workspace/XXXXX/Common' failed
Failed to clone 'Common'. Retry scheduled

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

julien.staub@schneider-electric.com (JIRA)

unread,
Sep 2, 2019, 7:39:02 AM9/2/19
to jenkinsc...@googlegroups.com
julien staub updated an issue
Change By: julien staub
I use a token for github branch source plugin scanning repositories of an organization.

One of the repos has submodules and the submodules are in the same organization. However, it seems the submodules cannot be cloned using the token. The head repository is cloned correctly.

 
{code:java}
hudson.plugins.git.GitException: Command "C:\Program Files\git\cmd\git.exe submodule update --init --recursive Common" returned status code 1:
stdout:
stderr: Cloning into 'C:/Program Files (x86)/Jenkins/workspace/XXXXX/Common'...
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'g...@github.ENTREPRISE.com:ORGANIZATION/Cortex_FW_common.git' into submodule path 'C:/Program Files (x86)/Jenkins/workspace/XXXXX/Common' failed
Failed to clone 'Common'. Retry scheduled

{code}
 

mark.earl.waite@gmail.com (JIRA)

unread,
Sep 2, 2019, 8:01:02 AM9/2/19
to jenkinsc...@googlegroups.com
Mark Waite commented on Bug JENKINS-59183
 
Re: Git clone submodule with token fails

Submodule authentication requires that the parent repository access and the submodule must use the same protocol. Command line git authentication for HTTP and HTTPS supports username / password credentials. Command line git authentication for ssh supports private key credentials.

In this example, the token is a username / password credential. It can be used to clone the repository with HTTP and HTTPS but cannot be used to clone the repository with ssh. The clone error message indicates that the repository is being cloned with ssh. A private key credential is needed to clone that submodule.

mark.earl.waite@gmail.com (JIRA)

unread,
Sep 2, 2019, 8:01:02 AM9/2/19
to jenkinsc...@googlegroups.com
Mark Waite assigned an issue to Unassigned
 
Change By: Mark Waite
Assignee: Mark Waite

julien.staub@schneider-electric.com (JIRA)

unread,
Sep 2, 2019, 10:03:02 AM9/2/19
to jenkinsc...@googlegroups.com
julien staub closed an issue as Not A Defect
 

There waas a deadlock as github branch source plugin need token for scanning and checkout needs to be SSH. Solved with "checkout over SSH" option and separating scan and chechout/build credentials

Change By: julien staub
Status: Open Closed
Resolution: Not A Defect
Reply all
Reply to author
Forward
0 new messages