Mercurial https clone:“abort:error:(...)错误的版本号”

时间:2014-01-31 10:26:36

标签: mercurial clone

我在OS X 10.9.1上遇到mercurial问题 我有一个带有几个文件的bitbucket存储库,当我试图克隆它时我得到了一个错误:

mac-mini-jakub:testrepo kubeczek$ hg clone https://kubecz3k@bitbucket.org/kubecz3k/test 
abort: error: _ssl.c:507: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number

我已经从https://www.mercurial-scm.org/downloads/

为MacOS X 10.9安装了Mercurial 2.8.2

我很确定在bitbucket一边都可以,因为我在linux机器上没有问题。

这是完整的追溯:

mac-mini-jakub:testrepo kubeczek$ hg clone https://kubecz3k@bitbucket.org/kubecz3k/test --traceback
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/dispatch.py", line 133, in _runcatch
    return _dispatch(req)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/dispatch.py", line 806, in _dispatch
    cmdpats, cmdoptions)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/dispatch.py", line 585, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/dispatch.py", line 897, in _runcommand
    return checkargs()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/dispatch.py", line 868, in checkargs
    return cmdfunc()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/dispatch.py", line 803, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/util.py", line 512, in check
    return func(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/commands.py", line 1286, in clone
    branch=opts.get('branch'))
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/hg.py", line 268, in clone
    srcpeer = peer(ui, peeropts, source)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/hg.py", line 122, in peer
    return _peerorrepo(rui, path, create).peer()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/hg.py", line 102, in _peerorrepo
    obj = _peerlookup(path).instance(ui, path, create)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/httppeer.py", line 238, in instance
    inst._fetchcaps()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/httppeer.py", line 57, in _fetchcaps
    self.caps = set(self._call('capabilities').split())
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/httppeer.py", line 171, in _call
    fp = self._callstream(cmd, **args)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/httppeer.py", line 118, in _callstream
    resp = self.urlopener.open(req)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 404, in open
    response = self._open(req, data)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 422, in _open
    '_open', req)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/url.py", line 368, in https_open
    return self.do_open(self._makeconnection, req)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/keepalive.py", line 257, in do_open
    raise urllib2.URLError(err)
URLError: <urlopen error [Errno 1] _ssl.c:507: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number>
abort: error: _ssl.c:507: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number

我的Python版本是:

mac-mini-jakub:~ kubeczek$ python -V
Python 2.7.6

SSL:

>>> print _ssl.OPENSSL_VERSION
OpenSSL 0.9.8y 5 Feb 2013

我将非常感谢您的帮助,谢谢!

6 个答案:

答案 0 :(得分:23)

您可能必须禁用TLS,请阅读this

为此,请将其添加到〜/ .hgrc

[ui]
tls = False

有关SSL和TLS的更多信息here

答案 1 :(得分:4)

还有另一个原因。它可能不是你的问题,但也应该在这里列出,对于其他人遇到这个问题的情况:

如果您在代理服务器后面并且您的代理服务器设置不正确,则也会显示此错误消息。天知道为什么......

示例:您有以下配置

[http_proxy]
no = localhost,127.0.0.1
host = 1.2.3.4:8080
user = myusername
passwd = oldpassword

旧密码可能是obsolet(你忘了改变它)。然后出现相同的SSL错误版本错误。它完全没有任何意义(至少对我而言),但我用mercurial 3.6.2重现了这个问题。更正代理设置可修复所有问题。

答案 2 :(得分:2)

不完全是一个直接的解决方案,但很好的解决方法: 强烈建议问题在于ssl我已切换到ssh(https://confluence.atlassian.com/pages/viewpage.action?pageId=270827678),现在一切正常。所以从实际的角度来看,这个问题就解决了。

答案 3 :(得分:1)

我对一些bitbucket存储库有这个问题(但不是全部)。我发现,根据追溯,设置--config ui.clonebundles=false有效。

hg clone --config ui.clonebundles=false  https://bitbucket.org/me/myrepo

让你的克隆慢得多。

[编辑] - 尽管如此,请参阅我对@ UniversE上面的答案的评论,但实际问题与atlassian子域不在我的squid代理的白名单上有关。 p,这很难调试。

答案 4 :(得分:0)

正如问题之一所建议的那样,从https切换到ssh可以为我修复

答案 5 :(得分:0)

您必须从系统范围的配置文件或自己的​​配置文件中禁用clonebundle。

为此,请将以下行添加到/ etc / mercurial / hgrc或〜/ .hgrc

# system-wide mercurial configuration file
# See hgrc(5) for more information
[ui]
clonebundles = False