Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
File 试图将大型文件推送到服务器时,Mercurial客户端错误255和HTTP错误404 问题:_File_Mercurial_Push_Iis 7.5_Machg - Fatal编程技术网

File 试图将大型文件推送到服务器时,Mercurial客户端错误255和HTTP错误404 问题:

File 试图将大型文件推送到服务器时,Mercurial客户端错误255和HTTP错误404 问题:,file,mercurial,push,iis-7.5,machg,File,Mercurial,Push,Iis 7.5,Machg,2010年6月19日更新:服务器端存在更多证据问题。在Windows 7命令行上收到此错误(请参阅下面的完整回溯): 我在服务器上的hgweb.config文件如下所示: #!/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/

2010年6月19日更新:服务器端存在更多证据问题。在Windows 7命令行上收到此错误(请参阅下面的完整回溯):

我在服务器上的hgweb.config文件如下所示:

#!/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)
[collections]
C:\Mercurial Repositories = C:\Mercurial Repositories

[web]
baseurl = /hg
allow_push = usernamea
allow_push = usernameb
使用-v和--trackback标志从my 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$ 
macbook15:hgrepos coderunner$hg-v——回溯推送
推动https://coderunner:***@hg.mydomain.com.au/hg/hgrepos
搜索更改
找到3个变更集
回溯(最近一次呼叫最后一次):
文件“/Library/Python/2.6/site packages/mercurial/dispatch.py”,第50行,在runcatch中
返回\u分派(用户界面,参数)
文件“/Library/Python/2.6/site packages/mercurial/dispatch.py”,第471行,在
返回runcommand(lui、repo、cmd、fullargs、ui、options、d)
runcommand中的文件“/Library/Python/2.6/site packages/mercurial/dispatch.py”,第341行
ret=_runcommand(用户界面,选项,命令,d)
文件“/Library/Python/2.6/site packages/mercurial/dispatch.py”,第522行,在运行命令中
返回checkargs()
checkargs中的文件“/Library/Python/2.6/site packages/mercurial/dispatch.py”,第476行
返回cmdfunc()
文件“/Library/Python/2.6/site packages/mercurial/dispatch.py”,第470行,在
d=lambda:util.checksignature(func)(用户界面,*args,**cmdoptions)
文件“/Library/Python/2.6/site packages/mercurial/util.py”,第401行,选中
返回函数(*args,**kwargs)
文件“/Library/Python/2.6/site packages/mercurial/commands.py”,第2462行,在push中
r=repo.push(其他,opts.get('force'),revs=revs)
文件“/Library/Python/2.6/site packages/mercurial/localrepo.py”,第1491行,在push中
返回自推式解锁(遥控、强制、转数)
文件“/Library/Python/2.6/site packages/mercurial/localrepo.py”,第1636行,push_unbundle
返回遥控器。解绑(重心,遥控器头部,“推”)
文件“/Library/Python/2.6/site packages/mercurial/httprepo.py”,第235行,未绑定
heads=''.join(映射(十六进制,heads)))
文件“/Library/Python/2.6/site packages/mercurial/httprepo.py”,第134行,在do_read中
fp=self.do_cmd(cmd,**args)
do_cmd中的文件“/Library/Python/2.6/site packages/mercurial/httprepo.py”,第85行
resp=self.urlopener.open(请求)
文件“/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py”,第389行,打开
响应=方法(请求,响应)
文件“/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py”,第502行,在http_响应中
“http”、请求、响应、代码、消息、hdrs)
文件“/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py”,第427行出错
返回自我。调用链(*args)
文件“/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py”,第361行,在调用链中
结果=func(*args)
文件“/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py”,第510行,默认为http\u error\u
raise HTTPError(请求获取完整url(),代码,消息,hdrs,fp)
HTTPError:HTTP错误404:未找到
中止:HTTP错误404:未找到
macbook15:hgrepos coderunner$
试图将相同文件推送到服务器的Windows 7主机(仅安装了OrtoiseHG)的输出(不同的changset,但包含与从macbook推送到的变更集相同的6个文件添加)

c:\repositories\hgrepos>hg-v——回溯推送
推动https://coderunner:***@hg.mydomain.com.au/hg/hgrepos
搜索更改
找到1个变更集
回溯(最近一次呼叫最后一次):
文件“mercurial\dispatch.pyo”,第50行,在runcatch中
文件“mercurial\dispatch.pyo”,第471行,在\u dispatch中
runcommand中第341行的文件“mercurial\dispatch.pyo”
文件“mercurial\dispatch.pyo”,第522行,在运行命令中
文件“mercurial\dispatch.pyo”,第476行,在checkargs中
文件“mercurial\dispatch.pyo”,第470行,在
文件“mercurial\util.pyo”,第401行,检查
文件“mercurial\commands.pyo”,第2462行,在push中
文件“mercurial\localrepo.pyo”,第1491行,在push中
文件“mercurial\localrepo.pyo”,第1636行,在push_unbundle中
文件“mercurial\httprepo.pyo”,第235行,未绑定
文件“mercurial\httprepo.pyo”,第134行,在do_read中
do_cmd中第85行的文件“mercurial\httprepo.pyo”
文件“urllib2.pyo”,第389行,打开
文件“urllib2.pyo”,第407行,打开
文件“urllib2.pyo”,第367行,在调用链中
文件“mercurial\url.pyo”,第523行,https\u open
文件“mercurial\keepalive.pyo”,第259行,在do\u open中
URL错误:
中止:错误:远程主机已强制关闭现有连接
c:\repositories\hgrepos>

这是一个保持活力的问题?IIS7.5是否有错?Python 2.6.5出错了吗

经历了同样的痛点

使用IIS服务器上的默认设置,您将无法将大型存储库推送到服务器,因为IIS的默认最大请求长度仅为4 MB,CGI脚本的超时时间为15分钟,因此无法上载大型文件。 要启用大文件的上载(这在web上不容易找到…),请执行以下操作:
1.在IIS管理器中,单击网站节点,然后单击限制…链接。
2.然后指定一个足够大的连接超时(我在这里选择了1小时或3600秒)
3.接下来,单击包含hg的节点(按照安装过程),然后双击CGI
4.为CGI脚本指定足够长的超时时间(例如10小时)

现在,编辑C:\inetpub\wwwroot\hg\web.config,使其在
下有一个新的
部分,在
下有一个
规范:

<?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>

[…]

这指定http超时时间略大于6天,最大上载限制约为2 GB。

使用IIS 7作为服务器时也存在同样的问题。尝试了上述解决方案,解决了错误255的问题,但仍然得到错误号100
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>
<?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>