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

Kubernetes plugin - "name not specified for an operation requiring one"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • kubernetes-plugin
    • None
    • kubernetes 3883.v4d70a_a_a_df034

      Kubernetes plugin version: `3842.v7ff395ed0cf3` and `3872.v760b_4a_6c126b_`
      Kubernetes Client API Plugin: `6.4.1-208.vfe09a_9362c2c`

      After upgrading the above plugins this morning, previously working kubernetes agent definitions are now failing to initialise with the following exception:

      hudson.remoting.ProxyException: io.fabric8.kubernetes.client.KubernetesClientException: name not specified for an operation requiring one.
        	at io.fabric8.kubernetes.client.dsl.internal.BaseOperation.requireFromServer(BaseOperation.java:182)
        	at io.fabric8.kubernetes.client.dsl.internal.BaseOperation.get(BaseOperation.java:142)
        	at io.fabric8.kubernetes.client.dsl.internal.BaseOperation.get(BaseOperation.java:93)
        	at org.csanchez.jenkins.plugins.kubernetes.PodTemplateUtils.parseFromYaml(PodTemplateUtils.java:611)
        	at org.csanchez.jenkins.plugins.kubernetes.PodTemplateUtils.validateYamlContainerNames(PodTemplateUtils.java:640)
        	at org.csanchez.jenkins.plugins.kubernetes.PodTemplateUtils.validateYamlContainerNames(PodTemplateUtils.java:630)
        	at org.csanchez.jenkins.plugins.kubernetes.pipeline.PodTemplateStepExecution.start(PodTemplateStepExecution.java:145)
        	at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:322)
        	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:196)
        	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:124)
        	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:47)
        	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
        	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
        	at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:20)
        Caused: hudson.remoting.ProxyException: java.lang.RuntimeException: Failed to parse yaml: "
      ...SNIP...
      "
      at org.csanchez.jenkins.plugins.kubernetes.PodTemplateUtils.parseFromYaml(PodTemplateUtils.java:613)
          at org.csanchez.jenkins.plugins.kubernetes.PodTemplateUtils.validateYamlContainerNames(PodTemplateUtils.java:640)
          at org.csanchez.jenkins.plugins.kubernetes.PodTemplateUtils.validateYamlContainerNames(PodTemplateUtils.java:630)
          at org.csanchez.jenkins.plugins.kubernetes.pipeline.PodTemplateStepExecution.start(PodTemplateStepExecution.java:145)
          at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:322)
          at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:196)
          at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:124)
          at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:47)
          at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
          at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
      

      An example of a failing pod spec is (sanitised):

      apiVersion: "v1"
      kind: "Pod"
      spec:
       containers:
       - name: "container-1"
         command:
         - "cat"
         image: "image-1"
         resources:
           limits:
             cpu: "1"
             memory: "1Gi"
           requests:
             cpu: "1"
             memory: "1Gi"
         securityContext:
           runAsGroup: 1000
           runAsUser: 1000
         tty: true  
       - name: "container-2"
         command:
         - "cat"
         image: "image-2"
         resources:
           limits:
             cpu: "1"
             memory: "1Gi"
           requests:
             cpu: "1"
             memory: "1Gi"
         securityContext:
           runAsGroup: 1000
           runAsUser: 1000
         tty: true   
       - name: "container-3"
         command:
         - "cat"
         image: "image-3"
         resources:
           limits:
             cpu: "1"
             memory: "1Gi"
           requests:
             cpu: "1"
             memory: "1Gi"
         securityContext:
           runAsGroup: 1000
           runAsUser: 1000
         tty: true 
      

            vlatombe Vincent Latombe
            bbbates B
            Votes:
            4 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved: