Git Plugin ignores agent local tool definition

Article ID:360030059171
1 minute readKnowledge base

Issue

There was a regression in Git Plugin version 3.9.2 where Git tool locations configured for an agent are no longer being honored.

For example you may have /usr/bin/git configured in your Global Tool Configuration, but you have changed the Tool Locations for your Windows agent. You see an error similar to the following where it is attempting to use the Global Tool Configuration rather than the Tool Locations configured for the agent:

Caused by: java.io.IOException: Cannot run program "/usr/bin/git" (in directory "E:\workspace\Pipeline"): CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(Unknown Source)
at hudson.Proc$LocalProc.<init>(Proc.java:249)
at hudson.Proc$LocalProc.<init>(Proc.java:218)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:935)
at hudson.Launcher$ProcStarter.start(Launcher.java:454)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2012)

Resolution

  • Upgrade the Git Plugin to 3.9.3 or greater.

This article is part of our Knowledge Base and is provided for guidance-based purposes only. The solutions or workarounds described here are not officially supported by CloudBees and may not be applicable in all environments. Use at your own discretion, and test changes in a safe environment before applying them to production systems.