Jenkins can't checkout to private github from non master agent


My company SAP holds several JaaS servers (e.g. ,

When I’m trying to run a job from a Kubernetes agent in server it’s failed to checkout to our private github server ( because lacking an SSL certificate.

The job script :

pipeline {
    agent { kubernetes {
            defaultContainer 'go'
            yaml '''
apiVersion: v1
kind: Pod
  - name: go
    image: golang:1.17.1
    - cat
    tty: true
    triggers {
        cron('H 0 * * 0')
    stages {
        stage('stage1') {
            steps {
                    sh '''
                       echo "hello from stage 1"

The error :

Selected Git installation does not exist. Using Default
The recommended git tool is: NONE
using credential webidebot-github-token
Cloning the remote Git repository
Cloning repository
   > git init /home/jenkins/agent/workspace/devspace-scheduler-ci # timeout=10
  ERROR: Error cloning remote repo 'origin'
  hudson.plugins.git.GitException: Command "git fetch --tags --force --progress -- +refs/heads/*:refs/remotes/origin/*" returned status code 128:
  stderr: fatal: unable to access '': server certificate verification failed. CAfile: none CRLfile: none

When it’s run on a ‘controller’ agent e.g -

agent { label ‘master’ }
it works as expected.

Also when I’m trying the same script in our other Jenkins server - it works.

This is the configuration of the SCM for the job :

(The reason I need to run it from a different agent is that I need several tools installed on it)

What can be the difference between the JaaSs so that it works on one of them and not on the other?

Thanks in advance,

1 Like

You described the root of the problem:

The agent lacks the SSL certificate that is on the controller. Note that we use the word “controller” instead of “master”. Please update your post to use the correct term.

Your choices are:

  • Install the SSL certificate on each agent
  • Switch to use ssh private keys instead of username/password authentication to clone the repo

Thank you @MarkEWaite for your response.

As I understand. The agent is created from the image I gave it.
So I tried also to use an image that I installed on it the certificate but it’s not working on the JaaS but only in JaaS.

Do you have any idea what is configured in so it works on it with the same image?

No, I don’t. You’ll need to check with your Jenkins administrators. If you’d rather not do that, then switch to use ssh access and ssh private keys instead of using https access to the repository. Or, ask the repository administrators to provide an SSL certificate on the repository server.

1 Like