jenkinsci / jenkinsci/git-plugin

[JENKINS-24125] Git Polling fails for job restricted to Mac OS X slave (with Windows master)

Open
#2,509 9 comments 0 reactions 0 assignees View on GitHub
component:git-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
694
Forks
1.1k
Avg merge
1h 29m
Merged PRs (30d)
3

Description

I have defined two installations of git on our Windows master node:

Default: git.exe (found in the PATH)

Mac: /usr/local/bin/git (not found in the PATH)

I have certain jobs that must run on a Mac. For those jobs, I have selected "Mac" for the git executable.

When those jobs try to poll github for changes, they get errors like this:

Started on Aug 5, 2014 6:38:03 PM

Using strategy: Default

[poll] Last Built Revision: Revision 33ce43e454fd2447f548f18dc3bc404ff1a2b021 (origin/release)

> /usr/local/bin/git ls-remote -h git@​github.com:everyscape/Mobile.git release # timeout=10

FATAL: hudson.plugins.git.GitException: Error performing command: /usr/local/bin/git ls-remote -h git@​github.com:everyscape/Mobile.git release

hudson.util.IOException2: hudson.plugins.git.GitException: Error performing command: /usr/local/bin/git ls-remote -h git@​github.com:everyscape/Mobile.git release

at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:459)

at hudson.scm.SCM._compareRemoteRevisionWith(SCM.java:357)

at hudson.scm.SCM.poll(SCM.java:374)

...

Caused by: hudson.plugins.git.GitException: Error performing command: /usr/local/bin/git ls-remote -h git@​github.com:everyscape/Mobile.git release

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1414)

...

Caused by: java.io.IOException: Cannot run program "/usr/local/bin/git": CreateProcess error=2, The system cannot find the file specified

at java.lang.ProcessBuilder.start(Unknown Source)

...

Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified

at java.lang.ProcessImpl.create(Native Method)

...

I presume this fails because it is looking for /usr/local/bin/git on the Windows master node.

When I manually build the job with that configuration - git works fine.

If I switch the job's configuration to use the "Default" git executable (git.exe), then polling works fine, but when the job tries to run on the Mac then the git commands fail (since git.exe is not found on the Mac).

So, until this issue is resolved somehow, either

a) no jobs are started automatically, but they all build successfully when launched manually, or

b) jobs are started automatically - but then they all fail to build.

The job in question clones a specific branch of a repository from github.

It is restricted to work on a slave node with the label of "iOS".

There is a mac slave node with that label.

We are running the latest LTS version (1.565.1) of Jenkins on a Windows server.

FYI - this behavior worked fine on an older (1.x) version of this plugin.

Thanks,

Chuck

---
Originally reported by cdoucette, imported from: Git Polling fails for job restricted to Mac OS X slave (with Windows master)


  • status: Open
  • priority: Major
  • component(s): git-plugin
  • resolution: Unresolved
  • votes: 1
  • watchers: 5
  • imported: 2025-12-02

Raw content of original issue

I have defined two installations of git on our Windows master node:
Default: git.exe (found in the PATH)
Mac: /usr/local/bin/git (not found in the PATH)

I have certain jobs that must run on a Mac. For those jobs, I have selected "Mac" for the git executable.

When those jobs try to poll github for changes, they get errors like this:
Started on Aug 5, 2014 6:38:03 PM
Using strategy: Default
[poll] Last Built Revision: Revision 33ce43e454fd2447f548f18dc3bc404ff1a2b021 (origin/release)
> /usr/local/bin/git ls-remote -h git@github.com:everyscape/Mobile.git release # timeout=10
FATAL: hudson.plugins.git.GitException: Error performing command: /usr/local/bin/git ls-remote -h git@github.com:everyscape/Mobile.git release
hudson.util.IOException2: hudson.plugins.git.GitException: Error performing command: /usr/local/bin/git ls-remote -h git@github.com:everyscape/Mobile.git release
at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:459)
at hudson.scm.SCM._compareRemoteRevisionWith(SCM.java:357)
at hudson.scm.SCM.poll(SCM.java:374)
...
Caused by: hudson.plugins.git.GitException: Error performing command: /usr/local/bin/git ls-remote -h git@github.com:everyscape/Mobile.git release
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1414)
...
Caused by: java.io.IOException: Cannot run program "/usr/local/bin/git": CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(Unknown Source)
...
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
...

I presume this fails because it is looking for /usr/local/bin/git on the Windows master node.
When I manually build the job with that configuration - git works fine.
If I switch the job's configuration to use the "Default" git executable (git.exe), then polling works fine, but when the job tries to run on the Mac then the git commands fail (since git.exe is not found on the Mac).

So, until this issue is resolved somehow, either
a) no jobs are started automatically, but they all build successfully when launched manually, or
b) jobs are started automatically - but then they all fail to build.

The job in question clones a specific branch of a repository from github.
It is restricted to work on a slave node with the label of "iOS".
There is a mac slave node with that label.
We are running the latest LTS version (1.565.1) of Jenkins on a Windows server.

FYI - this behavior worked fine on an older (1.x) version of this plugin.

Thanks,
Chuck

  • environment: Windows master, Mac slave

2 attachments

- [GitPollingLog.txt](https://raw.githubusercontent.com/jenkinsci/attachments-from-jira-issues-misc/refs/heads/main/attachments/26485/GitPollingLog.txt)
- [Mobile-iOS-develop-config.xml](https://raw.githubusercontent.com/jenkinsci/attachments-from-jira-issues-last/refs/heads/main/attachments/26486/Mobile-iOS-develop-config.xml)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.