Occasional http 500 (KeyError) errors on clone/pull/push

Simon King simon at simonking.org.uk
Thu Nov 28 11:08:03 CST 2013


On Thu, Nov 28, 2013 at 4:16 PM, Bruce Cran <bruce at cran.org.uk> wrote:
> We have a rather busy Mercurial server (2.3.2 due the need to support old
> clients)

I'm curious about this comment - old clients should be able to talk to
new server versions without problems. Or are you relying on thirdparty
extensions which don't work with the newer versions?

> which uses hgweb.wsgi (with Apache) with just over 200
> repositories. We've been finding that occasionally a clone/pull/push will
> error out with an http 500 failure. The error log reports a KeyError such
> as:
>
> mod_wsgi (pid=6391): Exception occurred processing WSGI script
> '/www/sitename/cgi-bin/hgweb.wsgi'.
>
> Traceback (most recent call last):
>   File
> "/usr/local/lib/python2.7/dist-packages/mercurial/hgweb/hgwebdir_mod.py",
> line 147, in __call_
>
>     return self.run_wsgi(req)
>   File
> "/usr/local/lib/python2.7/dist-packages/mercurial/hgweb/hgwebdir_mod.py",
> line 205, in run_wsg
>
>     return hgweb(repo).run_wsgi(req)
>   File
> "/usr/local/lib/python2.7/dist-packages/mercurial/hgweb/hgweb_mod.py", line
> 128, in run_wsgi
>     return protocol.call(self.repo, req, cmd)
>   File "/usr/local/lib/python2.7/dist-packages/mercurial/hgweb/protocol.py",
> line 76, in call
>     rsp = wireproto.dispatch(repo, p, cmd)
>   File "/usr/local/lib/python2.7/dist-packages/mercurial/wireproto.py", line
> 351, in dispatch
>     return func(repo, proto, *args)
>   File "/usr/local/lib/python2.7/dist-packages/mercurial/wireproto.py", line
> 373, in batch
>     func, spec = commands[op]
> KeyError: 'lheads'
>
> Usually the error isn't repeatable, so can be worked around by just doing
> another clone/pull/push. Sometimes though, the error happens repeatedly for
> a while.
>
> Has anyone come across this before, and is there a fix/workaround?
>

A quick grep of the source code suggests that the 'lheads' command is
part of the largefiles extension. Do you have largefiles enabled on
some repositories and not others? Perhaps a client using largefiles is
somehow connecting to an hgweb instance that isn't configured for it.

Simon


More information about the Mercurial mailing list