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



    • Bug
    • Status: Resolved (View Workflow)
    • Minor
    • Resolution: Fixed
    • 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


        Issue Links


            vgrichina Vladimir Grichina created issue -
            vgrichina Vladimir Grichina made changes -
            Field Original Value New Value
            Priority Blocker [ 1 ] Minor [ 4 ]
            davidmc24 davidmc24 made changes -
            Assignee Kohsuke Kawaguchi [ kohsuke ] davidmc24 [ davidmc24 ]
            scm_issue_link SCM/JIRA link daemon made changes -
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Resolved [ 5 ]
            davidmc24 davidmc24 made changes -
            Fix Version/s current [ 10162 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 142120 ] JNJira + In-Review [ 189983 ]
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-29045 [ JENKINS-29045 ]


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