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

Git tool chooser ignores node-specific tool locations

    • 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...>

          [JENKINS-63535] Git tool chooser ignores node-specific tool locations

          Mark Waite added a comment -

          I believe this is a duplicate of JENKINS-63519. Thanks for reporting it kjcjohnson. Workaround is to disable the performance improvements.

          rishabhbudhouliya plans to work on JENKINS-63519 soon.

          Mark Waite added a comment - I believe this is a duplicate of JENKINS-63519 . Thanks for reporting it kjcjohnson . Workaround is to disable the performance improvements. rishabhbudhouliya plans to work on JENKINS-63519 soon.

          Mark Waite added a comment -

          A fix is in progress in PR-949. We'd love to have additional testing to confirm that the fix handles all the cases where issues are being encountered. I've uploaded a pre-release build as git-4.4.2-rc4027.193b7e5f6521.hpi . If your installation allows it, could you confirm that it resolves the issue you're seeing? If you encounter any problems with that pre-release build, please report them in PR-949.

          Mark Waite added a comment - A fix is in progress in PR-949 . We'd love to have additional testing to confirm that the fix handles all the cases where issues are being encountered. I've uploaded a pre-release build as git-4.4.2-rc4027.193b7e5f6521.hpi . If your installation allows it, could you confirm that it resolves the issue you're seeing? If you encounter any problems with that pre-release build, please report them in PR-949 .

          Keith Johnson added a comment -

          Yep, that pre-release build fixes the issue I was seeing here. Thanks!

          Keith Johnson added a comment - Yep, that pre-release build fixes the issue I was seeing here. Thanks!

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

              Created:
              Updated:
              Resolved: