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

Jenkins fails to run "hg" command even though the path to it is specified correctly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • mercurial-plugin
    • None

      Jenkins fails to run "hg" command. Mercurial is installed as /usr/local/bin/hg, Jenkins fails to find it both when given full path and when given just "hg". Outside of Jenkins it works fine.

      Here's a stack trace:

      Started by user vg
      $ hg clone --rev default https://bitbucket.org/vgrichina/aqgridview /Users/vg/.jenkins/workspace/AQGridView-hg
      ERROR: Failed to clone https://bitbucket.org/vgrichina/aqgridview
      java.io.IOException: Cannot run program "hg": error=2, No such file or directory
      at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
      at hudson.Proc$LocalProc.<init>(Proc.java:244)
      at hudson.Proc$LocalProc.<init>(Proc.java:216)
      at hudson.Launcher$LocalLauncher.launch(Launcher.java:707)
      at hudson.Launcher$ProcStarter.start(Launcher.java:338)
      at hudson.Launcher$ProcStarter.join(Launcher.java:345)
      at hudson.plugins.mercurial.MercurialSCM.clone(MercurialSCM.java:577)
      at hudson.plugins.mercurial.MercurialSCM.checkout(MercurialSCM.java:422)
      at hudson.model.AbstractProject.checkout(AbstractProject.java:1195)
      at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:568)
      at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:457)
      at hudson.model.Run.run(Run.java:1404)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:230)
      Caused by: java.io.IOException: error=2, No such file or directory
      at java.lang.UNIXProcess.forkAndExec(Native Method)
      at java.lang.UNIXProcess.<init>(UNIXProcess.java:53)
      at java.lang.ProcessImpl.start(ProcessImpl.java:91)
      at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
      ... 14 more

            davidmc24 davidmc24
            vgrichina Vladimir Grichina
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: