sftp connection failure should raise a more specific exception

Bug #49172 reported by David Allouche
12
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Low
John A Meinel

Bug Description

When a SFTP connection fails (which may be expected, for example when missing
credentials), the SFTPClient constructor raises an EOFError in _read_all, and
that exception bubbles up all the way to the user.

bzrlib should catch the error and raise an appropriate specific exception.

The bzr command line should catch that specific exception and print an error
message.

Related branches

Revision history for this message
David Allouche (ddaa) wrote :

Mailing post from an user that tried to push to launchpad without
registering his ssh key:

https://lists.ubuntu.com/archives/launchpad-users/2006-June/000395.html

The user got the following output:

sebi at sebi-mac:~/Desktop/Entwicklung/update-manager/sebi$ bzr push
sftp://<email address hidden>/~glatzor/update-manager/sebi
Permission denied (publickey).
bzr: ERROR: exceptions.EOFError:
  at /usr/lib/python2.4/site-packages/paramiko/sftp.py line 150
  in _read_all

Revision history for this message
John A Meinel (jameinel) wrote :

This has been fixed for a while, (at least with newer paramiko and newer bzr). There is a small bugfix remaining, which is a different bug, but I don't know it right now. But the error now is:

bzr: ERROR: Connection error: Unable to connect to SSH host nohost:None: EOF during negotiation

The big fix is that we shouldn't print :None:. If we have a port we should print it, but if we don't we should print nothing.

Changed in bzr:
assignee: nobody → jameinel
importance: Undecided → Low
status: Unconfirmed → Fix Committed
Revision history for this message
John A Meinel (jameinel) wrote :

Patch needs review, but should go cleanly into 0.13

John A Meinel (jameinel)
Changed in bzr:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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