Details

    • Similar Issues:

      Description

      Hi,

      I'm trying to get windows pods working on GKE but for both the jnlp and shell container I get the following errors:

      Error: failed to start container "jnlp": Error response from daemon: CreateComputeSystem jnlp: The system cannot find the file specified.

      Error: failed to start container "shell": Error response from daemon: CreateComputeSystem shell: The system cannot find the file specified.

      This is using the sample pipeline:

      /*
       * Runs a build on a Windows pod.
       * Tested in EKS: https://docs.aws.amazon.com/eks/latest/userguide/windows-support.html
       */
      podTemplate(yaml: '''
      apiVersion: v1
      kind: Pod
      spec:
        containers:
        - name: jnlp
          image: jenkins/jnlp-agent:latest-windows
        - name: shell
          image: mcr.microsoft.com/powershell:preview-windowsservercore-1809
          command:
          - powershell
          args:
          - Start-Sleep
          - 999999
        nodeSelector:
          beta.kubernetes.io/os: windows
      ''') {
          node(POD_LABEL) {
              container('shell') {
                  powershell 'Get-ChildItem Env: | Sort Name'
              }
          }
      }
      

      Here's an outline the commands I used to setup the cluster:

      gcloud beta container clusters create jenkins-cd \
        --num-nodes 2 \
        --machine-type n1-standard-2 \
        --scopes "https://www.googleapis.com/auth/source.read_write,cloud-platform" \
        --enable-ip-alias \
        --release-channel=rapid
      
      gcloud container clusters get-credentials jenkins-cd
      
      gcloud beta container node-pools create windows-pool \
        --cluster=jenkins-cd \
        --image-type=WINDOWS_SAC \
        --no-enable-autoupgrade \
        --machine-type=n1-standard-2
      
      wget https://get.helm.sh/helm-v2.16.1-linux-amd64.tar.gz
      
      tar zxfv helm-v2.16.1-linux-amd64.tar.gz
      cp linux-amd64/helm .
      
      kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user=$(gcloud config get-value account)
      
      kubectl create serviceaccount tiller --namespace kube-system
      kubectl create clusterrolebinding tiller-admin-binding --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
      
      ./helm init --service-account=tiller
      ./helm update
      
      ./helm version
      
      ./helm install -n cd stable/jenkins -f jenkins/values.yaml --version 1.2.2 --wait
      
      kubectl get pods
      
      export POD_NAME=$(kubectl get pods -l "app.kubernetes.io/component=jenkins-master" -o jsonpath="{.items[0].metadata.name}")
      kubectl port-forward $POD_NAME 8080:8080 >> /dev/null &
      
      kubectl get svc
      
      printf $(kubectl get secret cd-jenkins -o jsonpath="{.data.jenkins-admin-password}" | base64 --decode);echo
      

      Then I login into Jenkins and try to run the sample pipeline for windows but I cannot get it to work.

      The following error also appears in the jenkins master log:

      Error in provisioning; agent=KubernetesSlave name: windows-test-8-hn1vc-q3pg0-k4x83, template=PodTemplate{, name='windows-test_8-hn1vc-q3pg0', namespace='default', label='windows-test_8-hn1vc', nodeUsageMode=EXCLUSIVE, workspaceVolume=EmptyDirWorkspaceVolume [memory=false], annotations=[org.csanchez.jenkins.plugins.kubernetes.PodAnnotation@aab9c821, org.csanchez.jenkins.plugins.kubernetes.PodAnnotation@c92c82e4]}
      java.lang.IllegalStateException: Pod has terminated containers: default/windows-test-8-hn1vc-q3pg0-k4x83 (jnlp, shell)
      	at org.csanchez.jenkins.plugins.kubernetes.AllContainersRunningPodWatcher.periodicAwait(AllContainersRunningPodWatcher.java:183)
      	at org.csanchez.jenkins.plugins.kubernetes.AllContainersRunningPodWatcher.periodicAwait(AllContainersRunningPodWatcher.java:204)
      	at org.csanchez.jenkins.plugins.kubernetes.AllContainersRunningPodWatcher.await(AllContainersRunningPodWatcher.java:144)
      	at org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher.launch(KubernetesLauncher.java:139)
      	at hudson.slaves.SlaveComputer.lambda$_connect$0(SlaveComputer.java:292)
      	at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
      	at jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:71)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      

      I can deploy an image via kubectl apply -f jenkins-windows.yaml with the following template successfully:

      apiVersion: apps/v1
      kind: Deployment
      metadata:
        name: jenkins-windows
        labels:
          app: jenkins-windows
      spec:
        replicas: 0
        selector:
          matchLabels:
            app: jenkins-windows
        template:
          metadata:
            labels:
              app: jenkins-windows
          spec:
            nodeSelector:
              kubernetes.io/os: windows
            containers:
            - name: jnlp
              image: jenkins/jnlp-agent:latest-windows
            - name: shell
              image: mcr.microsoft.com/powershell:preview-windowsservercore-1809
              ports:
              - containerPort: 80
      

      I'm not sure how to debug this really. The error says The system cannot find the file specified but I am not sure what file this refers to. Is it related to workspaceVolume not being set? I would have thought the sample pipeline would work without that though (and I don't yet know how to configure that).

      Any help would be really appreciated else I will have to drop Kubernetes and just use VMs.

      For good measure here is also the log from the job:

      Created Pod: windows-test-9-mdt6s-t2kj3-dsr2n in namespace default
      Still waiting to schedule task
      ‘windows-test-9-mdt6s-t2kj3-dsr2n’ is offline
      Created Pod: windows-test-9-mdt6s-t2kj3-dcqvw in namespace default
      Created Pod: windows-test-9-mdt6s-t2kj3-kvr05 in namespace default
      Created Pod: windows-test-9-mdt6s-t2kj3-k9v52 in namespace default
      Created Pod: windows-test-9-mdt6s-t2kj3-tbn3g in namespace default
      Created Pod: windows-test-9-mdt6s-t2kj3-2qv1t in namespace default
      Aborted by admin
      

        Attachments

          Activity

          alexgeek Alexander Perry created issue -
          olblak Olivier Vernin made changes -
          Field Original Value New Value
          Project Infrastructure [ 10301 ] Jenkins [ 10172 ]
          Key INFRA-2504 JENKINS-61340
          Workflow classic default workflow [ 242327 ] JNJira + In-Review [ 242336 ]
          Component/s kubernetes-plugin [ 20639 ]
          Component/s kubernetes [ 26522 ]
          kon Kalle Niemitalo made changes -
          Description Hi,Hi,
          I'm trying to get windows pods working on GKE but for both the _jnlp_ and _shell_ container I get the following errors:
          ```Error: failed to start container "jnlp": Error response from daemon: CreateComputeSystem jnlp: The system cannot find the file specified.```
          ```Error: failed to start container "shell": Error response from daemon: CreateComputeSystem shell: The system cannot find the file specified.```
          This is using the sample pipeline:
          ```/* * Runs a build on a Windows pod. * Tested in EKS: https://docs.aws.amazon.com/eks/latest/userguide/windows-support.html */podTemplate(yaml: '''apiVersion: v1kind: Podspec:  containers:  - name: jnlp    image: jenkins/jnlp-agent:latest-windows  - name: shell    image: mcr.microsoft.com/powershell:preview-windowsservercore-1809    command:    - powershell    args:    - Start-Sleep    - 999999  nodeSelector:    beta.kubernetes.io/os: windows''') \{    node(POD_LABEL) {        container('shell') {            powershell 'Get-ChildItem Env: | Sort Name'        }    }}```
          Here's an outline the commands I used to setup the cluster:
          ```gcloud beta container clusters create jenkins-cd \  --num-nodes 2 \  --machine-type n1-standard-2 \  --scopes "https://www.googleapis.com/auth/source.read_write,cloud-platform" \  --enable-ip-alias \  --release-channel=rapid
          gcloud container clusters get-credentials jenkins-cd
          gcloud beta container node-pools create windows-pool \  --cluster=jenkins-cd \  --image-type=WINDOWS_SAC \  --no-enable-autoupgrade \  --machine-type=n1-standard-2```
          ```wget https://get.helm.sh/helm-v2.16.1-linux-amd64.tar.gz
          tar zxfv helm-v2.16.1-linux-amd64.tar.gzcp linux-amd64/helm .
          kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user=$(gcloud config get-value account)
          kubectl create serviceaccount tiller --namespace kube-systemkubectl create clusterrolebinding tiller-admin-binding --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
          ./helm init --service-account=tiller./helm update
          ./helm version```
          ```./helm install -n cd stable/jenkins -f jenkins/values.yaml --version 1.2.2 --wait
          kubectl get pods
          export POD_NAME=$(kubectl get pods -l "app.kubernetes.io/component=jenkins-master" -o jsonpath="\{.items[0].metadata.name}")kubectl port-forward $POD_NAME 8080:8080 >> /dev/null &
          kubectl get svc
          printf $(kubectl get secret cd-jenkins -o jsonpath="\{.data.jenkins-admin-password}" | base64 --decode);echo```
          Then I login into Jenkins and try to run the sample pipeline for windows but I cannot get it to work. 
          The following error also appears in the jenkins master log:
          ```Error in provisioning; agent=KubernetesSlave name: windows-test-8-hn1vc-q3pg0-k4x83, template=PodTemplate\{, name='windows-test_8-hn1vc-q3pg0', namespace='default', label='windows-test_8-hn1vc', nodeUsageMode=EXCLUSIVE, workspaceVolume=EmptyDirWorkspaceVolume [memory=false], annotations=[org.csanchez.jenkins.plugins.kubernetes.PodAnnotation@aab9c821, org.csanchez.jenkins.plugins.kubernetes.PodAnnotation@c92c82e4]}java.lang.IllegalStateException: Pod has terminated containers: default/windows-test-8-hn1vc-q3pg0-k4x83 (jnlp, shell) at org.csanchez.jenkins.plugins.kubernetes.AllContainersRunningPodWatcher.periodicAwait(AllContainersRunningPodWatcher.java:183) at org.csanchez.jenkins.plugins.kubernetes.AllContainersRunningPodWatcher.periodicAwait(AllContainersRunningPodWatcher.java:204) at org.csanchez.jenkins.plugins.kubernetes.AllContainersRunningPodWatcher.await(AllContainersRunningPodWatcher.java:144) at org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher.launch(KubernetesLauncher.java:139) at hudson.slaves.SlaveComputer.lambda$_connect$0(SlaveComputer.java:292) at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46) at jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:71) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)```
          I can deploy an image via `kubectl apply -f jenkins-windows.yaml` with the following template successfully:
          ```apiVersion: apps/v1kind: Deploymentmetadata:  name: jenkins-windows  labels:    app: jenkins-windowsspec:  replicas: 0  selector:    matchLabels:      app: jenkins-windows  template:    metadata:      labels:        app: jenkins-windows    spec:      nodeSelector:        kubernetes.io/os: windows      containers:      - name: jnlp        image: jenkins/jnlp-agent:latest-windows      - name: shell        image: mcr.microsoft.com/powershell:preview-windowsservercore-1809        ports:        - containerPort: 80```
          I'm not sure how to debug this really. The error says `The system cannot find the file specified` but I am not sure what file this refers to. Is it related to workspaceVolume not being set? I would have thought the sample pipeline would work without that though (and I don't yet know how to configure that). 
          Any help would be really appreciated else I will have to drop Kubernetes and just use VMs. 
          For good measure here is also the log from the job:
          ```Created Pod: windows-test-9-mdt6s-t2kj3-dsr2n in namespace defaultStill waiting to schedule task‘windows-test-9-mdt6s-t2kj3-dsr2n’ is offlineCreated Pod: windows-test-9-mdt6s-t2kj3-dcqvw in namespace defaultCreated Pod: windows-test-9-mdt6s-t2kj3-kvr05 in namespace defaultCreated Pod: windows-test-9-mdt6s-t2kj3-k9v52 in namespace defaultCreated Pod: windows-test-9-mdt6s-t2kj3-tbn3g in namespace defaultCreated Pod: windows-test-9-mdt6s-t2kj3-2qv1t in namespace defaultAborted by admin```
          Hi,

          I'm trying to get windows pods working on GKE but for both the _jnlp_ and _shell_ container I get the following errors:

          {quote}
          Error: failed to start container "jnlp": Error response from daemon: CreateComputeSystem jnlp: The system cannot find the file specified.
          {quote}

          {quote}
          Error: failed to start container "shell": Error response from daemon: CreateComputeSystem shell: The system cannot find the file specified.
          {quote}

          This is using the sample pipeline:

          {code:groovy}
          /*
           * Runs a build on a Windows pod.
           * Tested in EKS: https://docs.aws.amazon.com/eks/latest/userguide/windows-support.html
           */
          podTemplate(yaml: '''
          apiVersion: v1
          kind: Pod
          spec:
            containers:
            - name: jnlp
              image: jenkins/jnlp-agent:latest-windows
            - name: shell
              image: mcr.microsoft.com/powershell:preview-windowsservercore-1809
              command:
              - powershell
              args:
              - Start-Sleep
              - 999999
            nodeSelector:
              beta.kubernetes.io/os: windows
          ''') {
              node(POD_LABEL) {
                  container('shell') {
                      powershell 'Get-ChildItem Env: | Sort Name'
                  }
              }
          }
          {code}

          Here's an outline the commands I used to setup the cluster:

          {code:sh}
          gcloud beta container clusters create jenkins-cd \
            --num-nodes 2 \
            --machine-type n1-standard-2 \
            --scopes "https://www.googleapis.com/auth/source.read_write,cloud-platform" \
            --enable-ip-alias \
            --release-channel=rapid

          gcloud container clusters get-credentials jenkins-cd

          gcloud beta container node-pools create windows-pool \
            --cluster=jenkins-cd \
            --image-type=WINDOWS_SAC \
            --no-enable-autoupgrade \
            --machine-type=n1-standard-2
          {code}

          {code:sh}
          wget https://get.helm.sh/helm-v2.16.1-linux-amd64.tar.gz

          tar zxfv helm-v2.16.1-linux-amd64.tar.gz
          cp linux-amd64/helm .

          kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user=$(gcloud config get-value account)

          kubectl create serviceaccount tiller --namespace kube-system
          kubectl create clusterrolebinding tiller-admin-binding --clusterrole=cluster-admin --serviceaccount=kube-system:tiller

          ./helm init --service-account=tiller
          ./helm update

          ./helm version
          {code}

          {code:sh}
          ./helm install -n cd stable/jenkins -f jenkins/values.yaml --version 1.2.2 --wait

          kubectl get pods

          export POD_NAME=$(kubectl get pods -l "app.kubernetes.io/component=jenkins-master" -o jsonpath="{.items[0].metadata.name}")
          kubectl port-forward $POD_NAME 8080:8080 >> /dev/null &

          kubectl get svc

          printf $(kubectl get secret cd-jenkins -o jsonpath="{.data.jenkins-admin-password}" | base64 --decode);echo
          {code}

          Then I login into Jenkins and try to run the sample pipeline for windows but I cannot get it to work.

          The following error also appears in the jenkins master log:

          {noformat}
          Error in provisioning; agent=KubernetesSlave name: windows-test-8-hn1vc-q3pg0-k4x83, template=PodTemplate{, name='windows-test_8-hn1vc-q3pg0', namespace='default', label='windows-test_8-hn1vc', nodeUsageMode=EXCLUSIVE, workspaceVolume=EmptyDirWorkspaceVolume [memory=false], annotations=[org.csanchez.jenkins.plugins.kubernetes.PodAnnotation@aab9c821, org.csanchez.jenkins.plugins.kubernetes.PodAnnotation@c92c82e4]}
          java.lang.IllegalStateException: Pod has terminated containers: default/windows-test-8-hn1vc-q3pg0-k4x83 (jnlp, shell)
          at org.csanchez.jenkins.plugins.kubernetes.AllContainersRunningPodWatcher.periodicAwait(AllContainersRunningPodWatcher.java:183)
          at org.csanchez.jenkins.plugins.kubernetes.AllContainersRunningPodWatcher.periodicAwait(AllContainersRunningPodWatcher.java:204)
          at org.csanchez.jenkins.plugins.kubernetes.AllContainersRunningPodWatcher.await(AllContainersRunningPodWatcher.java:144)
          at org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher.launch(KubernetesLauncher.java:139)
          at hudson.slaves.SlaveComputer.lambda$_connect$0(SlaveComputer.java:292)
          at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
          at jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:71)
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          at java.lang.Thread.run(Thread.java:748)
          {noformat}

          I can deploy an image via {{kubectl apply -f jenkins-windows.yaml}} with the following template successfully:

          {code:none}
          apiVersion: apps/v1
          kind: Deployment
          metadata:
            name: jenkins-windows
            labels:
              app: jenkins-windows
          spec:
            replicas: 0
            selector:
              matchLabels:
                app: jenkins-windows
            template:
              metadata:
                labels:
                  app: jenkins-windows
              spec:
                nodeSelector:
                  kubernetes.io/os: windows
                containers:
                - name: jnlp
                  image: jenkins/jnlp-agent:latest-windows
                - name: shell
                  image: mcr.microsoft.com/powershell:preview-windowsservercore-1809
                  ports:
                  - containerPort: 80
          {code}

          I'm not sure how to debug this really. The error says {{The system cannot find the file specified}} but I am not sure what file this refers to. Is it related to workspaceVolume not being set? I would have thought the sample pipeline would work without that though (and I don't yet know how to configure that).

          Any help would be really appreciated else I will have to drop Kubernetes and just use VMs.

          For good measure here is also the log from the job:

          {noformat}
          Created Pod: windows-test-9-mdt6s-t2kj3-dsr2n in namespace default
          Still waiting to schedule task
          ‘windows-test-9-mdt6s-t2kj3-dsr2n’ is offline
          Created Pod: windows-test-9-mdt6s-t2kj3-dcqvw in namespace default
          Created Pod: windows-test-9-mdt6s-t2kj3-kvr05 in namespace default
          Created Pod: windows-test-9-mdt6s-t2kj3-k9v52 in namespace default
          Created Pod: windows-test-9-mdt6s-t2kj3-tbn3g in namespace default
          Created Pod: windows-test-9-mdt6s-t2kj3-2qv1t in namespace default
          Aborted by admin
          {noformat}
          alexgeek Alexander Perry made changes -
          Status Open [ 1 ] Fixed but Unreleased [ 10203 ]
          Assignee Alexander Perry [ alexgeek ]
          Resolution Fixed [ 1 ]
          jglick Jesse Glick made changes -
          Resolution Fixed [ 1 ]
          Status Fixed but Unreleased [ 10203 ] Reopened [ 4 ]
          jglick Jesse Glick made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Not A Defect [ 7 ]

            People

            • Assignee:
              alexgeek Alexander Perry
              Reporter:
              alexgeek Alexander Perry
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: