Please bear with the nesting, but I am unable to clone a submodule in a docker image in a jenkins organization job. Non-submodule builds succeed. I used the credentials plugin to store my passphrase and username from GitHub (where I have 2-factor enabled) in this fresh Jenkins instance.
My Jenkinsfile pipeline is very minimal:
node('master') {
stage('Build') {
docker.image('jenkins-base-image:latest').inside {
sh """git submodule update --init path/to/submodule"""
}
}
}
The submodule clone works fine when performed manually, but fails within this job with errors of the sort:
+ git submodule update --init path/to/submodule
Cloning into '/var/lib/jenkins/workspace/55JPWTVF2QHKJYTPLJOHZLDO2T3KKXKJT5SKLQUNMNOJBXMQ2TQ/path/to/submodule'...
fatal: could not read Username for 'https://github.com': No such device or address
fatal: clone of 'something.git' into submodule path '/var/lib/jenkins/workspace/J55JPWTVF2QHKJYTPLJOHZLDO2T3KKXKJT5SKLQUNMNOJBXMQ2TQ/path/to/submodule' failed
Failed to clone 'path/to/submodule'. Retry scheduled
I tried removing and re-adding the submodules with SSH equivalent ones but the issue persists.
Dependencies:
- Jenkins version: 2.107.2
- Ubuntu version: 16.04LTS
- Ubuntu docker version: 14.04LTS
- I tried to make use of very few plugins and am not sure how to track which plugins are being used for this default organization job.
Likely irrelevant, but the global Jenkins config shows warning:
There is no credentials with admin access to manage hooks on GitHubRepositoryName[host=github.com,username=myco,repository=abcd]
Again the top-level repo cloned via the job just fine.