Builds randomly fail with `Agent shack-app-pr-7-abc was deleted; cancelling node body`
IntermediateTroubleshootingAgents, executors & the queue
Answer
Likely causes → The pod was deleted underneath the build: node scale-down by the cluster autoscaler, eviction due to memory/ephemeral storage, spot/preemptible node reclaim, or activeDeadlineSeconds.
Diagnose → kubectl get events -n jenkins-agents --sort-by=.lastTimestamp, autoscaler logs, node termination events.
Fix → Add cluster-autoscaler.kubernetes.io/safe-to-evict: "false" annotation to agent pods, set proper requests/limits, avoid spot nodes for long builds or add retry(conditions: [kubernetesAgent()]).
Prevent → Separate node pool for agents with tuned autoscaler settings.
More on Agents, executors & the queue
Build stuck: `Still waiting to schedule task. ‘Jenkins’ doesn’t have label ‘docker’`Beginner`Waiting for next available executor on ‘linux’` for 20 minutes during peak hoursBeginner`All nodes of label ‘windows’ are offline`Beginner`hudson.remoting.ChannelClosedException: Channel "hudson.remoting.Channel@6e4b:agent-07": Remote call on agent-07 failed. The channel is closing down or has closed down`IntermediateInbound agent fails: `SEVERE: http://jenkins:8080/tcpSlaveAgentListener/ is invalid: 404 Not Found`IntermediateAgent connects but builds fail with `java.io.IOException: Cannot run program "nohup" (in directory "C:\jenkins\workspace\app"): CreateProcess error=2`Beginner