SFTP server should give human-friendly errors for name restrictions
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | Launchpad itself |
Medium
|
Andrew Bennetts | ||
Bug Description
https:/
We want to return sensible errors to the user when they hit one of these restrictions. Ideally, the user experience would look something like:
% bzr push sftp://
bzr: error creating directory cool-features. Server said:
branches must be inside a person or team directory
% bzr push sftp://
bzr: error creating directory ~mbp/cool-features. Server said:
branches must be inside a valid product name, or "+junk"
% bzr push sftp://
bzr: error creating directory ~linux-
you are not a member of the "linux-kernel" team
Currently, the SFTP server just sends generic permission denied errors. We need to determine if we can send more useful error messages via SFTP, and then make sure bzr reports them.
| Changed in launchpad: | |
| status: | Unconfirmed → Confirmed |
| Changed in launchpad: | |
| assignee: | nobody → spiv |
| Andrew Bennetts (spiv) wrote : | #1 |
| Changed in launchpad-bazaar: | |
| status: | Confirmed → Fix Committed |
| Andrew Bennetts (spiv) wrote : | #2 |
Fixed. Here's what it does now:
$ bzr push --create-prefix sftp://
Please rename ~/.bazaar/
bzr: ERROR: Permission denied: u'fdsjkfsdk': [Errno 13] Branches must be inside a person or team directory.
$ bzr push --create-prefix sftp://
Please rename ~/.bazaar/
$ bzr push --create-prefix sftp://
Please rename ~/.bazaar/
bzr: ERROR: Permission denied: u'~fdsjkfsdk': [Errno 13] Branches must be inside a person or team directory.
There's maybe room for improvement (maybe it would be nice if bzr reported which specific operation was denied permission), but certainly the server is doing the right thing.
| Changed in launchpad-bazaar: | |
| status: | Fix Committed → Fix Released |
| Andrew Bennetts (spiv) wrote : | #3 |
I mis-pasted the second example of the new behaviour. Here's what it actually does:
$ bzr push --create-prefix sftp://
bzr: ERROR: Permission denied: '/~spiv/
| Wouter van Heyst (larstiq) wrote : | #4 |
When pushing to other people, I just get:
bzr: ERROR: Parent directory of sftp://
Which is not strictly true, but I'm not a member so it doesn't show up in sftp. Can this be improved?
| Andrew Bennetts (spiv) wrote : | #5 |
It is strictly true, for appropriate definitions of "exist" :)
In effect, every user will see a filesystem unique to them when they login to sftp://
That said, it would be possible to change the message issued when a client tries to mkdir /~something to be "You are not a member of the 'something' team." But that's a out of scope for this bug -- please file a seperate bug for that (and for other improvements you'd like to see).

From skimming the relevant code in the server, and in bzr and paramiko, this looks like it's close to working (if it doesn't already). I think it just needs a newer Twisted in the SFTP server.
We should write some tests that this works with the bzr client talking to our SFTP server.