Interview Prep/CI/CD/Jenkins Build and Agent Failures

`Agent went offline during the build` / `ChannelClosedException`.

AdvancedTroubleshootingJenkins Build and Agent Failures
Answer

Likely causes → Agent OOM-killed or rebooted; spot instance reclaimed; network drop; pod evicted.

Diagnose →

journalctl -u jenkins-agent --since "1 hour ago"
dmesg -T | grep -i 'killed process'
kubectl describe pod <agent-pod>   # look for OOMKilled / Evicted

Fix → Increase memory limits, use on-demand nodes for critical builds, retry on agent loss with retry(conditions: [agent()]).

Prevent → Set requests/limits sensibly and monitor node memory.

All CI/CD questions Roadmap: CI/CD fundamentals

More on Jenkins Build and Agent Failures