Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-53895

checkout scm over ssh in a pod created by kubernetes plugin fails

XMLWordPrintable

      The `checkout scm`step fails  in a slave container created with the Kubernetes Plugin while having "Checkout over SSH" enabled in the Github
      Branch Source Plugins configurations.

       

      The error I'm getting is smthing like this: "stderr: No user exists for uid 1000450000" so apparently its not using the correct ssh-user to authenticate with github.

       

      During the checkout the logs correctly state "... using GIT_SSH to set credentials correct-credentials@example.com for jobs ...." but apparently it is not actually used. The checkout works for the same pipeline if the `Checkout over SSH` is not enabled.

      def label = "mypod-${UUID.randomUUID().toString()}"
      podTemplate(label: label, containers: [
          containerTemplate(
              name: "example",
              image: "someImage",
              ttyEnabled: true,
              command: "cat",
              resourceLimitCpu: '500m',
              resourceLimitMemory: '1024Mi',
          ),
      ]) {
      
          node(label) {
              echo "Checking out scm"
              checkout scm
              echo "scm checkout done"
      
              stage('Stage X') {
                  sh "ls -la"
                  container('example') {
                      stage('Stage Y') {
                          sh "ls -la"
                      }
                  }
              }
      
          }
      }
       

            csanchez Carlos Sanchez
            severi Severi Haverila
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: