bzr+ssh to pre-1.6 server fails with AttributeError: 'NoneType' object has no attribute 'close' in close_ssh_proc

Bug #633745 reported by Andrew Bennetts
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Status tracked in Trunk
2.2
Fix Released
Critical
Unassigned
Trunk
Fix Released
High
Andrew Bennetts

Bug Description

This happens with 2.2 and bzr.dev. 2.1.x and earlier are fine.

$ BZR_REMOTE_PATH=/home/andrew/warthogs/bzr/bzr-1.5/bzr bzr --no-plugins revno bzr+ssh://localhost/
andrew@localhost's password:
/home/andrew/warthogs/bzr/bzr-1.5/bzrlib/lazy_import.py:195: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
  module = __import__(module_python_path, scope, scope, [])
Unable to load plugin 'builddeb' from '/home/andrew/.bazaar/plugins'
[...more unloadable plugins elided, they aren't relevant...]
Server does not understand Bazaar network protocol 3, reconnecting. (Upgrade the server to avoid this.)
bzr: ERROR: exceptions.AttributeError: 'NoneType' object has no attribute 'close'

Traceback (most recent call last):
  File "/home/andrew/code/bzr/bzrlib/commands.py", line 912, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/home/andrew/code/bzr/bzrlib/commands.py", line 1112, in run_bzr
    ret = run(*run_argv)
  File "/home/andrew/code/bzr/bzrlib/commands.py", line 690, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/andrew/code/bzr/bzrlib/commands.py", line 705, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/home/andrew/code/bzr/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/home/andrew/code/bzr/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/home/andrew/code/bzr/bzrlib/commands.py", line 1127, in ignore_pipe
    result = func(*args, **kwargs)
  File "/home/andrew/code/bzr/bzrlib/builtins.py", line 507, in run
    b = Branch.open_containing(location)[0]
  File "/home/andrew/code/bzr/bzrlib/branch.py", line 190, in open_containing
    possible_transports)
  File "/home/andrew/code/bzr/bzrlib/bzrdir.py", line 777, in open_containing
    return BzrDir.open_containing_from_transport(transport)
  File "/home/andrew/code/bzr/bzrlib/bzrdir.py", line 798, in open_containing_from_transport
    result = BzrDir.open_from_transport(a_transport)
  File "/home/andrew/code/bzr/bzrlib/bzrdir.py", line 767, in open_from_transport
    return format.open(transport, _found=True)
  File "/home/andrew/code/bzr/bzrlib/bzrdir.py", line 1708, in open
    return self._open(transport)
  File "/home/andrew/code/bzr/bzrlib/bzrdir.py", line 2902, in _open
    return remote.RemoteBzrDir(transport, self)
  File "/home/andrew/code/bzr/bzrlib/remote.py", line 119, in __init__
    self._probe_bzrdir()
  File "/home/andrew/code/bzr/bzrlib/remote.py", line 131, in _probe_bzrdir
    self._rpc_open_2_1(path)
  File "/home/andrew/code/bzr/bzrlib/remote.py", line 138, in _rpc_open_2_1
    response = self._call('BzrDir.open_2.1', path)
  File "/home/andrew/code/bzr/bzrlib/remote.py", line 56, in _call
    return self._client.call(method, *args)
  File "/home/andrew/code/bzr/bzrlib/smart/client.py", line 132, in call
    result, protocol = self.call_expecting_body(method, *args)
  File "/home/andrew/code/bzr/bzrlib/smart/client.py", line 145, in call_expecting_body
    method, args, expect_response_body=True)
  File "/home/andrew/code/bzr/bzrlib/smart/client.py", line 101, in _call_and_read_response
    self._medium.disconnect()
  File "/home/andrew/code/bzr/bzrlib/smart/medium.py", line 803, in disconnect
    self._ssh_connection.close()
  File "/home/andrew/code/bzr/bzrlib/transport/ssh.py", line 709, in close
    _close_ssh_proc(self.proc)
  File "/home/andrew/code/bzr/bzrlib/transport/ssh.py", line 648, in _close_ssh_proc
    for func in [proc.stdin.close, proc.stdout.close, proc.wait]:
AttributeError: 'NoneType' object has no attribute 'close'

bzr 2.3.0dev1 on python 2.6.6 (Linux-2.6.35-20-generic-i686-with-Ubuntu-10.10-maverick)
arguments: ['/home/andrew/code/bzr/bzr', '--no-plugins', 'revno', 'bzr+ssh://localhost/']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_AU.utf8'
plugins:

*** Bazaar has encountered an internal error. This probably indicates a
    bug in Bazaar. You can help us fix it by filing a bug report at
        https://bugs.launchpad.net/bzr/+filebug
    including this traceback and a description of the problem.
Transferred: 0kB (0.1kB/s r:0kB w:0kB)
HPSS calls: 1 (0 vfs) SmartSSHClientMedium(bzr+ssh://None@localhost/)

Tags: hpss

Related branches

Revision history for this message
Andrew Bennetts (spiv) wrote :

A workaround is to use sftp:// rather than bzr+ssh://. If that's not possible, you can install lp:~spiv/+junk/bzr_ssh_v2_hack as a bzr plugin (i.e. 'bzr branch lp:~spiv/+junk/bzr_ssh_v2_hack ~/.bazaar/plugins/bzr_ssh_v2_hack).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.