schacon / hg-git

mercurial to git bridge, pushed to directly from the hg-git plugin in Hg
GNU General Public License v2.0
620 stars 72 forks source link

AttributeError: '_Vendor' object has no attribute 'connect_ssh', hg 3.3.3, hg-git 0.8.0 #295

Open Triquetra opened 9 years ago

Triquetra commented 9 years ago

I get the following error when attempting to push:

pushing to git+ssh://git@git.overlays.gentoo.org/user/triquetra.git
** unknown exception encountered, please report by visiting
** http://mercurial.selenic.com/wiki/BugTracker
** Python 2.7.9 (default, Feb 11 2015, 16:08:53) [GCC 4.9.2]
** Mercurial Distributed SCM (version 3.3)
** Extensions loaded: rebase, purge, hggit
Traceback (most recent call last):
  File "/usr/lib/python-exec/python2.7/hg", line 43, in <module>
    mercurial.dispatch.run()
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 28, in run
    sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255)
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 71, in dispatch
    ret = _runcatch(req)
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 140, in _runcatch
    return _dispatch(req)
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 860, in _dispatch
    cmdpats, cmdoptions)
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 621, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 951, in _runcommand
    return checkargs()
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 922, in checkargs
    return cmdfunc()
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 857, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/usr/lib64/python2.7/site-packages/mercurial/util.py", line 711, in check
    return func(*args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/mercurial/commands.py", line 5115, in push
    bookmarks=opts.get('bookmark', ()))
  File "/usr/lib64/python2.7/site-packages/mercurial/extensions.py", line 194, in wrap
    return wrapper(origfn, *args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/hggit/util.py", line 42, in inner
    return f(*args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/hggit/__init__.py", line 258, in exchangepush
    pushop.cgresult = repo.githandler.push(remote.path, revs, force)
  File "/usr/lib64/python2.7/site-packages/hggit/git_handler.py", line 310, in push
    old_refs, new_refs = self.upload_pack(remote, revs, force)
  File "/usr/lib64/python2.7/site-packages/hggit/git_handler.py", line 964, in upload_pack
    new_refs = client.send_pack(path, changed, genpack)
  File "/usr/lib64/python2.7/site-packages/dulwich-0.8.5-py2.7-linux-x86_64.egg/dulwich/client.py", line 439, in send_pack
    proto, unused_can_read = self._connect('receive-pack', path)
  File "/usr/lib64/python2.7/site-packages/dulwich-0.8.5-py2.7-linux-x86_64.egg/dulwich/client.py", line 625, in _connect
    con = get_ssh_vendor().connect_ssh(
AttributeError: '_Vendor' object has no attribute 'connect_ssh'
Triquetra commented 9 years ago

I get a similar error when attempting to clone a new repository:

hg clone git+ssh://git@bitbucket.org/mgorny/eclean-kernel.git ./eclean-kernel
** unknown exception encountered, please report by visiting
** http://mercurial.selenic.com/wiki/BugTracker
** Python 2.7.9 (default, Feb 11 2015, 16:08:53) [GCC 4.9.2]
** Mercurial Distributed SCM (version 3.3.3)
** Extensions loaded: rebase, purge, hggit
Traceback (most recent call last):
  File "/usr/lib/python-exec/python2.7/hg", line 43, in <module>
    mercurial.dispatch.run()
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 28, in run
    sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255)
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 71, in dispatch
    ret = _runcatch(req)
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 140, in _runcatch
    return _dispatch(req)
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 863, in _dispatch
    cmdpats, cmdoptions)
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 624, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 954, in _runcommand
    return checkargs()
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 925, in checkargs
    return cmdfunc()
  File "/usr/lib64/python2.7/site-packages/mercurial/dispatch.py", line 860, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/usr/lib64/python2.7/site-packages/mercurial/util.py", line 711, in check
    return func(*args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/mercurial/commands.py", line 1374, in clone
    branch=opts.get('branch'))
  File "/usr/lib64/python2.7/site-packages/mercurial/hg.py", line 434, in clone
    destpeer.local().clone(srcpeer, heads=revs, stream=stream)
  File "/usr/lib64/python2.7/site-packages/mercurial/localrepo.py", line 1792, in clone
    ret = exchange.pull(self, remote, heads).cgresult
  File "/usr/lib64/python2.7/site-packages/mercurial/extensions.py", line 194, in wrap
    return wrapper(origfn, *args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/hggit/util.py", line 42, in inner
    return f(*args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/hggit/__init__.py", line 233, in exchangepull
    pullop.cgresult = repo.githandler.fetch(remote.path, heads)
  File "/usr/lib64/python2.7/site-packages/hggit/git_handler.py", line 231, in fetch
    refs = self.fetch_pack(remote, heads)
  File "/usr/lib64/python2.7/site-packages/hggit/git_handler.py", line 1052, in fetch_pack
    ret = client.fetch_pack(path, determine_wants, graphwalker, f.write, progress.progress)
  File "/usr/lib64/python2.7/site-packages/dulwich-0.8.5-py2.7-linux-x86_64.egg/dulwich/client.py", line 470, in fetch_pack
    proto, can_read = self._connect('upload-pack', path)
  File "/usr/lib64/python2.7/site-packages/dulwich-0.8.5-py2.7-linux-x86_64.egg/dulwich/client.py", line 625, in _connect
    con = get_ssh_vendor().connect_ssh(
AttributeError: '_Vendor' object has no attribute 'connect_ssh'
Triquetra commented 9 years ago

For anyone else looking for the resolution to this issue on a gentoo system (like mine), my python installation was messed up because of root use of pip to install/update python packages.
The solution was to reinstall python-exec as follows: /usr/bin/python3.3 /usr/lib/python-exec/python3.3/emerge -1 dev-lang/python-exec (substitute your installed python version) and then update dulwich to version 0.10.0.

cnmuc commented 7 years ago

For all Windows (7, 64bit) users: Updating Python to 3.6.0 and TortoiseHg to 4.0.1 worked for me