Mercurial Clone – abort: HTTP Error 500: Internal Server Error

When running Mercurial version 2.6.3 on my remote repo hosted over Apache, I could browse, download tar, view tags etc. but when cloning, consistently got a 500 error.

C:\Users\Rob\Documents> hg clone http://myserver.com/myrepo/ LocalWorkspace
http authorization required
realm: Mercurial Repository
user: ****
password:
requesting all changes
abort: HTTP Error 500: Internal Server Error

My Apache logs were just as useful:

[Sun Sep 29 09:52:34 2013] [error] [client 10.0.0.1] malformed header from script. Bad header=5 changesets found: hgweb.cgi

It turns out, it was a bug in Mercurial caused by the verbose flag on the remote end; editing my hgweb.cgi’s hgrc configuration and adding this line solved the problem.

[ui]
# Fix for 500 error on http clone
verbose=false

Leave a Reply