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

git polling results exception because ssh is not found

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: git-plugin
    • Labels:
      None
    • Environment:
      Ubuntu 12.04, jenkins 1.565.1, git plugin 2.2.5, git client plugin 1.10.1
    • Similar Issues:

      Description

      This happens after jenkins server is upgraded. Only some git repositories have this issue. jenkins git polling of other repositories on the same server works fine.

      Using strategy: Default
      [poll] Last Built Revision: Revision ca82a6dff817ec66f44342007202690a93763949 (refs/remotes/origin/master)
      > git ls-remote -h ssh://username@host/repository.git master # timeout=10
      FATAL: hudson.plugins.git.GitException: Command "git ls-remote -h ssh://username@host/repository.git master" returned status code 128:
      stdout:
      stderr: error: cannot run ssh: No such file or directory
      fatal: unable to fork

      hudson.util.IOException2: hudson.plugins.git.GitException: Command "git ls-remote -h ssh://username@host/repository.git master" returned status code 128:
      stdout:
      stderr: error: cannot run ssh: No such file or directory
      fatal: unable to fork

      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 hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:477)
      at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:506)
      at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:118)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      at java.lang.Thread.run(Thread.java:679)
      Caused by: hudson.plugins.git.GitException: Command "git ls-remote -h ssh://username@host/repository.git master" returned status code 128:
      stdout:
      stderr: error: cannot run ssh: No such file or directory
      fatal: unable to fork

      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1407)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1195)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1119)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1110)
      at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getHeadRev(CliGitAPIImpl.java:2004)
      at hudson.plugins.git.GitSCM.compareRemoteRevisionWithImpl(GitSCM.java:495)
      at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:460)
      ... 13 more
      Done. Took 0.78 sec

        Attachments

          Activity

          Hide
          markewaite Mark Waite added a comment - - edited

          That stack trace seems to indicate that those jobs cannot find "ssh" when "git" is trying to call it. We just had a bug report JENKINS-24467 which may be related.

          Was there a preceding job for the failing job? If so, was the preceding job executed on a different platform?

          Are you using the EnvInject plugin? If so, could you insert a step in the build which reports the value of the PATH environment variable and post its value here?

          If you revert to git plugin 2.2.4 does it resolve the issue? The fix for JENKINS-22009 (as mentioned in JENKINS-24467) is first included in git plugin 2.2.5.

          Show
          markewaite Mark Waite added a comment - - edited That stack trace seems to indicate that those jobs cannot find "ssh" when "git" is trying to call it. We just had a bug report JENKINS-24467 which may be related. Was there a preceding job for the failing job? If so, was the preceding job executed on a different platform? Are you using the EnvInject plugin? If so, could you insert a step in the build which reports the value of the PATH environment variable and post its value here? If you revert to git plugin 2.2.4 does it resolve the issue? The fix for JENKINS-22009 (as mentioned in JENKINS-24467 ) is first included in git plugin 2.2.5.
          Hide
          allanlei Allan Lei added a comment - - edited

          I had a very similar problem getting "ssh: not found" when it was doing github polling. This also happened around the time Jenkins was upgraded to 1.579 along with the git plugin, but not sure which one caused it.

          Downgrading the git plugin from 2.2.5 to 2.2.4 solved the problem.

          Ubuntu 14.04
          Jenkins: 1.579
          Git client: 1.10.1
          EnvInject: 1.89

          Show
          allanlei Allan Lei added a comment - - edited I had a very similar problem getting "ssh: not found" when it was doing github polling. This also happened around the time Jenkins was upgraded to 1.579 along with the git plugin, but not sure which one caused it. Downgrading the git plugin from 2.2.5 to 2.2.4 solved the problem. Ubuntu 14.04 Jenkins: 1.579 Git client: 1.10.1 EnvInject: 1.89
          Hide
          markewaite Mark Waite added a comment -

          Allan Lei can you provide answers to the same questions that were asked of the original person who reported the problem? Specifically:

          Was there a preceding job for the failing job? If so, was the preceding job executed on a different platform?

          Show
          markewaite Mark Waite added a comment - Allan Lei can you provide answers to the same questions that were asked of the original person who reported the problem? Specifically: Was there a preceding job for the failing job? If so, was the preceding job executed on a different platform?
          Hide
          jccheng0108 Jesse Cheng added a comment -

          Reverting to git plugin 2.0 (my installed version before upgrade) resolved the issue.
          There was no preceding job.

          Show
          jccheng0108 Jesse Cheng added a comment - Reverting to git plugin 2.0 (my installed version before upgrade) resolved the issue. There was no preceding job.
          Hide
          allanlei Allan Lei added a comment -

          Was there a preceding job for the failing job? If so, was the preceding job executed on a different platform?

          This problem didn't cause failing jobs as it was not triggering jobs at all. It was failing when there was a github webhook and scheduled git polling. Yes there were preceding jobs. Yes, it was executed on a Windows 7 slave node launched via Java Web Start.

          Are you using the EnvInject plugin? If so, could you insert a step in the build which reports the value of the PATH environment variable and post its value here?

          Yes, 1.89. I will have to try out the PATH env at a later time.

          Master Node (Ubuntu 14.04, Jenkins 1.579, git 2.2.5, envinject 1.89)
          Slave Node (Windows 7, via Java Web start)

          Things I tried/observed:

          • After upgrading to git plugin 2.2.5 and Jenkins 1.579, this problem did not initially happen, and everything worked as expected.
          • I had 3 separate jobs building from the same git repo, but with a different build script(production, staging, development). After the upgrades, I changed the credentials for development and staging jobs. Those jobs had an error in the build script which caused the job to fail. At this time, git polling for these 2 jobs will result in this error, but the production job still polled correctly. Jobs duplicated from the production job will work correctly until there's a build error.
          • Copied the ssh*.sh and ssh*key files that are generated from "git ls-remote -h ...", set GIT_SSH to ssh*.sh and ran it as the jenkins process user successfully
          • Manually triggering a build via Build Now button works fine
          Show
          allanlei Allan Lei added a comment - Was there a preceding job for the failing job? If so, was the preceding job executed on a different platform? This problem didn't cause failing jobs as it was not triggering jobs at all. It was failing when there was a github webhook and scheduled git polling. Yes there were preceding jobs. Yes, it was executed on a Windows 7 slave node launched via Java Web Start. Are you using the EnvInject plugin? If so, could you insert a step in the build which reports the value of the PATH environment variable and post its value here? Yes, 1.89. I will have to try out the PATH env at a later time. Master Node (Ubuntu 14.04, Jenkins 1.579, git 2.2.5, envinject 1.89) Slave Node (Windows 7, via Java Web start) Things I tried/observed: After upgrading to git plugin 2.2.5 and Jenkins 1.579, this problem did not initially happen, and everything worked as expected. I had 3 separate jobs building from the same git repo, but with a different build script(production, staging, development). After the upgrades, I changed the credentials for development and staging jobs. Those jobs had an error in the build script which caused the job to fail. At this time, git polling for these 2 jobs will result in this error, but the production job still polled correctly. Jobs duplicated from the production job will work correctly until there's a build error. Copied the ssh*.sh and ssh*key files that are generated from "git ls-remote -h ...", set GIT_SSH to ssh*.sh and ran it as the jenkins process user successfully Manually triggering a build via Build Now button works fine
          Hide
          markewaite Mark Waite added a comment -

          The change from Rob Langley is now on the master branch and the 2.2.x branch and should be in the git plugin 2.2.6 release.

          Show
          markewaite Mark Waite added a comment - The change from Rob Langley is now on the master branch and the 2.2.x branch and should be in the git plugin 2.2.6 release.
          Hide
          markewaite Mark Waite added a comment -

          Fixed in git plugin 2.2.6, released 20 Sep 2014

          Show
          markewaite Mark Waite added a comment - Fixed in git plugin 2.2.6, released 20 Sep 2014

            People

            • Assignee:
              ndeloof Nicolas De Loof
              Reporter:
              jccheng0108 Jesse Cheng
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: