cod*_*ner 30 mercurial push file iis-7.5 machg
19/06/10更新:更多证据问题是服务器端问题.在Windows 7命令行上接收此错误(请参阅下面的完整回溯):
URLError: <urlopen error [Errno 10054] An existing connection was forcibly closed by the remote host>
abort: error: An existing connection was forcibly closed by the remote host
Run Code Online (Sandbox Code Playgroud)
当试图将包含6个大文件(.exe,.dmg等)的变更集推送到我的远程服务器时,我的客户端(MacHG)报告错误:
"推送期间出错.Mercurial报告错误号255:中止:HTTP错误404:未找到"
这个错误甚至意味着什么?!关于此提交,唯一唯一的(我可以告诉)是文件的大小,类型和文件名.如何确定变更集中的哪个确切文件失败?如何从存储库中删除损坏的变更集?在另一篇文章中,有人报告使用"mq"扩展来有效地从存储库中的历史记录中删除错误的变更集,但是对于我正在尝试解决的问题,mq看起来过于复杂.
我可以使用MacHG和toirtoise HG推送和提取以下内容:源文件,目录,.class文件和.jar文件进出服务器.
我成功地向我的本地存储库添加了第一次添加6个大型.exe,.dmg等安装程序文件(总共约130Mb).
在我对本地存储库的以下提交中,我删除了("未跟踪"/忘记)导致问题的6个文件,但是先前(失败的)更改集仍然排队等待推送到服务器(即我的本地主机正在尝试推送"添加"然后"移除"到远程服务器 - 并与源控制系统中的"保持历史中的一切"理念保持一致.
我可以使用Windows PC上的TortoiseHG提交.txt .java文件等.我实际上没有使用TortoiseHG测试提交或推送相同的大文件.
请帮忙!
客户端应用程序= MacHG v0.9.7(SCM 1.5.4)和TortoiseHG v1.0.4(SCM 1.5.4)
Server = HTTPS,IIS7.5,Mercurial 1.5.4,Python 2.6.5,使用以下说明进行设置:
http://www.jeremyskinner.co.uk/mercurial-on-iis7/
在IIS7.5中,CGI处理程序配置为处理所有动词(不仅仅是GET,POST和HEAD).
我在服务器上的hgweb.cgi文件如下:
#!/usr/bin/env python
#
# An example hgweb CGI script, edit as necessary
# Path to repo or hgweb config to serve (see 'hg help hgweb')
#config = "/path/to/repo/or/config"
# Uncomment and adjust if Mercurial is not installed system-wide:
#import sys; sys.path.insert(0, "/path/to/python/lib")
# Uncomment to send python tracebacks to the browser if an error occurs:
#import cgitb; cgitb.enable()
from mercurial import demandimport; demandimport.enable()
from mercurial.hgweb import hgweb, wsgicgi
application = hgweb('C:\inetpub\wwwroot\hg\hgweb.config')
wsgicgi.launch(application)
Run Code Online (Sandbox Code Playgroud)
我在服务器上的hgweb.config文件如下:
[collections]
C:\Mercurial Repositories = C:\Mercurial Repositories
[web]
baseurl = /hg
allow_push = usernamea
allow_push = usernameb
Run Code Online (Sandbox Code Playgroud)
使用-v和--trackback标志从我的macbook(Mercurial和MacHG安装)命令行输出:
macbook15:hgrepos coderunner$ hg -v --traceback push
pushing to https://coderunner:***@hg.mydomain.com.au/hg/hgrepos
searching for changes
3 changesets found
Traceback (most recent call last):
File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 50, in _runcatch
return _dispatch(ui, args)
File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 471, in _dispatch
return runcommand(lui, repo, cmd, fullargs, ui, options, d)
File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 341, in runcommand
ret = _runcommand(ui, options, cmd, d)
File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 522, in _runcommand
return checkargs()
File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 476, in checkargs
return cmdfunc()
File "/Library/Python/2.6/site-packages/mercurial/dispatch.py", line 470, in <lambda>
d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
File "/Library/Python/2.6/site-packages/mercurial/util.py", line 401, in check
return func(*args, **kwargs)
File "/Library/Python/2.6/site-packages/mercurial/commands.py", line 2462, in push
r = repo.push(other, opts.get('force'), revs=revs)
File "/Library/Python/2.6/site-packages/mercurial/localrepo.py", line 1491, in push
return self.push_unbundle(remote, force, revs)
File "/Library/Python/2.6/site-packages/mercurial/localrepo.py", line 1636, in push_unbundle
return remote.unbundle(cg, remote_heads, 'push')
File "/Library/Python/2.6/site-packages/mercurial/httprepo.py", line 235, in unbundle
heads=' '.join(map(hex, heads)))
File "/Library/Python/2.6/site-packages/mercurial/httprepo.py", line 134, in do_read
fp = self.do_cmd(cmd, **args)
File "/Library/Python/2.6/site-packages/mercurial/httprepo.py", line 85, in do_cmd
resp = self.urlopener.open(req)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 389, in open
response = meth(req, response)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 502, in http_response
'http', request, response, code, msg, hdrs)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 427, in error
return self._call_chain(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 361, in _call_chain
result = func(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 510, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 404: Not Found
abort: HTTP Error 404: Not Found
macbook15:hgrepos coderunner$
Run Code Online (Sandbox Code Playgroud)
Windows 7主机(仅安装了TortoiseHG)的输出尝试将相同的文件推送到服务器(不同的changset,但包含与从macbook推送的变更集相同的6个文件添加)
c:\repositories\hgrepos>hg -v --traceback push
pushing to https://coderunner:***@hg.mydomain.com.au/hg/hgrepos
searching for changes
1 changesets found
Traceback (most recent call last):
File "mercurial\dispatch.pyo", line 50, in _runcatch
File "mercurial\dispatch.pyo", line 471, in _dispatch
File "mercurial\dispatch.pyo", line 341, in runcommand
File "mercurial\dispatch.pyo", line 522, in _runcommand
File "mercurial\dispatch.pyo", line 476, in checkargs
File "mercurial\dispatch.pyo", line 470, in <lambda>
File "mercurial\util.pyo", line 401, in check
File "mercurial\commands.pyo", line 2462, in push
File "mercurial\localrepo.pyo", line 1491, in push
File "mercurial\localrepo.pyo", line 1636, in push_unbundle
File "mercurial\httprepo.pyo", line 235, in unbundle
File "mercurial\httprepo.pyo", line 134, in do_read
File "mercurial\httprepo.pyo", line 85, in do_cmd
File "urllib2.pyo", line 389, in open
File "urllib2.pyo", line 407, in _open
File "urllib2.pyo", line 367, in _call_chain
File "mercurial\url.pyo", line 523, in https_open
File "mercurial\keepalive.pyo", line 259, in do_open
URLError: <urlopen error [Errno 10054] An existing connection was forcibly closed by the remote host>
abort: error: An existing connection was forcibly closed by the remote host
c:\repositories\hgrepos>
Run Code Online (Sandbox Code Playgroud)
这是一个保持活力的问题?IIS7.5有问题吗?Python 2.6.5有错吗?
mar*_*gic 51
经历了同样的痛点......
使用IIS服务器上的默认设置,您将无法将大型存储库推送到服务器,因为IIS的默认最大请求长度仅为4 MB,CGI脚本的超时时间为15分钟,因此无法上载大文件.要启用大文件的上载(这在Web上很难找到...),请执行以下操作:
1.在IIS管理器中,单击网站节点,然后单击限制...链接.
2.然后指定足够大的连接超时(我在这里选择1小时,或3600秒)
3.接下来,单击包含hg的节点(根据安装过程),然后双击CGI
4.指定足够的 - CGI脚本需要很长时间(例如10小时)
现在,编辑C:\ inetpub\wwwroot\hg\web.config,以便它下面有一个新的<security>部分<system.webserver>,以及下面的<httpRuntime>规范<system.web>:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
[…]
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength ="2147482624" />
</requestFiltering>
</security>
</system.webServer>
<system.web>
<httpRuntime
executionTimeout="540000" maxRequestLength="2097151"/>
</system.web>
</configuration>
Run Code Online (Sandbox Code Playgroud)
这指定超过6天的http超时,以及大约2 GB的最大上载限制.
小智 6
使用IIS 7作为服务器有同样的问题.尝试上面的解决方案解决了错误255问题,但仍然得到Errorno 10054与更大的文件.然后我增加了IIS中的连接超时工作.
要更改:网站 - >管理网站 - >高级设置 - >连接限制 - >连接超时.默认值为2分钟.将我的改为20分钟并且有效.
不知道为什么这样可行但似乎Mercurial与服务器建立连接,需要一段时间来处理更大的文件,然后才发送请求.到那时IIS已经断开了客户端.
| 归档时间: |
|
| 查看次数: |
21446 次 |
| 最近记录: |