Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot push into Mercurial, End of script output before headers: hgweb.cgi, TortoiseHg command returned code 255

Mercurial was working fine but after a few pushes it starts returning error. I am using TortoiseHg and the log returns

command returned code 255

When I check the log from Apache, it mentions that hgweb.cgi is the problem

I can see the Mercurial repos on the web browser.

I'm running a Linode server and using Apache2 to host Mercurial.

I tried making every file in /var/hg executable by every user

sudo chmod -R a+rx /var/hg

I tried giving the script itself executable permission.

chmod +x hgweb.cgi

I tried running chown for Apache on the whole repos and it still not work

chown www-data -R /var/hg

I tried executing the .cgi file itself to see if there's any problem, but it terminates exactly the same way as Mercurial from my local Ubuntu server (which is working flawlessly).

like image 765
Huy Pham Avatar asked Oct 24 '25 15:10

Huy Pham


1 Answers

I might have found the problem. My system has 1GB of RAM and OOM was killing it.

In my frustration, I switched to nginx and did a reverse proxy. I ran it with a systemd service and collected logs from it with journalctl -u nameofyourmercurialservice

Pushing a 400mb file results in OOM killer kicking in. I subsequently upgraded my system to 4GB and it worked.

like image 181
Huy Pham Avatar answered Oct 27 '25 04:10

Huy Pham



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!