error trying to clone submodule

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

error trying to clone submodule

Arturo Arenas
hello,

I'm trying to clone a submodule but it's fail. I'm using pipeline script 

                checkout([$class: 'GitSCM',
                          branches
: [[name: 'master']],
                          doGenerateSubmoduleConfigurations
: false,
                          extensions
: [[$class: 'CleanBeforeCheckout'],
                                       
[$class: 'SubmoduleOption',
                                        disableSubmodules
: false,
                                        parentCredentials
: true,
                                        recursiveSubmodules
: true,
                                        reference
: '',
                                        trackingSubmodules
: false]],
                          submoduleCfg
: [],
                          userRemoteConfigs
: [[credentialsId: 'ssh_key_id', url: 'ssh://[hidden email]']]])

And i get the next error:

hudson.plugins.git.GitException: Command "git submodule update --init --recursive mylib" returned status code 1: stdout: stderr: Cloning into '/var/jenkins_home/workspace/myproject/mylib'...
/var/jenkins_home/workspace/myproject/.git/modules/mylib: Permission denied
fatal: clone of 'ssh://git@url/mylib.git' into submodule path '/var/jenkins_home/workspace/myproject/mylib' failed
Failed to clone 'mylib'. Retry scheduled
Cloning into '/var/jenkins_home/workspace/myproject/mylib'...
/var/jenkins_home/workspace/myproject/.git/modules/mylib: Permission denied
fatal: clone of 'ssh://git@url/mylib.git' into submodule path '/var/jenkins_home/workspace/myproject/mylib' failed
Failed to clone 'mylib' a second time, aborting

Also, i tried to test in my computer with " git clone ssh://url --recursive" and work fine the submodule. 

what could be happening?

i appreciate any help! thanks!

best regards!


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/ec25bcb7-1d15-4345-840e-dc61129d8c0do%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

RE: error trying to clone submodule

Jérôme Godbout

This is what I do use and it work for me

 

checkout([$class: 'GitSCM'

                , branches: [[name: 'master']]

                , browser: [$class: 'BitbucketWeb', repoUrl: 'https://bitbucket.org/mynamepath.git']

                , doGenerateSubmoduleConfigurations: false

                , extensions: [[$class: 'CloneOption', noTags: false], [$class: 'LocalBranch', localBranch: "**"], [$class: 'SubmoduleOption', disableSubmodules: false, parentCredentials: true, recursiveSubmodules: true, reference: '', trackingSubmodules: false], [$class: 'CleanCheckout']]

                , submoduleCfg: []

                , userRemoteConfigs: [[credentialsId: 'MyCredsId', url: 'https://bitbucket.org/mynamepath.git']]

            ]);

 

the only difference my eyes can spot is

[$class: 'CleanCheckout']]

 

I also use the https and not ssh, maybe something is wrong into ssh

 

From: [hidden email] <[hidden email]> On Behalf Of Arturo Arenas
Sent: June 11, 2020 3:43 PM
To: Jenkins Users <[hidden email]>
Subject: error trying to clone submodule

 

hello,

 

I'm trying to clone a submodule but it's fail. I'm using pipeline script 

 

                checkout([$class: 'GitSCM',
                          branches
: [[name: 'master']],
                          doGenerateSubmoduleConfigurations
: false,
                          extensions
: [[$class: 'CleanBeforeCheckout'],
                                       
[$class: 'SubmoduleOption',
                                        disableSubmodules
: false,
                                        parentCredentials
: true,
                                        recursiveSubmodules
: true,
                                        reference
: '',
                                        trackingSubmodules
: false]],
                          submoduleCfg
: [],
                          userRemoteConfigs
: [[credentialsId: 'ssh_key_id', url: 'ssh://[hidden email]']]])

 

And i get the next error:

 

hudson.plugins.git.GitException: Command "git submodule update --init --recursive mylib" returned status code 1: stdout: stderr: Cloning into '/var/jenkins_home/workspace/myproject/mylib'...
/var/jenkins_home/workspace/myproject/.git/modules/mylib: Permission denied
fatal: clone of 'ssh://git@url/mylib.git' into submodule path '/var/jenkins_home/workspace/myproject/mylib' failed
Failed to clone 'mylib'. Retry scheduled
Cloning into '/var/jenkins_home/workspace/myproject/mylib'...
/var/jenkins_home/workspace/myproject/.git/modules/mylib: Permission denied
fatal: clone of 'ssh://git@url/mylib.git' into submodule path '/var/jenkins_home/workspace/myproject/mylib' failed
Failed to clone 'mylib' a second time, aborting
 
Also, i tried to test in my computer with " git clone ssh://url --recursive" and work fine the submodule. 
 
what could be happening?
 
i appreciate any help! thanks!
 
best regards!

 

 

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/ec25bcb7-1d15-4345-840e-dc61129d8c0do%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/YQBPR0101MB1074B4A2808CE20CFE02632FCD800%40YQBPR0101MB1074.CANPRD01.PROD.OUTLOOK.COM.
Reply | Threaded
Open this post in threaded view
|

Re: error trying to clone submodule

Arturo Arenas
I tried like you told me but this failed again with the error:

hudson.plugins.git.GitException: Command "git submodule sync" returned status code 128:
stdout: Synchronizing submodule url for 'mylib'

stderr: error: could not lock config file /var/jenkins_home/workspace/myproject/.git/modules/mylib/config: Permission denied
 

El jueves, 11 de junio de 2020, 16:55:01 (UTC-4), Jérôme Godbout escribió:

This is what I do use and it work for me

 

checkout([$class: 'GitSCM'

                , branches: [[name: 'master']]

                , browser: [$class: 'BitbucketWeb', repoUrl: '<a href="https://bitbucket.org/mynamepath.git" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fbitbucket.org%2Fmynamepath.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGqXnNl_MVi5VdSDGpHpaF5zPgh8w&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fbitbucket.org%2Fmynamepath.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGqXnNl_MVi5VdSDGpHpaF5zPgh8w&#39;;return true;">https://bitbucket.org/mynamepath.git']

                , doGenerateSubmoduleConfigurations: false

                , extensions: [[$class: 'CloneOption', noTags: false], [$class: 'LocalBranch', localBranch: "**"], [$class: 'SubmoduleOption', disableSubmodules: false, parentCredentials: true, recursiveSubmodules: true, reference: '', trackingSubmodules: false], [$class: 'CleanCheckout']]

                , submoduleCfg: []

                , userRemoteConfigs: [[credentialsId: 'MyCredsId', url: '<a href="https://bitbucket.org/mynamepath.git&#39;" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fbitbucket.org%2Fmynamepath.git\x27\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFR-Du8OcLcT43j1C1xH6vA60gA7w&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fbitbucket.org%2Fmynamepath.git\x27\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFR-Du8OcLcT43j1C1xH6vA60gA7w&#39;;return true;">https://bitbucket.org/mynamepath.git']]

            ]);

 

the only difference my eyes can spot is

[$class: 'CleanCheckout']]

 

I also use the https and not ssh, maybe something is wrong into ssh

 

From: <a href="javascript:" target="_blank" gdf-obfuscated-mailto="xGpVb-EEAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jenkins...@googlegroups.com <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="xGpVb-EEAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jenkins...@googlegroups.com> On Behalf Of Arturo Arenas
Sent: June 11, 2020 3:43 PM
To: Jenkins Users <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="xGpVb-EEAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jenkins...@googlegroups.com>
Subject: error trying to clone submodule

 

hello,

 

I'm trying to clone a submodule but it's fail. I'm using pipeline script 

 

                checkout([$class: 'GitSCM',
                          branches
: [[name: 'master']],
                          doGenerateSubmoduleConfigurations
: false,
                          extensions
: [[$class: 'CleanBeforeCheckout'],
                                       
[$class: 'SubmoduleOption',
                                        disableSubmodules
: false,
                                        parentCredentials
: true,
                                        recursiveSubmodules
: true,
                                        reference
: '',
                                        trackingSubmodules
: false]],
                          submoduleCfg
: [],
                          userRemoteConfigs
: [[credentialsId: 'ssh_key_id', url: 'ssh://[hidden email]']]])

 

And i get the next error:

 

hudson.plugins.git.GitException: Command "git submodule update --init --recursive mylib" returned status code 1: stdout: stderr: Cloning into '/var/jenkins_home/workspace/myproject/mylib'...
/var/jenkins_home/workspace/myproject/.git/modules/mylib: Permission denied
fatal: clone of 'ssh://git@url/mylib.git' into submodule path '/var/jenkins_home/workspace/myproject/mylib' failed
Failed to clone 'mylib'. Retry scheduled
Cloning into '/var/jenkins_home/workspace/myproject/mylib'...
/var/jenkins_home/workspace/myproject/.git/modules/mylib: Permission denied
fatal: clone of 'ssh://git@url/mylib.git' into submodule path '/var/jenkins_home/workspace/myproject/mylib' failed
Failed to clone 'mylib' a second time, aborting
 
Also, i tried to test in my computer with " git clone ssh://url --recursive" and work fine the submodule. 
 
what could be happening?
 
i appreciate any help! thanks!
 
best regards!

 

 

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="xGpVb-EEAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jenkins...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-users/ec25bcb7-1d15-4345-840e-dc61129d8c0do%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/ec25bcb7-1d15-4345-840e-dc61129d8c0do%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/ec25bcb7-1d15-4345-840e-dc61129d8c0do%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;"> https://groups.google.com/d/msgid/jenkinsci-users/ec25bcb7-1d15-4345-840e-dc61129d8c0do%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/06ae9f11-7741-41f7-91df-771575b644fao%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

RE: error trying to clone submodule

Jérôme Godbout

Have you try to clean the workspace and rerun the project, seem like a local permission is wrong into your .git folder.

check the permission on the file:

/var/jenkins_home/workspace/myproject/.git/modules/mylib/config

 

check if the Jenkins user should normally have r/w access to it?

 

From: [hidden email] <[hidden email]> On Behalf Of Arturo Arenas
Sent: June 11, 2020 5:09 PM
To: Jenkins Users <[hidden email]>
Subject: Re: error trying to clone submodule

 

I tried like you told me but this failed again with the error:

hudson.plugins.git.GitException: Command "git submodule sync" returned status code 128:

stdout: Synchronizing submodule url for 'mylib'

 

stderr: error: could not lock config file /var/jenkins_home/workspace/myproject/.git/modules/mylib/config: Permission denied

 


El jueves, 11 de junio de 2020, 16:55:01 (UTC-4), Jérôme Godbout escribió:

This is what I do use and it work for me

 

checkout([$class: 'GitSCM'

                , branches: [[name: 'master']]

                , browser: [$class: 'BitbucketWeb', repoUrl: 'https://bitbucket.org/mynamepath.git']

                , doGenerateSubmoduleConfigurations: false

                , extensions: [[$class: 'CloneOption', noTags: false], [$class: 'LocalBranch', localBranch: "**"], [$class: 'SubmoduleOption', disableSubmodules: false, parentCredentials: true, recursiveSubmodules: true, reference: '', trackingSubmodules: false], [$class: 'CleanCheckout']]

                , submoduleCfg: []

                , userRemoteConfigs: [[credentialsId: 'MyCredsId', url: 'https://bitbucket.org/mynamepath.git']]

            ]);

 

the only difference my eyes can spot is

[$class: 'CleanCheckout']]

 

I also use the https and not ssh, maybe something is wrong into ssh

 

From: <a href="javascript:" target="_blank">jenkins...@... <<a href="javascript:" target="_blank">jenkins...@...> On Behalf Of Arturo Arenas
Sent: June 11, 2020 3:43 PM
To: Jenkins Users <<a href="javascript:" target="_blank">jenkins...@...>
Subject: error trying to clone submodule

 

hello,

 

I'm trying to clone a submodule but it's fail. I'm using pipeline script 

 

                checkout([$class: 'GitSCM',
                          branches
: [[name: 'master']],
                          doGenerateSubmoduleConfigurations
: false,
                          extensions
: [[$class: 'CleanBeforeCheckout'],
                                       
[$class: 'SubmoduleOption',
                                        disableSubmodules
: false,
                                        parentCredentials
: true,
                                        recursiveSubmodules
: true,
                                        reference
: '',
                                        trackingSubmodules
: false]],
                          submoduleCfg
: [],
                          userRemoteConfigs
: [[credentialsId: 'ssh_key_id', url: 'ssh://[hidden email]']]])

 

And i get the next error:

 

hudson.plugins.git.GitException: Command "git submodule update --init --recursive mylib" returned status code 1: stdout: stderr: Cloning into '/var/jenkins_home/workspace/myproject/mylib'...
/var/jenkins_home/workspace/myproject/.git/modules/mylib: Permission denied
fatal: clone of 'ssh://git@url/mylib.git' into submodule path '/var/jenkins_home/workspace/myproject/mylib' failed
Failed to clone 'mylib'. Retry scheduled
Cloning into '/var/jenkins_home/workspace/myproject/mylib'...
/var/jenkins_home/workspace/myproject/.git/modules/mylib: Permission denied
fatal: clone of 'ssh://git@url/mylib.git' into submodule path '/var/jenkins_home/workspace/myproject/mylib' failed
Failed to clone 'mylib' a second time, aborting
 
Also, i tried to test in my computer with " git clone ssh://url --recursive" and work fine the submodule. 
 
what could be happening?
 
i appreciate any help! thanks!
 
best regards!

 

 

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank">jenkins...@....
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/ec25bcb7-1d15-4345-840e-dc61129d8c0do%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/06ae9f11-7741-41f7-91df-771575b644fao%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/YQBPR0101MB10745ECF6DEE70EDBEE4E7BBCD810%40YQBPR0101MB1074.CANPRD01.PROD.OUTLOOK.COM.
Reply | Threaded
Open this post in threaded view
|

Re: error trying to clone submodule

Arturo Arenas
I resolved that with the below script pipeline:


            steps {
                git credentialsId
: 'ssh_key_id', url: 'ssh://git@url.git', branch: 'master'


                withEnv
(['GIT_SSH_COMMAND=ssh -o StrictHostKeyChecking=no']) {
                    sshagent
(credentials: ['ssh_key_id'])  {
                        sh
"git rm -rf mylibs/"
                        sh
"git clone ssh://git@url/mylibs.git"
                        sh
"git submodule sync"
                        sh
"git submodule init"
                        sh
"git submodule update"
                   
}
               
}
           
}



Thanks a lot for your support, i really appreciate that!!

Best Regards!


El jueves, 11 de junio de 2020, 22:22:30 (UTC-4), Jérôme Godbout escribió:

Have you try to clean the workspace and rerun the project, seem like a local permission is wrong into your .git folder.

check the permission on the file:

/var/jenkins_home/workspace/myproject/.git/modules/mylib/config

 

check if the Jenkins user should normally have r/w access to it?

 

From: <a href="javascript:" target="_blank" gdf-obfuscated-mailto="4zXuHcAWAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jenkins...@googlegroups.com <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="4zXuHcAWAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jenkins...@googlegroups.com> On Behalf Of Arturo Arenas
Sent: June 11, 2020 5:09 PM
To: Jenkins Users <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="4zXuHcAWAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jenkins...@googlegroups.com>
Subject: Re: error trying to clone submodule

 

I tried like you told me but this failed again with the error:

hudson.plugins.git.GitException: Command "git submodule sync" returned status code 128:

stdout: Synchronizing submodule url for 'mylib'

 

stderr: error: could not lock config file /var/jenkins_home/workspace/myproject/.git/modules/mylib/config: Permission denied

 


El jueves, 11 de junio de 2020, 16:55:01 (UTC-4), Jérôme Godbout escribió:

This is what I do use and it work for me

 

checkout([$class: 'GitSCM'

                , branches: [[name: 'master']]

                , browser: [$class: 'BitbucketWeb', repoUrl: '<a href="https://bitbucket.org/mynamepath.git" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fbitbucket.org%2Fmynamepath.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGqXnNl_MVi5VdSDGpHpaF5zPgh8w&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fbitbucket.org%2Fmynamepath.git\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGqXnNl_MVi5VdSDGpHpaF5zPgh8w&#39;;return true;">https://bitbucket.org/mynamepath.git']

                , doGenerateSubmoduleConfigurations: false

                , extensions: [[$class: 'CloneOption', noTags: false], [$class: 'LocalBranch', localBranch: "**"], [$class: 'SubmoduleOption', disableSubmodules: false, parentCredentials: true, recursiveSubmodules: true, reference: '', trackingSubmodules: false], [$class: 'CleanCheckout']]

                , submoduleCfg: []

                , userRemoteConfigs: [[credentialsId: 'MyCredsId', url: '<a href="https://bitbucket.org/mynamepath.git&#39;" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fbitbucket.org%2Fmynamepath.git\x27\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFR-Du8OcLcT43j1C1xH6vA60gA7w&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fbitbucket.org%2Fmynamepath.git\x27\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFR-Du8OcLcT43j1C1xH6vA60gA7w&#39;;return true;">https://bitbucket.org/mynamepath.git']]

            ]);

 

the only difference my eyes can spot is

[$class: 'CleanCheckout']]

 

I also use the https and not ssh, maybe something is wrong into ssh

 

From: [hidden email] <[hidden email]> On Behalf Of Arturo Arenas
Sent: June 11, 2020 3:43 PM
To: Jenkins Users <[hidden email]>
Subject: error trying to clone submodule

 

hello,

 

I'm trying to clone a submodule but it's fail. I'm using pipeline script 

 

                checkout([$class: 'GitSCM',
                          branches
: [[name: 'master']],
                          doGenerateSubmoduleConfigurations
: false,
                          extensions
: [[$class: 'CleanBeforeCheckout'],
                                       
[$class: 'SubmoduleOption',
                                        disableSubmodules
: false,
                                        parentCredentials
: true,
                                        recursiveSubmodules
: true,
                                        reference
: '',
                                        trackingSubmodules
: false]],
                          submoduleCfg
: [],
                          userRemoteConfigs
: [[credentialsId: 'ssh_key_id', url: 'ssh://[hidden email]']]])

 

And i get the next error:

 

hudson.plugins.git.GitException: Command "git submodule update --init --recursive mylib" returned status code 1: stdout: stderr: Cloning into '/var/jenkins_home/workspace/myproject/mylib'...
/var/jenkins_home/workspace/myproject/.git/modules/mylib: Permission denied
fatal: clone of 'ssh://git@url/mylib.git' into submodule path '/var/jenkins_home/workspace/myproject/mylib' failed
Failed to clone 'mylib'. Retry scheduled
Cloning into '/var/jenkins_home/workspace/myproject/mylib'...
/var/jenkins_home/workspace/myproject/.git/modules/mylib: Permission denied
fatal: clone of 'ssh://git@url/mylib.git' into submodule path '/var/jenkins_home/workspace/myproject/mylib' failed
Failed to clone 'mylib' a second time, aborting
 
Also, i tried to test in my computer with " git clone ssh://url --recursive" and work fine the submodule. 
 
what could be happening?
 
i appreciate any help! thanks!
 
best regards!

 

 

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-users/ec25bcb7-1d15-4345-840e-dc61129d8c0do%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/ec25bcb7-1d15-4345-840e-dc61129d8c0do%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/ec25bcb7-1d15-4345-840e-dc61129d8c0do%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;"> https://groups.google.com/d/msgid/jenkinsci-users/ec25bcb7-1d15-4345-840e-dc61129d8c0do%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="4zXuHcAWAwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jenkins...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-users/06ae9f11-7741-41f7-91df-771575b644fao%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/06ae9f11-7741-41f7-91df-771575b644fao%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/06ae9f11-7741-41f7-91df-771575b644fao%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;"> https://groups.google.com/d/msgid/jenkinsci-users/06ae9f11-7741-41f7-91df-771575b644fao%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/89641782-3816-4d02-ab04-1dca3276bf54o%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: error trying to clone submodule

Arunachalam Sibisakkaravarthi
we clone the entire repository, not submodules.

 > git checkout -f 8e3b73d51abd3f0e77f7d1bf16dbdaa46b0f734e # timeout=10
ERROR: Checkout failed
hudson.plugins.git.GitException: Command "git checkout -f 8e3b73d51abd3f0e77f7d1bf16dbdaa46b0f734e" returned status code 128:
stdout: 
stderr: fatal: reference is not a tree: 8e3b73d51abd3f0e77f7d1bf16dbdaa46b0f734e

	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2430)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$1100(CliGitAPIImpl.java:81)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:2743)
Caused: hudson.plugins.git.GitException: Could not checkout 8e3b73d51abd3f0e77f7d1bf16dbdaa46b0f734e
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:2767)
	at jenkins.plugins.git.MergeWithGitSCMExtension.checkout(MergeWithGitSCMExtension.java:144)
	at jenkins.plugins.git.MergeWithGitSCMExtension.decorateRevisionToBuild(MergeWithGitSCMExtension.java:110)
	at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:1063)
	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1168)
	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:125)
	at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:155)
	at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:142)
	at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:309)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:428)
Retrying after 10 seconds

Thanks And Regards
Sibi.Arunachalam
mCruncher



On Fri, Jun 12, 2020 at 2:40 PM Arturo Arenas <[hidden email]> wrote:
I resolved that with the below script pipeline:


            steps {
                git credentialsId
: 'ssh_key_id', url: 'ssh://git@url.git', branch: 'master'


                withEnv
(['GIT_SSH_COMMAND=ssh -o StrictHostKeyChecking=no']) {
                    sshagent
(credentials: ['ssh_key_id'])  {
                        sh
"git rm -rf mylibs/"
                        sh
"git clone ssh://git@url/mylibs.git"
                        sh
"git submodule sync"
                        sh
"git submodule init"
                        sh
"git submodule update"
                   
}
               
}
           
}



Thanks a lot for your support, i really appreciate that!!

Best Regards!


El jueves, 11 de junio de 2020, 22:22:30 (UTC-4), Jérôme Godbout escribió:

Have you try to clean the workspace and rerun the project, seem like a local permission is wrong into your .git folder.

check the permission on the file:

/var/jenkins_home/workspace/myproject/.git/modules/mylib/config

 

check if the Jenkins user should normally have r/w access to it?

 

From: [hidden email] <[hidden email]> On Behalf Of Arturo Arenas
Sent: June 11, 2020 5:09 PM
To: Jenkins Users <[hidden email]>
Subject: Re: error trying to clone submodule

 

I tried like you told me but this failed again with the error:

hudson.plugins.git.GitException: Command "git submodule sync" returned status code 128:

stdout: Synchronizing submodule url for 'mylib'

 

stderr: error: could not lock config file /var/jenkins_home/workspace/myproject/.git/modules/mylib/config: Permission denied

 


El jueves, 11 de junio de 2020, 16:55:01 (UTC-4), Jérôme Godbout escribió:

This is what I do use and it work for me

 

checkout([$class: 'GitSCM'

                , branches: [[name: 'master']]

                , browser: [$class: 'BitbucketWeb', repoUrl: 'https://bitbucket.org/mynamepath.git']

                , doGenerateSubmoduleConfigurations: false

                , extensions: [[$class: 'CloneOption', noTags: false], [$class: 'LocalBranch', localBranch: "**"], [$class: 'SubmoduleOption', disableSubmodules: false, parentCredentials: true, recursiveSubmodules: true, reference: '', trackingSubmodules: false], [$class: 'CleanCheckout']]

                , submoduleCfg: []

                , userRemoteConfigs: [[credentialsId: 'MyCredsId', url: 'https://bitbucket.org/mynamepath.git']]

            ]);

 

the only difference my eyes can spot is

[$class: 'CleanCheckout']]

 

I also use the https and not ssh, maybe something is wrong into ssh

 

From: [hidden email] <[hidden email]> On Behalf Of Arturo Arenas
Sent: June 11, 2020 3:43 PM
To: Jenkins Users <[hidden email]>
Subject: error trying to clone submodule

 

hello,

 

I'm trying to clone a submodule but it's fail. I'm using pipeline script 

 

                checkout([$class: 'GitSCM',
                          branches
: [[name: 'master']],
                          doGenerateSubmoduleConfigurations
: false,
                          extensions
: [[$class: 'CleanBeforeCheckout'],
                                       
[$class: 'SubmoduleOption',
                                        disableSubmodules
: false,
                                        parentCredentials
: true,
                                        recursiveSubmodules
: true,
                                        reference
: '',
                                        trackingSubmodules
: false]],
                          submoduleCfg
: [],
                          userRemoteConfigs
: [[credentialsId: 'ssh_key_id', url: 'ssh://[hidden email]']]])

 

And i get the next error:

 

hudson.plugins.git.GitException: Command "git submodule update --init --recursive mylib" returned status code 1: stdout: stderr: Cloning into '/var/jenkins_home/workspace/myproject/mylib'...
/var/jenkins_home/workspace/myproject/.git/modules/mylib: Permission denied
fatal: clone of 'ssh://git@url/mylib.git' into submodule path '/var/jenkins_home/workspace/myproject/mylib' failed
Failed to clone 'mylib'. Retry scheduled
Cloning into '/var/jenkins_home/workspace/myproject/mylib'...
/var/jenkins_home/workspace/myproject/.git/modules/mylib: Permission denied
fatal: clone of 'ssh://git@url/mylib.git' into submodule path '/var/jenkins_home/workspace/myproject/mylib' failed
Failed to clone 'mylib' a second time, aborting
 
Also, i tried to test in my computer with " git clone ssh://url --recursive" and work fine the submodule. 
 
what could be happening?
 
i appreciate any help! thanks!
 
best regards!

 

 

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/ec25bcb7-1d15-4345-840e-dc61129d8c0do%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/06ae9f11-7741-41f7-91df-771575b644fao%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/89641782-3816-4d02-ab04-1dca3276bf54o%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAAok04j1Gqv%2BCg%2BQf6p9wEUKY82JzW_titAhRgrEgCjpqThyZw%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: error trying to clone submodule

Arunachalam Sibisakkaravarthi
It doesn't fail consistently, sometimes the checkout is successful.

Thanks And Regards
Sibi.Arunachalam
mCruncher



On Fri, Jun 12, 2020 at 2:51 PM Arunachalam Sibisakkaravarthi <[hidden email]> wrote:
we clone the entire repository, not submodules.

 > git checkout -f 8e3b73d51abd3f0e77f7d1bf16dbdaa46b0f734e # timeout=10
ERROR: Checkout failed
hudson.plugins.git.GitException: Command "git checkout -f 8e3b73d51abd3f0e77f7d1bf16dbdaa46b0f734e" returned status code 128:
stdout: 
stderr: fatal: reference is not a tree: 8e3b73d51abd3f0e77f7d1bf16dbdaa46b0f734e

	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2430)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$1100(CliGitAPIImpl.java:81)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:2743)
Caused: hudson.plugins.git.GitException: Could not checkout 8e3b73d51abd3f0e77f7d1bf16dbdaa46b0f734e
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:2767)
	at jenkins.plugins.git.MergeWithGitSCMExtension.checkout(MergeWithGitSCMExtension.java:144)
	at jenkins.plugins.git.MergeWithGitSCMExtension.decorateRevisionToBuild(MergeWithGitSCMExtension.java:110)
	at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:1063)
	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1168)
	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:125)
	at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:155)
	at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:142)
	at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:309)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:428)
Retrying after 10 seconds

Thanks And Regards
Sibi.Arunachalam
mCruncher



On Fri, Jun 12, 2020 at 2:40 PM Arturo Arenas <[hidden email]> wrote:
I resolved that with the below script pipeline:


            steps {
                git credentialsId
: 'ssh_key_id', url: 'ssh://git@url.git', branch: 'master'


                withEnv
(['GIT_SSH_COMMAND=ssh -o StrictHostKeyChecking=no']) {
                    sshagent
(credentials: ['ssh_key_id'])  {
                        sh
"git rm -rf mylibs/"
                        sh
"git clone ssh://git@url/mylibs.git"
                        sh
"git submodule sync"
                        sh
"git submodule init"
                        sh
"git submodule update"
                   
}
               
}
           
}



Thanks a lot for your support, i really appreciate that!!

Best Regards!


El jueves, 11 de junio de 2020, 22:22:30 (UTC-4), Jérôme Godbout escribió:

Have you try to clean the workspace and rerun the project, seem like a local permission is wrong into your .git folder.

check the permission on the file:

/var/jenkins_home/workspace/myproject/.git/modules/mylib/config

 

check if the Jenkins user should normally have r/w access to it?

 

From: [hidden email] <[hidden email]> On Behalf Of Arturo Arenas
Sent: June 11, 2020 5:09 PM
To: Jenkins Users <[hidden email]>
Subject: Re: error trying to clone submodule

 

I tried like you told me but this failed again with the error:

hudson.plugins.git.GitException: Command "git submodule sync" returned status code 128:

stdout: Synchronizing submodule url for 'mylib'

 

stderr: error: could not lock config file /var/jenkins_home/workspace/myproject/.git/modules/mylib/config: Permission denied

 


El jueves, 11 de junio de 2020, 16:55:01 (UTC-4), Jérôme Godbout escribió:

This is what I do use and it work for me

 

checkout([$class: 'GitSCM'

                , branches: [[name: 'master']]

                , browser: [$class: 'BitbucketWeb', repoUrl: 'https://bitbucket.org/mynamepath.git']

                , doGenerateSubmoduleConfigurations: false

                , extensions: [[$class: 'CloneOption', noTags: false], [$class: 'LocalBranch', localBranch: "**"], [$class: 'SubmoduleOption', disableSubmodules: false, parentCredentials: true, recursiveSubmodules: true, reference: '', trackingSubmodules: false], [$class: 'CleanCheckout']]

                , submoduleCfg: []

                , userRemoteConfigs: [[credentialsId: 'MyCredsId', url: 'https://bitbucket.org/mynamepath.git']]

            ]);

 

the only difference my eyes can spot is

[$class: 'CleanCheckout']]

 

I also use the https and not ssh, maybe something is wrong into ssh

 

From: [hidden email] <[hidden email]> On Behalf Of Arturo Arenas
Sent: June 11, 2020 3:43 PM
To: Jenkins Users <[hidden email]>
Subject: error trying to clone submodule

 

hello,

 

I'm trying to clone a submodule but it's fail. I'm using pipeline script 

 

                checkout([$class: 'GitSCM',
                          branches
: [[name: 'master']],
                          doGenerateSubmoduleConfigurations
: false,
                          extensions
: [[$class: 'CleanBeforeCheckout'],
                                       
[$class: 'SubmoduleOption',
                                        disableSubmodules
: false,
                                        parentCredentials
: true,
                                        recursiveSubmodules
: true,
                                        reference
: '',
                                        trackingSubmodules
: false]],
                          submoduleCfg
: [],
                          userRemoteConfigs
: [[credentialsId: 'ssh_key_id', url: 'ssh://[hidden email]']]])

 

And i get the next error:

 

hudson.plugins.git.GitException: Command "git submodule update --init --recursive mylib" returned status code 1: stdout: stderr: Cloning into '/var/jenkins_home/workspace/myproject/mylib'...
/var/jenkins_home/workspace/myproject/.git/modules/mylib: Permission denied
fatal: clone of 'ssh://git@url/mylib.git' into submodule path '/var/jenkins_home/workspace/myproject/mylib' failed
Failed to clone 'mylib'. Retry scheduled
Cloning into '/var/jenkins_home/workspace/myproject/mylib'...
/var/jenkins_home/workspace/myproject/.git/modules/mylib: Permission denied
fatal: clone of 'ssh://git@url/mylib.git' into submodule path '/var/jenkins_home/workspace/myproject/mylib' failed
Failed to clone 'mylib' a second time, aborting
 
Also, i tried to test in my computer with " git clone ssh://url --recursive" and work fine the submodule. 
 
what could be happening?
 
i appreciate any help! thanks!
 
best regards!

 

 

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/ec25bcb7-1d15-4345-840e-dc61129d8c0do%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/06ae9f11-7741-41f7-91df-771575b644fao%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/89641782-3816-4d02-ab04-1dca3276bf54o%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAAok04hfUdzaCVb-5CT7F4CqUd-fUs6%2Baqem0j0Mor6%3DB1niYQ%40mail.gmail.com.