• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • mercurial-plugin
    • None
    • Master: Windows
      Slave: Ubuntu 12.04 or MacOS X 10.7

      1. Install a master node and slave node.
      2. Invoke a task on the slave with Mercurial "repository caching" enabled.
      3. I get this output:
      $ /usr/local/bin/hg clone --noupdate <repository> C:\Users\Gili\.jenkins\hgcache\37CF2BD3BA29C01DED84F6376395B553ABB57E93-vtlr
      ERROR: Failed to use repository cache for <repository>
      java.io.IOException: Cannot run program "/usr/local/bin/hg": CreateProcess error=2, The system cannot find the file specified
      	at java.lang.ProcessBuilder.start(Unknown Source)
      	at hudson.Proc$LocalProc.<init>(Proc.java:244)
      	at hudson.Proc$LocalProc.<init>(Proc.java:216)
      	at hudson.Launcher$LocalLauncher.launch(Launcher.java:709)
      	at hudson.Launcher$ProcStarter.start(Launcher.java:338)
      	at hudson.Launcher$ProcStarter.join(Launcher.java:345)
      	at hudson.plugins.mercurial.MercurialSCM.joinWithPossibleTimeout(MercurialSCM.java:309)
      	at hudson.plugins.mercurial.Cache.repositoryCache(Cache.java:103)
      	at hudson.plugins.mercurial.MercurialSCM.cachedSource(MercurialSCM.java:687)
      	at hudson.plugins.mercurial.MercurialSCM.clone(MercurialSCM.java:558)
      	at hudson.plugins.mercurial.MercurialSCM.checkout(MercurialSCM.java:390)
      	at hudson.model.AbstractProject.checkout(AbstractProject.java:1256)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:589)
      	at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:494)
      	at hudson.model.Run.execute(Run.java:1502)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      	at hudson.model.ResourceController.execute(ResourceController.java:88)
      	at hudson.model.Executor.run(Executor.java:236)
      Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
      	at java.lang.ProcessImpl.create(Native Method)
      	at java.lang.ProcessImpl.<init>(Unknown Source)
      	at java.lang.ProcessImpl.start(Unknown Source)
      	... 19 more
      $ /usr/local/bin/hg clone --rev default --noupdate <repository> <workspace>
      adding changesets
      adding manifests
      adding file changes
      added 5 changesets with 154 changes to 103 files
      ...snip...
      

      I see two problems with this output:

      1. The "hgcache" path being defined relative to the master node's root directory instead of the root directory of the slave. There is no way this will work.
      2. ProcessBuilder complains it can't run "/usr/local/bin/hg" because "The system cannot find the file specified". I believe it finds "hg" because I've confirmed the path exists and the log clearly shows "hg clone" working. Please modify the code to output more verbose information (what is the working directory and full path associated with ProcessBuilder?)

          [JENKINS-15001] Repository cache is wrong on slave nodes

          cowwoc added a comment -

          Update: I can reproduce this problem under Ubuntu 12.04 as well!

          cowwoc added a comment - Update: I can reproduce this problem under Ubuntu 12.04 as well!

          Johannes W added a comment -

          I can confirm this bug the other way round (Debian GNU/Linux 7.0 Master, Windows 7 Slave).

          Johannes W added a comment - I can confirm this bug the other way round (Debian GNU/Linux 7.0 Master, Windows 7 Slave).

          Ilya Lebedev added a comment -

          I can confirm this bug as well.
          Master CentOS 5.9
          Slave Windows 7

          Looks like this is common issue when you have
          different OS on Slave and Master

          Ilya Lebedev added a comment - I can confirm this bug as well. Master CentOS 5.9 Slave Windows 7 Looks like this is common issue when you have different OS on Slave and Master

          Tiago Marques added a comment -

          Any updates on this?
          Having same issue with docker image of jenkins and windows 8.1 slave.

          Tiago Marques added a comment - Any updates on this? Having same issue with docker image of jenkins and windows 8.1 slave.

          Johannes W added a comment -

          I now have a workaround for this: It works when no absolute path is used for hg in the master and all slaves, so just "hg" instead of "/usr/local/bin/hg" or "C:\Program Files\TortoiseHg\hg.exe". Of course that means every slave needs to have "hg" in the PATH.

          This of course does not mean that this bug is fixed.

          Johannes W added a comment - I now have a workaround for this: It works when no absolute path is used for hg in the master and all slaves, so just "hg" instead of "/usr/local/bin/hg" or "C:\Program Files\TortoiseHg\hg.exe". Of course that means every slave needs to have "hg" in the PATH. This of course does not mean that this bug is fixed.

          loyal parsons added a comment -

          I'm seeing the same issue with:

          Master: Windows Server 2016

          Slave: Windows 2008 R2

           

          loyal parsons added a comment - I'm seeing the same issue with: Master: Windows Server 2016 Slave: Windows 2008 R2  

            kohsuke Kohsuke Kawaguchi
            cowwoc cowwoc
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: