The following error is produced when doing a clone hg clone http://myserver/hgwebdir.cgi/media/ destination directory: mediabank requesting all changes ** unknown exception encountered, details follow ** report bug details to http://mercurial.selenic.com/bts/ ** or mercurial@selenic.com ** Mercurial Distributed SCM (version 1.4.2) ** Extensions loaded: win32text, rebase Traceback (most recent call last): File "hg", line 27, in <module> File "mercurial\dispatch.pyc", line 16, in run File "mercurial\dispatch.pyc", line 30, in dispatch File "mercurial\dispatch.pyc", line 46, in _runcatch File "mercurial\dispatch.pyc", line 454, in _dispatch File "mercurial\dispatch.pyc", line 324, in runcommand File "mercurial\dispatch.pyc", line 505, in _runcommand File "mercurial\dispatch.pyc", line 459, in checkargs File "mercurial\dispatch.pyc", line 453, in <lambda> File "mercurial\util.pyc", line 386, in check File "mercurial\commands.pyc", line 649, in clone File "mercurial\hg.pyc", line 292, in clone File "mercurial\localrepo.pyc", line 2140, in clone File "mercurial\localrepo.pyc", line 1437, in pull File "mercurial\httprepo.pyc", line 200, in changegroupsubset File "mercurial\httprepo.pyc", line 102, in do_cmd File "rfc822.pyc", line 384, in __getitem__ KeyError: 'content-type'
The web server apparently didn't return what was expected. A workaround - and the solution - is to fix the web server, whatever is wrong. But still, Mercurial shouldn't crash ... It should probably say something like 'invalid response'. I assume the web server can't be accessed from the internet? Can you use wireshark and capture the request and the response (especially the headers)?
Adding nosy from issue2346
Had the same with the following command, involving a sourceforge project and no hgwebdir.cgi (just like issue2346 has a public server and no hgwebdir.cgi in the URL either). $ hg clone \ http://crayzedsgui.hg.sourceforge.net:8000/hgroot/crayzedsgui/crayzedsgui Wiresharked the conversation: GET /?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between HTTP/1.1 Accept-Encoding: identity host: sourceforge.net accept: application/mercurial-0.1 user-agent: mercurial/proto-1.0 HTTP/1.1 200 OK Server: nginx/0.7.63 Date: Mon, 07 Mar 2011 12:31:08 GMT Transfer-Encoding: chunked Connection: close Pragma: no-cache Cache-Control: no-cache X-XRDS-Location: http://sourceforge.net/account/xrds.php X-UA-Compatible: IE=edge,chrome=1 Set-Cookie: VISITOR=4d74d00cd3179d71a60023ee; expires="Thu, 04-Mar-2021 12:31:08 GMT"; httponly; Max-Age=315360000; Path=/ Set-cookie: sf.consume=08d4b325b30218fab11ba1b5e4009af42b632c2bgAJ9cQEoVQhfZXhwaXJlc3ECY2RhdGV0aW1lCmRhdGV0aW1lCnEDVQoH9gETAw4HAAAAhVJxBFUFcHJlZnNxBX1xBlUOdXNlc19yZWxhdGlvbnNxB4lVB3ZlcnNpb25xCFUBMlUDa2V5cQlVGDRkNzRkMDBjZDMxNzlkNzFhNjAwMjNlZXEKVQNfaWRxC1UgOGFlYTJlNWQ3ZmIxYzBjZWM1YjRlN2MxOGIzYmQ1NmZxDFUOX2FjY2Vzc2VkX3RpbWVxDUdB0100Az5GhFUOX2NyZWF0aW9uX3RpbWVxDkdB0100Az5FX3Uu; expires=Tue, 19-Jan-2038 03:14:07 GMT; Path=/ Access-Control-Allow-Origin: * 20 download_hostdownloadspagemirror 0 Does this help? Is sourceforge broken? If so, could someone who knows the internals perhaps help them fix it?
gagern: There is no Mercurial repo at that URL. Use for example one of: http://crayzedsgui.hg.sourceforge.net:8000/hgroot/crayzedsgui/silly http://crayzedsgui.hg.sourceforge.net/hgroot/crayzedsgui/silly http://crayzedsgui.hg.sourceforge.net/hgweb/crayzedsgui/silly I don't know why SF sends such a response for invalid URLs. Mercurial could however report the error in a more helpful way.
Fixed by http://selenic.com/repo/hg/rev/091c86a77d19 Mads Kiilerich <mads@kiilerich.com> httprepo: proper handling of invalid responses without content-type (issue2019) (please test the fix)
Fixed by http://selenic.com/repo/hg/rev/4e958f2a193f Mads Kiilerich <mads@kiilerich.com> httprepo: proper handling of invalid responses without content-type (issue2019) (please test the fix)
--- Bug imported by bugzilla@serpentine.com 2012-05-12 09:06 EDT --- This bug was previously known as _bug_ 2019 at http://mercurial.selenic.com/bts/issue2019