I created dynamic slaves on AKS behind a corporate proxy. It creates a new slave on starting a build and then destroys it after a while. I checked the logs on the master and it says error in provisioning. After that it creates a new slave again and the cycle goes on. One error which caught my eye was this:
h.p.g.i.GradleBuildScanInjection#inject: Error: HOME is not set
Also, this error is coming:
2022-06-21 13:09:54.685+0000 [id=10341] WARNING o.c.j.p.k.KubernetesLauncher#launch: Error in provisioning; agent=KubernetesSlave name: jnlp-qpkr6, template=PodTemplate{id='f4810f9e-f4dc-4cbc-b27f-251c63fa939e', name='jnlp', namespace='jenkins-test', label='java', nodeUsageMode=NORMAL, containers=[ContainerTemplate{name='jnlp', image='jenkins/inbound-agent', alwaysPullImage=true, workingDir='/home/jenkins/agent', command='/bin/sh -c', args='cat', ttyEnabled=true, resourceRequestCpu='', resourceRequestMemory='', resourceRequestEphemeralStorage='', resourceLimitCpu='', resourceLimitMemory='', resourceLimitEphemeralStorage='', livenessProbe=ContainerLivenessProbe{execArgs='', timeoutSeconds=0, initialDelaySeconds=0, failureThreshold=0, periodSeconds=0, successThreshold=0}}]}
java.lang.IllegalStateException: Node was deleted, computer is null
at org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher.launch(KubernetesLauncher.java:191)
at hudson.slaves.SlaveComputer.lambda$_connect$0(SlaveComputer.java:297)
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)
I am not sure how to troubleshoot. Please help.