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: jenkinsci-users@googlegroups.com <jenkinsci-users@googlegroups.com> On 
Behalf Of Arturo Arenas
Sent: June 11, 2020 5:09 PM
To: Jenkins Users <jenkinsci-users@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: 
'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: jenkins...@googlegroups.com<javascript:> 
<jenkins...@googlegroups.com<javascript:>> On Behalf Of Arturo Arenas
Sent: June 11, 2020 3:43 PM
To: Jenkins Users <jenkins...@googlegroups.com<javascript:>>
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://g...@url.git']]])

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 jenkins...@googlegroups.com<javascript:>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/ec25bcb7-1d15-4345-840e-dc61129d8c0do%40googlegroups.com<https://groups.google.com/d/msgid/jenkinsci-users/ec25bcb7-1d15-4345-840e-dc61129d8c0do%40googlegroups.com?utm_medium=email&utm_source=footer>.
--
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 
jenkinsci-users+unsubscr...@googlegroups.com<mailto:jenkinsci-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/06ae9f11-7741-41f7-91df-771575b644fao%40googlegroups.com<https://groups.google.com/d/msgid/jenkinsci-users/06ae9f11-7741-41f7-91df-771575b644fao%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/YQBPR0101MB10745ECF6DEE70EDBEE4E7BBCD810%40YQBPR0101MB1074.CANPRD01.PROD.OUTLOOK.COM.

Reply via email to