SFTP authentication failure errors are ugly and confusing

Bug #52861 reported by Andrew Bennetts
2
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Unassigned

Bug Description

Here's an example transcript reported on #launchpad recently:

matt@kalliope:~/tmp$ bzr checkout sftp://bazaar.launchpad.net/~ubuntu-marketing/spreadubuntu/spreadubuntu spreadubuntu
The authenticity of host 'bazaar.launchpad.net (82.211.81.254)' can't be established.
RSA key fingerprint is 9d:38:3a:63:b1:d5:6f:c4:44:67:53:49:2e:ee:fc:89.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'bazaar.launchpad.net,82.211.81.254' (RSA) to the list of known hosts.
Permission denied (publickey).
bzr: ERROR: exceptions.EOFError:
  at /usr/lib/python2.4/site-packages/paramiko/sftp.py line 150
  in _read_all

First, nowhere does this say something simple and clear like "Login failed", which is the problem.

Also, the traceback shouldn't be shown to the user, it obscures the "Permission denied (publickey)" which is the most informative part of the output at the moment. To be fair to the current message, it's good that this mentions the type of authentication method(s) involved, as this can vary depending on the server (e.g. bazaar.launchpad.net only accepts publickey, and not password).

Finally, it should report the username that it failed to log in, as that's a common cause of confusion, particularly with the bazaar.launchpad.net service.

i.e., here's what I'd hope to see:

matt@kalliope:~/tmp$ bzr checkout sftp://bazaar.launchpad.net/~ubuntu-marketing/spreadubuntu/spreadubuntu spreadubuntu
[...warnings about host keys, if any...]
bzr: ERROR: Failed to login user "matt" (publickey).

Reporting the username may require changes to OpenSSH, I don't think bzr has any way of knowing what username it tried at the moment.

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

In general, we need to handle EOFError from SFTPSubprocess better.
Not really a blocker for 0.9, though.

Changed in bzr:
importance: Untriaged → Medium
status: Unconfirmed → Confirmed
Revision history for this message
John A Meinel (jameinel) wrote :

I believe we already merged the fixes for SFTPSubprocess.
Coupled with a newer version of paramiko, the errors should be quite a bit better.
They aren't quite as nice as you would like, but at least the ugly tracebacks are gone.

Changed in bzr:
status: Confirmed → Fix Released
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.