开发者

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/set开发者_如何学Pythonting-mercurial-18-server-iis7-windows-server-2008-r2.aspx to setup hgweb.


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.


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.


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.)


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.


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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜