Agents connect but every `sh` step in `container('node')` hangs for minutes before running
AdvancedTroubleshootingPlugins, JCasC & Kubernetes agents
Answer
Likely causes → The exec API calls are slow or throttled (API server overloaded, webhook admission controllers on pods/exec), or a proxy between controller and API server buffers the exec stream.
Diagnose → Time kubectl exec manually from the controller pod; check API server latency metrics and admission webhooks.
Fix → Fix API server or webhook latency; as a workaround run steps in the jnlp container by building a custom agent image with the tools.
Prevent → Monitor API server latency; keep exec-heavy pipelines in mind when adding admission webhooks.
More on Plugins, JCasC & Kubernetes agents
Startup log: `SEVERE: Failed Loading plugin Pipeline: Groovy v... (workflow-cps)` with `Update required: Pipeline: Supporting APIs (workflow-support) ... to be updated to ... or higher`IntermediatePlugin fails with `Jenkins (2.426.3) or higher required`BeginnerJCasC fails at startup: `io.jenkins.plugins.casc.ConfiguratorException: Invalid configuration elements for type class jenkins.model.Jenkins : agentProtocols`Intermediate`io.jenkins.plugins.casc.UnknownConfiguratorException: No configurator for the following root elements: sonarGlobalConfiguration`IntermediateJCasC credentials contain the literal text `${GITHUB_TOKEN}` instead of the valueAdvancedKubernetes plugin: `Failure executing: POST at: https://10.96.0.1/api/v1/namespaces/jenkins-agents/pods. Message: pods is forbidden: User "system:serviceaccount:jenkins:jenkins" cannot create resource "pods" in API group "" in the namespace "jenkins-agents".`Beginner