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

Kubernetes plugin breaks build resume on Jenkins restart

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Critical Critical
    • kubernetes-plugin
    • None
    • Jenkins 2.263
      Kubernetes 1.27.2

      Kubernetes plugin upgrade 1.27.2 breaks the build resume after restart.

       java.lang.IllegalStateException: Not expecting pod template to be null at this point
       	at org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave.getTemplate(KubernetesSlave.java:92)
       	at org.csanchez.jenkins.plugins.kubernetes.pipeline.SecretsMasker$Factory.secretsOf(SecretsMasker.java:144)
       	at org.csanchez.jenkins.plugins.kubernetes.pipeline.SecretsMasker$Factory.get(SecretsMasker.java:122)
       	at org.csanchez.jenkins.plugins.kubernetes.pipeline.SecretsMasker$Factory.get(SecretsMasker.java:94)
       	at org.jenkinsci.plugins.workflow.steps.DynamicContext$Typed.get(DynamicContext.java:94)
       	at org.jenkinsci.plugins.workflow.cps.ContextVariableSet.get(ContextVariableSet.java:138)
       	at org.jenkinsci.plugins.workflow.cps.CpsThread.getContextVariable(CpsThread.java:135)
       	at org.jenkinsci.plugins.workflow.cps.CpsStepContext.doGet(CpsStepContext.java:297)
       	at org.jenkinsci.plugins.workflow.support.DefaultStepContext.get(DefaultStepContext.java:67)
       	at org.jenkinsci.plugins.workflow.support.DefaultStepContext.getListener(DefaultStepContext.java:116)
       	at org.jenkinsci.plugins.workflow.support.DefaultStepContext.get(DefaultStepContext.java:79)
       	at org.jenkinsci.plugins.workflow.support.DefaultStepContext.makeLauncher(DefaultStepContext.java:149)
       	at org.jenkinsci.plugins.workflow.support.DefaultStepContext.get(DefaultStepContext.java:75)
       	at org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Execution.launcher(DurableTaskStep.java:484) 

      Maybe is it the same cause as for JENKINS-63925 ?

      Reproduction steps:

      pipeline {
          agent {
              label 'jenkins-jx-base'
          }
          stages {
              stage('Restart Jenkins') {
                  steps {
                      container('jx-base') {
                          script {
                              sh 'kubectl delete pod -l app=jenkins --wait=false'
                          }
                          echo "restart OK"
                      }
                  }
              }
          }
      } 

      Downgrading to 1.27.1.1 fixed the build resume.

      Version 1.27.3 is still broken.

            Unassigned Unassigned
            jcarsique Julien Carsique
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: