views:

196

answers:

3

Hi,

I set up a repository on another computer for which I want to start cloning over http. I set up apache with the directive as stated below, and in the directory I have my index.cgi file as provided by mercurial. I can clone a repository just fine if it's empty, but if it contains files, I get a 500 error. Looking at the error logs, I see the following:

malformed header from script. Bad header=1 changesets found: index.cgi

To me, this sounds like a permissions issue, but everything is 775 (we're behind several firewalls) and everything is accessable from index.cgi over a browser.

I'm out of options, is there anything I'm missing?

Apache config:

Alias /hg /base/src/hg_cgi
<Directory "/base/src/hg_cgi">
    DirectoryIndex index.cgi
    AddHandler cgi-script .cgi
    Options ExecCGI
    Order allow,deny
    Allow from all
</Directory>
A: 

Try changing that 'Alias' to a 'ScriptAlias'

Also, check your apache error log. It will have more and better output.

Ry4an
I did the Alias -> ScriptAlias, no change.Apache logs indicate "malformed header from script. Bad header=1 changesets found: index.cgi"
paulj3000
Try doing a script alias all the way to the CGI. It's safer too: ScriptAlias /base/src/hg_cgi/hgwebdir.cgiAlso what was in the apache error log? That's where the money is.
Ry4an
Apache error log shows "malformed header from script. Bad header=1 changesets found: index.cgi" That's it
paulj3000
What did you rename to index.cgi? Was it hgweb.cgi or hgwebdir.cgi? What URL are you using to push/pull in this scenario? Maybe try `--debug` when you clone and see if there's anything interesting there?
Ry4an
A: 

I had the same error.

Turns out that commenting out the following line in ~/.hgrc

#verbose = True

fixed things.

src: http://mercurial.selenic.com/bts/issue1250

Coded Signal
A: 

I am using ScriptAlias, renamed hgweb.cgi to index.cgi, do not have verbose turned on but still see the 500 Internal server error. Here are my Apache log messages

Command: hg clone http://ip.address.here:8880/hg/Lavanya2/test/ .

Error log [Wed Jul 28 11:52:27 2010] [error] [client ip.address.here] malformed header from script. Bad header=8 changesets found: index.cgi

Lavanya Kiran
I got this to work (finally!). I had to remove the debug=true setting from the hgrc file of the repository that I am trying to clone.
Lavanya Kiran