# Error while launching agent

**URL:** <https://community.jenkins.io/t/error-while-launching-agent/9385>\
**Category:** Ask a question\
**Created:** [September 4, 2023, 10:21am UTC](https://community.jenkins.io/t/error-while-launching-agent/9385 "2023-09-04T10:21:25Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![shafemoh](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/shafemoh/32/3270_2.png) [@shafemoh](https://community.jenkins.io/u/shafemoh)\
**Post date:** [September 4, 2023, 10:21am UTC](https://community.jenkins.io/t/error-while-launching-agent/9385/1 "2023-09-04T10:21:25Z")

</div>

Hi team,  
we have setup Jenkins on GKE cluster. The UI comes up normally. I tried creating a free style project but while the agent is launching I get this error

2023-09-03 11:06:16.103+0000 [id=82] INFO o.c.j.p.k.KubernetesSlave#\_terminate: Terminating Kubernetes instance for agent default-6m00p  
2023-09-03 11:06:16.103+0000 [id=82] WARNING o.c.j.p.k.KubernetesSlave#deleteSlavePod: Failed to delete pod for agent null/default-6m00p: namespace cannot be null  
io.fabric8.kubernetes.client.KubernetesClientException: namespace cannot be null  
at io.fabric8.kubernetes.client.dsl.internal.BaseOperation.inNamespace(BaseOperation.java:245)  
at io.fabric8.kubernetes.client.dsl.internal.BaseOperation.inNamespace(BaseOperation.java:92)  
at org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave.deleteSlavePod(KubernetesSlave.java:357)  
at org.csanchez.jenkins.plugins.kubernetes.KubernetesSlave.\_terminate(KubernetesSlave.java:343)  
at hudson.slaves.AbstractCloudSlave.terminate(AbstractCloudSlave.java:88)  
at org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher.launch(KubernetesLauncher.java:259)  
at hudson.slaves.SlaveComputer.lambda$\_connect$0(SlaveComputer.java:298)  
at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)  
at jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:80)  
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)  
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)  
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)  
at java.base/java.lang.Thread.run(Thread.java:829)  
2023-09-03 11:06:16.108+0000 [id=82] INFO o.c.j.p.k.KubernetesSlave#\_terminate: Disconnected computer default-6m00p  
2023-09-03 11:06:16.115+0000 [id=41] INFO hudson.slaves.NodeProvisioner#update: default-6m00p provisioning successfully completed. We have now 1 computer(s)  
2023-09-03 11:06:17.104+0000 [id=82] WARNING o.c.j.p.k.KubernetesLauncher#launch: Error in provisioning; agent=KubernetesSlave name: default-t2hrs, template=PodTemplate{id=‘a6e410bbc54d23e84ac3f58bd1608da0e09b1ef712ce19292fc4c1ee6c8add69’, name=‘default’, namespace=‘dev-ns’, slaveConnectTimeout=100, label=‘dev-app-jenkins-agent’, serviceAccount=‘default’, nodeUsageMode=NORMAL, podRetention=‘Never’, containers=[ContainerTemplate{name=‘jnlp’, image=‘jenkins/inbound-agent:3107.v665000b\_51092-15’, workingDir=‘/home/jenkins/agent’, args=‘{computer.jnlpmac} {computer.name}’, resourceRequestCpu=‘512m’, resourceRequestMemory=‘512Mi’, resourceLimitCpu=‘512m’, resourceLimitMemory=‘512Mi’, envVars=[KeyValueEnvVar [getValue()=[http://jenkins.dev-ns.svc.cluster.local:8080/](http://jenkins.dev-ns.svc.cluster.local:8080/), getKey()=JENKINS\_URL]]}]}  
java.lang.IncompatibleClassChangeError: Found class io.fabric8.kubernetes.api.model.VolumeFluent$EmptyDirNested, but interface was expected  
at org.csanchez.jenkins.plugins.kubernetes.volumes.workspace.EmptyDirWorkspaceVolume.buildVolume(EmptyDirWorkspaceVolume.java:63)

---

<div class="post-metadata">

**Author:** ![poddingue](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/poddingue/32/985_2.png) [@poddingue](https://community.jenkins.io/u/poddingue)\
**Post date:** [September 6, 2023, 1:29pm UTC](https://community.jenkins.io/t/error-while-launching-agent/9385/2 "2023-09-06T13:29:47Z")

</div>

Welcome back @shafemoh. 👋

Which version of Jenkins and Kubernetes plugin are you using?

---

<div class="post-metadata">

**Author:** ![kdelorey](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/kdelorey/32/5409_2.png) [@kdelorey](https://community.jenkins.io/u/kdelorey)\
**Post date:** [September 6, 2023, 2:36pm UTC](https://community.jenkins.io/t/error-while-launching-agent/9385/3 "2023-09-06T14:36:10Z")

</div>

After a restart of our Jenkins controller pod, we started to experience this issue. I’ve tried a few things in order to resolve it and unblock our team.

We experienced it on Jenkins 2.401.3 with Kubernetes plugin 3971.v94b\_4c914ca\_75  
I’ve also tried to update Jenkins to 2.414.1 and with no change.

It appears to me like its trying to do something with the workspace volume mounting that it implicitly injects into pod templates, I’ve also tried to create this volume mount in the pod template explicitly and it didn’t make a difference.

Any ideas on a resolution?

EDIT: I had forgotten we downgraded the Kubernetes plugin to 3971.v94b\_4c914ca\_75 as one of our resolution attempts, after upgrading Jenkins and then restoring the Kubernetes plugin back to 4029.v5712230ccb\_f8 it resolved.

---

<div class="post-metadata">

**Author:** ![shafemoh](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/shafemoh/32/3270_2.png) [@shafemoh](https://community.jenkins.io/u/shafemoh)\
**Post date:** [September 6, 2023, 3:56pm UTC](https://community.jenkins.io/t/error-while-launching-agent/9385/4 "2023-09-06T15:56:17Z")

</div>

Hi @poddingue We are currently using **1.27.3-gke.100** of K8s on GKE and **kubernetes:3937.vd7b\_82db\_e347b\_** of the K8s plugin.

---

<div class="post-metadata">

**Author:** ![shafemoh](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/shafemoh/32/3270_2.png) [@shafemoh](https://community.jenkins.io/u/shafemoh)\
**Post date:** [September 6, 2023, 4:16pm UTC](https://community.jenkins.io/t/error-while-launching-agent/9385/5 "2023-09-06T16:16:14Z")

</div>

Hi guys,  
I just tried to upgrade the k8s plugin to latest version **4029.v5712230ccb\_f8** and it solved the issue. Strange that I had been using the older version **3937.vd7b\_82db\_e347b\_** all these days and it was working fine and suddenly the same older version started causing issues…  
Btw, I use Jenkins v2.401.2 (Helm way of installing Jenkins)

---

<div class="post-metadata">

**Author:** ![poddingue](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/poddingue/32/985_2.png) [@poddingue](https://community.jenkins.io/u/poddingue)\
**Post date:** [September 6, 2023, 4:27pm UTC](https://community.jenkins.io/t/error-while-launching-agent/9385/6 "2023-09-06T16:27:22Z")

</div>

Thanks a lot for your feedback, folks. 👍

---

<div class="post-metadata">

**Author:** ![pyo](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/pyo/32/5634_2.png) [@pyo](https://community.jenkins.io/u/pyo)\
**Post date:** [September 27, 2023, 9:01pm UTC](https://community.jenkins.io/t/error-while-launching-agent/9385/7 "2023-09-27T21:01:20Z")

</div>

Thank you! Finding this post saved us hours of extra work

---

<div class="post-metadata">

**Author:** ![ashokumar.gv12](https://avatars.discourse-cdn.com/v4/letter/a/43a26b/32.png) [@ashokumar.gv12](https://community.jenkins.io/u/ashokumar.gv12)\
**Post date:** [October 17, 2023, 8:19am UTC](https://community.jenkins.io/t/error-while-launching-agent/9385/8 "2023-10-17T08:19:36Z")

</div>

Thank you, @shafemoh it’s helped me a lot:smile: ✌
