Skip to content
Advertisement

Hg Git Pull Causes Too Many Open Files Error

I have a Mercurial repository that tracks a git repository. It was working ok on Windows 10. Now I moved it to a Mac as a directory, then ran hg reset -Ca just to clean it up. Now I am trying to run hg pull It causes an error like this:

% hg --traceback --verbose pull                                                                                                255 ↵
pulling from git+https://someserver/somerepo.git
Traceback (most recent call last):
  File "/Users/user/.pyenv/versions/2.7.14/lib/python2.7/site-packages/mercurial/scmutil.py", line 154, in callcatch
  File "/Users/user/.pyenv/versions/2.7.14/lib/python2.7/site-packages/mercurial/dispatch.py", line 314, in _runcatchfunc
.....
  File "/Users/user/.pyenv/versions/2.7.14/lib/python2.7/site-packages/dulwich/pack.py", line 1004, in __init__
  File "/Users/user/.pyenv/versions/2.7.14/lib/python2.7/site-packages/dulwich/file.py", line 90, in GitFile
IOError: [Errno 24] Too many open files: '/Users/user/Projects/somerepo/.hg/git/objects/pack/pack-c03bf69ae597535d876f0dd30ddd6458f2c3f1ff.pack'
abort: Too many open files: /Users/user/Projects/somerepo/.hg/git/objects/pack/pack-c03bf69ae597535d876f0dd30ddd6458f2c3f1ff.pack

I checked and it looks like I have latest versions of hg-git and dulwich

dulwich (0.18.6)
hg-git (0.8.10)

Mercurial is also up to date

% hg --version 
Mercurial Distributed SCM (version 4.5)

I checked version of Mercurial on Windows and it is 4.4.2 if that matters. I wonder if anyone had an issue like that and perhaps has a work around or fix.

Advertisement

Answer

What does ulimit -n say on your Mac? This is the limit on the number of open files. Try then running ulimit -n N for some larger N than what it was previously, and run the hg command again.

You may want to put the ulimit -n N command in your ~/.bashrc to run it every time you log in, if you have this problem more than just this once.

Advertisement