Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-63535

Git tool chooser ignores node-specific tool locations

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • git-plugin
    • None
    • Jenkins 2.235.5
      git-plugin 4.4.0
    • git plugin 4.4.2

      The git tool chooser appears to be ignoring node-specific tool configurations.

      In the Global Tool Configuration, we have a Git tool (Default) configured as git.exe, as we run Jenkins on Windows. On a macOS node, we have the same tool configured as /usr/local/bin/git.

      When running a pipeline build with the Git plugin's "Disable performance enhancements" checked, it successfully uses /usr/local/bin/git. However, when unchecked, the git tool chooser tries to use git.exe, which doesn't work on the macOS node. I would expect the node-specific tool configuration to override the global tool configuration in this case.

       

      Sample error:

       

      The recommended git tool is: git.exe

      using credential *******
      {{ > git.exe rev-parse --is-inside-work-tree # timeout=10}}
      ERROR: Workspace has a .git repository, but it appears to be corrupt.
      hudson.plugins.git.GitException: Error performing git command: git.exe rev-parse --is-inside-work-tree
      {{ at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2457)}}
      {{ at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2380)}}
      {{ at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2376)}}
      {{ at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1923)}}
      {{ at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1935)}}
      {{ at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.hasGitRepo(CliGitAPIImpl.java:347)}}
      {{ at hudson.plugins.git.GitAPI.hasGitRepo(GitAPI.java:235)}}

      <...more...>

      Caused by: java.io.IOException: Cannot run program "git.exe" (in directory "/Users/user/jenkins/workspace/test-job"): error=2, No such file or directory

      <...more...>

            markewaite Mark Waite
            kjcjohnson Keith Johnson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: