opening sftp URL crashes on connect failure

Bug #662482 reported by Seth Purcell
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned

Bug Description

Trying to open an sftp URL causes an exception after a timeout due to connectivity issues.

I'm having a VPN-related issue accessing the server our bzr repo is on such that in PuTTY it gets as far as:

Using username "xxxx".
Authenticating with public key "xxxxxx" from agent

and then hangs, eventually giving up with "Fatal: Network error: software caused connection abort".
I presume the same thing is happening to bzr and that's what's crashing explorer.

stack trace follows:

bzr: ERROR: exceptions.AttributeError: 'int' object has no attribute 'startswith'

Traceback (most recent call last):
  File "C:/Program Files/Bazaar/plugins\explorer\lib\explorer.py", line 1409, in callable_with_cleanup
  File "C:/Program Files/Bazaar/plugins\explorer\lib\explorer.py", line 1570, in _open_location_task
  File "C:/Program Files/Bazaar/plugins\explorer\lib\location.py", line 152, in __init__
  File "C:/Program Files/Bazaar/plugins\explorer\lib\location.py", line 214, in reopen_location
  File "bzrlib\bzrdir.pyo", line 1063, in open_containing_tree_branch_or_repository
  File "bzrlib\bzrdir.pyo", line 967, in open_containing
  File "bzrlib\bzrdir.pyo", line 988, in open_containing_from_transport
  File "bzrlib\bzrdir.pyo", line 941, in open_from_transport
  File "bzrlib\transport\__init__.pyo", line 1657, in do_catching_redirections
  File "bzrlib\bzrdir.pyo", line 928, in find_format
  File "bzrlib\bzrdir.pyo", line 1949, in find_format
  File "bzrlib\bzrdir.pyo", line 1959, in probe_transport
  File "bzrlib\transport\sftp.pyo", line 435, in get_bytes
  File "bzrlib\transport\sftp.pyo", line 431, in get
  File "bzrlib\transport\sftp.pyo", line 707, in _translate_io_exception
AttributeError: 'int' object has no attribute 'startswith'

bzr 2.2.0 on python 2.6.4 (win32)
arguments: ['C:\\Program Files\\Bazaar\\bzrw.exe', 'explorer']
encoding: 'cp1252', fsenc: 'mbcs', lang: None
plugins:
  bzrtools C:\Program Files\Bazaar\plugins\bzrtools [2.2.0]
  colo C:\Program Files\Bazaar\plugins\colo [0.1.0]
  explorer C:\Program Files\Bazaar\plugins\explorer [1.1b1]
  fastimport C:\Program Files\Bazaar\plugins\fastimport [0.9.0dev]
  launchpad C:\Program Files\Bazaar\plugins\launchpad [2.2.0]
  loom C:\Program Files\Bazaar\plugins\loom [2.2.1dev]
  netrc_credential_store C:\Program Files\Bazaar\plugins\netrc_credential_store [2.2.0]
  news_merge C:\Program Files\Bazaar\plugins\news_merge [2.2.0]
  pipeline C:\Program Files\Bazaar\plugins\pipeline [unknown]
  qbzr C:\Program Files\Bazaar\plugins\qbzr [0.19.0]
  rewrite C:\Program Files\Bazaar\plugins\rewrite [0.6.0]
  svn C:\Program Files\Bazaar\plugins\svn [1.0.3]
  upload C:\Program Files\Bazaar\plugins\upload [1.0.0dev]
  xmloutput C:\Program Files\Bazaar\plugins\xmloutput [0.8.6]

Revision history for this message
Alexander Belchenko (bialix) wrote :

based on traceback this is error in bzr core.

affects: bzr-explorer → bzr
Revision history for this message
John A Meinel (jameinel) wrote :

We do have an error here, which is masking the original error. It seems that the code assumes "e.args[0]" is always a string, but in this case it is an integer.

Offhand, it looks like something is raising a custom exception that doesn't match the exceptions we've seen. Looking at the code, it seems to catch "IOError()" which hash args[0] == errno. I'm not 100% sure why it is catching IOError rather than just SSHException. (I think paramiko used to raise multiple kinds of exceptions).

Anyway, we can fix our code to handle this error better, but fundamentally we are already in an error condition due to something else.

Changed in bzr:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 662482] Re: opening sftp URL crashes on connect failure

This might be a dupe.

Jelmer Vernooij (jelmer)
tags: added: sftp
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
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.