A pipeline stage shows `Waiting for agent to connect (30/100): shack-app-main-12-x7k2p-9q8wz` and eventually fails
IntermediateTroubleshootingAgents, executors & the queue
Answer
Likely causes → The pod started but the jnlp container cannot reach the controller (wrong Jenkins URL, NetworkPolicy, DNS), or the pod is stuck Pending/ImagePullBackOff.
Diagnose →
kubectl -n jenkins-agents get pod shack-app-main-12-x7k2p-9q8wz -o wide
kubectl -n jenkins-agents describe pod shack-app-main-12-x7k2p-9q8wz
kubectl -n jenkins-agents logs shack-app-main-12-x7k2p-9q8wz -c jnlp
Fix → Correct jenkinsUrl (e.g. http://jenkins.jenkins.svc.cluster.local:8080/), enable WebSocket, allow egress to the Jenkins service in NetworkPolicy, fix image names.
Prevent → Smoke pipeline after any cloud or network change.
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