I have a jenkins instance which has a windows slave machine attached. I also have a job running which resides in github and I have the trigger - "Build when a change is pushed to GitHub" set.

      as I push a change to github, there is no build triggered on jenkins. I check and see that the payload does get tranferred to jenkins in the "Github hook log" but I get the following error:

      Using strategy: Default
      [poll] Last Built Revision: Revision ce6a183e834a3e31afa0eb83a4418b0619c8642b (origin/master)
      > "C:\Program Files (x86)\Git\cmd\git.exe" ls-remote -h https://xx/xx/xx master # timeout=10
      FATAL: hudson.plugins.git.GitException: Error performing command: "C:\Program Files (x86)\Git\cmd\git.exe" ls-remote -h https://xx/xx/xx master
      hudson.util.IOException2: hudson.plugins.git.GitException: Error performing command: "C:\Program Files (x86)\Git\cmd\git.exe" ls-remote -h https://xx/xx/xx master
      at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:462)
      at hudson.scm.SCM._compareRemoteRevisionWith(SCM.java:357)
      at hudson.scm.SCM.poll(SCM.java:374)
      at hudson.model.AbstractProject._poll(AbstractProject.java:1428)
      at hudson.model.AbstractProject.poll(AbstractProject.java:1331)
      at com.cloudbees.jenkins.GitHubPushTrigger$1.runPolling(GitHubPushTrigger.java:73)
      at com.cloudbees.jenkins.GitHubPushTrigger$1.run(GitHubPushTrigger.java:98)
      at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:118)
      at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:744)
      Caused by: hudson.plugins.git.GitException: Error performing command: "C:\Program Files (x86)\Git\cmd\git.exe" ls-remote -h https://xx/xx/xx master
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1444)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1225)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1138)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1129)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getHeadRev(CliGitAPIImpl.java:2059)
      at hudson.plugins.git.GitSCM.compareRemoteRevisionWithImpl(GitSCM.java:495)
      at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:460)
      ... 13 more
      Caused by: java.io.IOException: Cannot run program ""C:\Program Files (x86)\Git\cmd\git.exe"": error=2, No such file or directory

      Basically complains about not being able to run the command C:\Program Files (x86)\Git\cmd\git.exe" ls-remote -h https://xx/xx/xx master

      But as I manually go into my slave machine and run the command, it works fine.

      Please note that 1. I have made the adjustment where jenkins slave service logs in as admin so that it has all permissions. 2. My default jenkins server is a linux box and the slave machine is a windows box. Obviously both have different git executable path. So I am wondering if jenkins runs this command on my linux box for some reason.

      I do have the project setup to run on the windows slave box only and that works fine as it builds fine(so it is able to find the git executable for the job)

      Any pointers?

      Also does anyone know how github plugin for jenkins works with slave machines(does it look for git in the slave or does it go to where jenkins resides, as that might be the source, though have no idea what the solution for that weird case would be?)

          [JENKINS-24809] Github-Jenkins Trigger issue with slave

          Kuber Kaul created issue -
          Kuber Kaul made changes -
          Assignee Original: Kuber Kaul [ kaulk ] New: R. Tyler Croy [ rtyler ]
          Kuber Kaul made changes -
          Assignee Original: R. Tyler Croy [ rtyler ] New: Kohsuke Kawaguchi [ kktest10 ]

          R. Tyler Croy added a comment -

          I'm going to move this into the JENKINS project, this doesn't appear to have anything to do with the project's own infrastructure

          R. Tyler Croy added a comment - I'm going to move this into the JENKINS project, this doesn't appear to have anything to do with the project's own infrastructure
          R. Tyler Croy made changes -
          Component/s New: github [ 15896 ]
          Component/s Original: github [ 18925 ]
          Key Original: INFRA-140 New: JENKINS-24809
          Project Original: Infrastructure [ 10301 ] New: Jenkins [ 10172 ]
          Workflow Original: jira [ 158030 ] New: JNJira [ 158038 ]

          Kuber Kaul added a comment -

          Thanks!

          Kuber Kaul added a comment - Thanks!

          Kuber Kaul added a comment -

          I tried a work around of adding the "Force polling using workspace" as an "Additional behaviour" in my git SCM definition of the windows job.

          If the poll runs on the Linux node (the master) but somehow decides it needs to use the Windows git configuration to poll the master, that might cause the Linux master to attempt to execute git from the Windows git location, instead of the Linux git location(which is what is happening in my project). That would be a bug, and I was surprised at this bug, since there are many installations of Jenkins git which use a wide mix of Linux and Windows slaves.

          I'm was not aware of such a bug, but since the "Force polling using workspace" resolved the problem for you, it may hint that is an area for more investigation.

          Kuber Kaul added a comment - I tried a work around of adding the "Force polling using workspace" as an "Additional behaviour" in my git SCM definition of the windows job. If the poll runs on the Linux node (the master) but somehow decides it needs to use the Windows git configuration to poll the master, that might cause the Linux master to attempt to execute git from the Windows git location, instead of the Linux git location(which is what is happening in my project). That would be a bug, and I was surprised at this bug, since there are many installations of Jenkins git which use a wide mix of Linux and Windows slaves. I'm was not aware of such a bug, but since the "Force polling using workspace" resolved the problem for you, it may hint that is an area for more investigation.

          Daniel Beck added a comment -

          Seems to be more of a Git plugin issue> Could you provide all relevant Jenkins/plugin version numbers?

          Daniel Beck added a comment - Seems to be more of a Git plugin issue> Could you provide all relevant Jenkins/plugin version numbers?
          Daniel Beck made changes -
          Component/s New: git [ 15543 ]
          Assignee Original: Kohsuke Kawaguchi [ kktest10 ]

          Kuber Kaul added a comment -

          Github plugin - 1.9.1
          Git plugin - 2.2.6
          Jenkins - 1.580

          It does seem like github plugin bug.

          Kuber Kaul added a comment - Github plugin - 1.9.1 Git plugin - 2.2.6 Jenkins - 1.580 It does seem like github plugin bug.

            Unassigned Unassigned
            kaulk Kuber Kaul
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: