Interview Prep/Jenkins/Agents, executors & the queue

Agent connects but builds fail with `java.io.IOException: Cannot run program "nohup" (in directory "C:\jenkins\workspace\app"): CreateProcess error=2`

BeginnerTroubleshootingAgents, executors & the queue
Answer

Likely causes → A sh step is running on a Windows agent.

Diagnose → Check which node ran the step (NODE_NAME) and the label used.

Fix → Use bat or powershell on Windows, or branch with if (isUnix()) { sh ... } else { bat ... }; fix label expressions so Linux steps go to Linux agents.

Prevent → Explicit OS labels on every agent and in every pipeline.

All Jenkins questions Roadmap: Jenkins

More on Agents, executors & the queue