Jason
Jason

Reputation: 317

Hgweb "Push" in IIS returning 502 (bad gateway)

I've got hgweb up and running on II7 7 (on windows server 2008). The web interface works, and I can view, pull, and clone the repositories there. But I cannot push, doing so gives me a 502 error right after "searching for changes". Using --debug shows the last few lines as:

sending unbundle command
sending 622 bytes
HTTP Error: 502 (Bad Gateway)

I am using TortoiseHG to push, but the result is the same when using the mercurial command line.

I had followed the tutorial here: http://www.sjmdev.com/blog/post/2011/03/30/setting-mercurial-18-server-iis7-windows-server-2008-r2.aspx to setup hgweb.

Upvotes: 9

Views: 5291

Answers (6)

Piotr
Piotr

Reputation: 541

I had this issue, and the problem ended up being the server running out of disk space.

Upvotes: 0

netawater
netawater

Reputation: 15844

Try use https instead http in .hg/hgrc, I have resolve this problem for code.google.com.

Upvotes: 0

Victor Bashurov
Victor Bashurov

Reputation: 380

It could happen by different reasons, to get more details about the error run

hg push --config ui.usehttp2=true --config ui.http2debuglevel=info

For example, problem may occur because of proxy server or just in case when the Mercurial Web Server "forgets" about repositories it needs to serve: in case if you are using TortoiseHg workbench go to Workbench UI, Repository -> Start Web Server, make sure that your repository is in the list of the served repos.

Upvotes: 0

Ales Potocnik
Ales Potocnik

Reputation: 3087

Looks like an old question but someone is bound to come across it again. I was close to drawing a black circle on a wall and ... anyhow the issue for us was the way central repository was created. We cloned it from BitBucket while being Remote connected to the machine as local administrator.

The issue was in [Repository].hg folder. You need to set correct permissions on it. Try it with adding Everyone -> Full permissions for test purpose. Please make sure you change this to a dedicated network login or appropriate local account afterwards.

I was seeing the exact same behaviour - even push worked fine with exception of getting a Bad Gateway after all the time. After correct permissions were set the issue was gone.

Thinking about it now, probably the best solution is to add each network login that uses the repo to machine users and then set up access permissions to .hg folder to local users.

Hope it helps someone.

Upvotes: 4

Peter Bernier
Peter Bernier

Reputation: 8069

Take a look at the 'Push_ssl' setting in your hgweb.config file.

I was getting the same error (had mine set to '*'), and was able to resolve it by removing the line entirely. Granted, this makes Mercurial somewhat less secure, but it lets me get by the configuration issue (for now) while I investigate properly configuring SSL on the server.

You may also have to review the 'Allow_push' setting in order to get past further errors (or take another look at your authorization).

NOTE: At least in my case, having 'push_ssl = false' wasn't enough as that resulted in further errors (authorization failed).

(Again this is simply a temporary solution until the server can be properly secured.)

Upvotes: 0

Sumo
Sumo

Reputation: 4112

Try using the ISAPI module method instead of the CGI that executes phython.exe as documented here. There's also another related, and possibly duplicate question here as well.

Upvotes: 0

Related Questions