3

I hope I can get some help here as SO UX is better than Mercurial mail list.

I've been happily using Mercurial at home for years. I am also using it with Bitbucket Cloud for a couple of more serious (but still hobby) projects.

Last year I switched my team at work from SVN (company hosted) to Hg (self-hosted, with the central repo on a network location). We are all in Windows. Since then, we're continuously having problems with severe central repository corruption, which can only be resolved using backup, e.g.:

% hg verify --verbose
repository uses revlog format 1
checking changesets
checking manifests
manifest@92: unknown parent 1 ef0f96d78ab6 of ef0f96d78ab6
manifest@92: reading delta ef0f96d78ab6: integrity check failed on 
 00manifest.i:88
manifest@93: unknown parent 1 e336adb3580b of e336adb3580b
manifest@93: reading delta e336adb3580b: integrity check failed on 00manifest.i:89
manifest@94: reading delta 7243aebd542b: unknown compression type '\x08'
manifest@95: reading delta 899e4507ca01: unpack requires a string argument of length 12
manifest@96: reading delta 12d4d930da4f: Manifest had an entry with a zero-length filename.
...

Some people say we shouldn't use a network share for the central repository, due to problems with locking. Others explain that Mercurial doesn't use those locks, and network shares should work fine, unless there are problems with the file system.

Considering the latter, I wonder if I could somehow debug our installation without asking the company to provide a server for hg. I don't know much about the configuration we are using, but here is what I see. The directory is accessible via a Windows network path: \\domain.com\path\path\our-directory. Inside, we created a directory called root where .hg resides. In .hgrc, the path is accordingly

[paths]
default = \\domain.com\path\path\our-directory\root

Our network directory is backed up (by the company). Hg version is 4.9.

texnic
  • 3,959
  • 4
  • 42
  • 75
  • Not sure if this is exactly a duplicate but there have been other people reporting similar kinds of issues. See also: https://stackoverflow.com/a/6484300/3195477, https://stackoverflow.com/a/24177490/3195477, https://stackoverflow.com/a/6826780/3195477 – StayOnTarget May 06 '19 at 12:04
  • @DaveInCaz, yes, saw those. Thanks for linking (I actually refer to the 3rd one in the question). They are all connected, and not the same. Unfortunately, they are contradicting each other, as I tried to explain in the question. Seems to be a gray zone. – texnic May 06 '19 at 18:55
  • Yes, its all "as clear as mud" :) – StayOnTarget May 06 '19 at 19:04

1 Answers1

0

I have had a similar experience with a similar setup.

First thing to note is that I thought older HG versions definitely did have some problems when run over Windows network file shares, so make sure your version is current. (That was years ago, IIRC, so this may be unlikely to be the root cause of your present issue).

Secondly, in my case these problems seemed to be compounded from running HG from within a virtual machine. Instead I now run an [hg serve][1] instance on a PC which is not virtualized, and hit that with the various HG clients. No more problems.

It appeared that if the connection between the PC running hg serve and the file server was more reliable than from where I ran hg as a client, this avoided the problem. Apparently the HTTP connection hg serve uses to the client is itself more reliable.

I can't say that is a definitive solution because I never found a root cause. But this seems to have avoided any more corruption for quite some time.

Note that hg serve is built right into the standard hg command line tool, you can run it from anywhere easily, and it doesn't have to run on the same server where the physical repository is stored. So in my case I use it quite casually; (obviously) you might need to coordinate with your IT people if you need something more robust.

StayOnTarget
  • 11,743
  • 10
  • 52
  • 81
  • hg serve requires a server; we only have access to a network storage; those are two very different things in the corporate environment – texnic May 03 '19 at 14:36
  • 4
    @texnic hg serve does not require a "server", I just run it on my desktop, or one of the other PCs I use for dev work. I am also in a corporate environment. – StayOnTarget May 03 '19 at 14:43
  • How do other people access hg serve on your computer? Isn't it protected by firewall? What level of control does it require? In any case, thanks for the tip, I'll take a look at this option. However the original question was why the network folder fails / how to debug it. – texnic May 04 '19 at 18:35
  • By default, apparently, hg serve listens on port 8000 and that has worked fine without need to alter any Windows / security / network settings. This is a very carefully controlled IT environment but this has been painless. So for me hg serve is literally zero-configuration. – StayOnTarget May 06 '19 at 11:51
  • I totally understand you want to get to the root cause, but when I had similar problems I never found it (possibly because the IT infrastructure is difficult to navigate. I figured at least suggesting a workaround could be useful. – StayOnTarget May 06 '19 at 12:00
  • Dave, the suggestion is appreciated. I tried it today. Unfortunately, it doesn't work (for me). The address is simply not accessible. Our company uses 3rd party intrusion prevention tools, so not even Windows firewall. Getting an exception is difficult. – texnic May 06 '19 at 18:50