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

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: mercurial-plugin
    • Labels:
      None
    • Environment:
    • Similar Issues:

      Description

      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

        Attachments

          Activity

          Hide
          dogfood dogfood added a comment -

          Integrated in plugins_mercurial #81
          JENKINS-11877 Don't attempt changelog calculation if clone/update failed

          david :
          Files :

          • src/main/java/hudson/plugins/mercurial/MercurialSCM.java
          Show
          dogfood dogfood added a comment - Integrated in plugins_mercurial #81 JENKINS-11877 Don't attempt changelog calculation if clone/update failed david : Files : src/main/java/hudson/plugins/mercurial/MercurialSCM.java
          Hide
          davidmc24 davidmc24 added a comment -

          The following pull request for core should address another possible form of this problem.

          https://github.com/jenkinsci/jenkins/pull/323

          Show
          davidmc24 davidmc24 added a comment - The following pull request for core should address another possible form of this problem. https://github.com/jenkinsci/jenkins/pull/323
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: David M. Carr
          Path:
          src/main/java/hudson/plugins/mercurial/MercurialSCM.java
          http://jenkins-ci.org/commit/mercurial-plugin/2fff702a0494aa7ecf220dcdac10454cb8ae3b08
          Log:
          JENKINS-11877 Improve error message when hg cannot be found

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: David M. Carr Path: src/main/java/hudson/plugins/mercurial/MercurialSCM.java http://jenkins-ci.org/commit/mercurial-plugin/2fff702a0494aa7ecf220dcdac10454cb8ae3b08 Log: JENKINS-11877 Improve error message when hg cannot be found
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: David M. Carr
          Path:
          src/main/java/hudson/plugins/mercurial/MercurialSCM.java
          http://jenkins-ci.org/commit/mercurial-plugin/e75bd4df0bc492542b7235e7584243e048b41632
          Log:
          [FIXED JENKINS-11877] Use AbortException rather than returning false to indicate checkout failure

          Compare: https://github.com/jenkinsci/mercurial-plugin/compare/f06a86a...e75bd4d

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: David M. Carr Path: src/main/java/hudson/plugins/mercurial/MercurialSCM.java http://jenkins-ci.org/commit/mercurial-plugin/e75bd4df0bc492542b7235e7584243e048b41632 Log: [FIXED JENKINS-11877] Use AbortException rather than returning false to indicate checkout failure Compare: https://github.com/jenkinsci/mercurial-plugin/compare/f06a86a...e75bd4d
          Hide
          dogfood dogfood added a comment -

          Integrated in plugins_mercurial #82
          JENKINS-11877 Improve error message when hg cannot be found
          [FIXED JENKINS-11877] Use AbortException rather than returning false to indicate checkout failure

          david :
          Files :

          • src/main/java/hudson/plugins/mercurial/MercurialSCM.java

          david :
          Files :

          • src/main/java/hudson/plugins/mercurial/MercurialSCM.java
          Show
          dogfood dogfood added a comment - Integrated in plugins_mercurial #82 JENKINS-11877 Improve error message when hg cannot be found [FIXED JENKINS-11877] Use AbortException rather than returning false to indicate checkout failure david : Files : src/main/java/hudson/plugins/mercurial/MercurialSCM.java david : Files : src/main/java/hudson/plugins/mercurial/MercurialSCM.java

            People

            • Assignee:
              davidmc24 davidmc24
              Reporter:
              vgrichina Vladimir Grichina
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: