Jenkins console shows `sh: 1: mvn: not found` on one agent only.
BeginnerTroubleshootingJenkins Build and Agent Failures
Answer
Likely causes → Maven is not installed or not on PATH for that agent; the tools {} block is missing; the agent runs a non-login shell.
Diagnose →
ssh agent-b 'which mvn; echo $PATH; mvn -v'
Compare with a working agent, and check the node's "Tool Locations".
Fix → Declare tools { maven 'M3' } in the Jenkinsfile, or run the stage in a Maven container image.
Prevent → Build agents from one image or Packer template so tools are identical everywhere.
More on Jenkins Build and Agent Failures
`java.lang.NoSuchMethodError: No such DSL method 'xyz' found among steps`.Beginner`WorkflowScript: 12: Expected a step @ line 12, column 5.` in a Declarative pipeline.Beginner`hudson.AbortException: script returned exit code 1` with nothing useful above it.BeginnerBuild hangs at "Waiting for next available executor" even though agents look idle.Beginner`Cannot run program "nohup" (in directory ...): error=2, No such file or directory` on a Windows agent.IntermediateBuild fails with `java.io.NotSerializableException: java.util.regex.Matcher`.Advanced