Git Client Plugin 6.1.2 cannot find git in PATH on Jenkins 2.492.1

Greetings! I have a Jenkins 2.492.1 setup on K8s cluster with Git Client plugin 6.1.2 installed.
However, I am seeing an error in “Manage Jenkins->Tools” under “Git Installation” section: with “git” as in the text field “Path to Git Executable”, there is a red line of error message saying “There’s no such executable git in PATH: /opt/bitnami/common/bin, /opt/bitnami/java/bin, /usr/local/sbin, /usr/local/bin, /usr/sbin, /usr/bin, /sbin, /bin.”. However, if I ssh into the agent build agent, I can run command “git --version” with output 2.43.0; if I ran command “which git”, I get “/usr/bin/git”. I also verified that Jenkins server can connect to the build agent through SSH successfully. I have another Jenkins K8s setup with version 2.462.3 and Git client plugin 5.02, it doesn’t get the error. According to Git client, Git client plugin 6.1.2 should support both Jenkins 2.492.1 and Git 2.43.0. Appreciate it if any expert can help. Thanks.

That message indicates that the Jenkins controller cannot find command line git in the directories defined in the PATH environment variable.

In most cases, the agent is a different computer than the controller and has different software installed than the controller. Your check shows that the agent has command line git installed, but that doesn’t help the controller. The controller needs command line git installed for those cases where the controller needs to clone a repository, like Jenkins Pipelines that are stored in a git repository.

An alternate way to check for command line git on the controller is to use “Manage Jenkins” → “Script Console” to run the following system groovy script:

println "git --version".execute().text

On my system based on the Jenkins container image jenkins/jenkins:2.492.1-slim-jdk21 the output is:

git version 2.39.5

HI! Mark,

Thanks for the help. By running println “git --version”.execute().text, it reported git command not found.

Since my jenkins was deployed in azure K8s cluster, I was able to find that git command was actually missing from the node image of AKS; and according to AKS node image release notes, git command should be a pre-installed package.

So, I created a support request with Microsoft seeking their help on missing git command installation in AKS node image.

Will keep you posted on eventually how it does.

thanks for the help.