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

Mercurial plugin cannot clone from repository on remote file system

      We use Mercurial for source control and have a central repository located on a server on the network that we access directly via the file system. I realize that this is not the recommended setup (ssh or https is preferred), but being on the LAN, the security concerns are not an issue.

      The problem I have is that the following command WORKS from the command line:
      hg clone \\MACHINENAME\Path\To\Repo

      ... but when I configure the Mercurial plugin to use this path, I get the following error:

      Building in workspace C:\Program Files (x86)\Jenkins\workspace\TestProject
      $ "C:\Program Files\TortoiseHG\hg.exe" --debug clone --rev default --noupdate \\MACHINENAME\Path\To\Repo "C:\Program Files (x86)\Jenkins\workspace\TestProject"
      abort: repository \\MACHINENAME\Path\To\Repo not found!
      ERROR: Failed to clone \\MACHINENAME\Path\To\Repo
      ERROR: Failed to clone \\MACHINENAME\Path\To\Repo
      Finished: FAILURE

      I have of course replaced the paths. I have tried every combination of \ and / possible. However the fact that it works from the command-line and not from the plug-in makes me think it's a bug with the plug-in.

      Is there a way to do what I'm trying to do without setting up SSH or HTTPS access to the repo?

          [JENKINS-16691] Mercurial plugin cannot clone from repository on remote file system

          Jesse Glick added a comment -

          Did you try file://MACHINENAME/Path/To/Repo/ as the repository location?

          Are you positive you are using the same version of Mercurial from Jenkins as you are on the command line? The plugin is forking Mercurial so it should accept the same syntax, but getting backslashes and quotes right when executing commands on Windows can be tricky.

          Jesse Glick added a comment - Did you try file://MACHINENAME/Path/To/Repo/ as the repository location? Are you positive you are using the same version of Mercurial from Jenkins as you are on the command line? The plugin is forking Mercurial so it should accept the same syntax, but getting backslashes and quotes right when executing commands on Windows can be tricky.

          Zamir Khan added a comment - - edited

          Thanks for the quick response! When I try using the file:// URL, I get (both via Jenkins and command-line):

          abort: file:// URLs can only refer to localhost

          The repository is on a remote machine. Yes, I am sure they are using the same version of hg.exe, since there is only one installed on my machine.

          Zamir Khan added a comment - - edited Thanks for the quick response! When I try using the file:// URL, I get (both via Jenkins and command-line): abort: file:// URLs can only refer to localhost The repository is on a remote machine. Yes, I am sure they are using the same version of hg.exe, since there is only one installed on my machine.

          Jesse Glick added a comment -

          Did you try typing in the exact command run by the plugin as reported in the build console?

          Jesse Glick added a comment - Did you try typing in the exact command run by the plugin as reported in the build console?

          Zamir Khan added a comment -

          Yes, I just checked this again now. Here is the full, un-edited command, that works from the command-line:

          "C:\Program Files\TortoiseHG\hg.exe" --debug clone --rev default --noupdate \\GIBBS\Work\Repository\SonIO2008\ "C:\Program Files (x86)\Jenkins\workspace\SonioTest"

          Note that I had to run this from an "elevated" (Run as Administrator) command window, but I don't think that is the problem, because it gave me an "Access Denied" message as the error when I failed to do this (for accessing the Program Files directory).

          Zamir Khan added a comment - Yes, I just checked this again now. Here is the full, un-edited command, that works from the command-line: "C:\Program Files\TortoiseHG\hg.exe" --debug clone --rev default --noupdate \\GIBBS\Work\Repository\SonIO2008\ "C:\Program Files (x86)\Jenkins\workspace\SonioTest" Note that I had to run this from an "elevated" (Run as Administrator) command window, but I don't think that is the problem, because it gave me an "Access Denied" message as the error when I failed to do this (for accessing the Program Files directory).

          Jesse Glick added a comment -

          Maybe a difference in user permissions for the user running the Jenkins service. No other ideas.

          Jesse Glick added a comment - Maybe a difference in user permissions for the user running the Jenkins service. No other ideas.

          Zamir Khan added a comment -

          That was totally it! The "repository ... not found" was a bit of a red herring. I gave the Jenkins Windows service my log on credentials (an administrator account) and it worked. Thanks!

          Zamir Khan added a comment - That was totally it! The "repository ... not found" was a bit of a red herring. I gave the Jenkins Windows service my log on credentials (an administrator account) and it worked. Thanks!

          Jesse Glick added a comment -

          Good to hear!

          Jesse Glick added a comment - Good to hear!

            jglick Jesse Glick
            zkhan Zamir Khan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: