Better error messages for bzr lp://

Bug #93609 reported by Jonathan Lange
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned
Breezy
Triaged
Low
Unassigned
Launchpad itself
Triaged
Low
Unassigned

Bug Description

We'd like to have clear error messages for lp://. JML suggested the following test cases:
jml@rhino:~$ bzr branch lp:no-such-project
bzr: ERROR: Not a branch: http://code.launchpad.net/no-such-project/
jml@rhino:~$ bzr branch lp://subunit
bzr: ERROR: Invalid url supplied to transport: 'lp://subunit'
jml@rhino:~$ bzr branch lp:subunit/fix-stdout
bzr: ERROR: Not a branch: http://code.launchpad.net/subunit/fix-stdout/
jml@rhino:~$ bzr branch lp:~exarkun/subunit/fix-stdout
bzr: ERROR: Not a branch: http://code.launchpad.net/~exarkun/subunit/fix-stdout/
jml@rhino:~/Code/Subunit/trunk$ bzr push lp:subunit/new-branch
bzr: ERROR: Transport operation not possible: http does not support mkdir()

We should add in ones for
branch lp:ubuntu/nopackage
branch lp:ubuntu/maverick/nopackage
push lp:ubuntu/natty/package-which-failed-import
log lp:ubuntu/apport/ChangeLog (or similar - a sub-path query into the repo)

The current design situation is this:
 the lp: xmlrpc lookup handles aliased branches (that is product, product-series and package-without-distro urls by generating a link to +branches/, which is then resolved by the smart server over bzr+ssh (or http) using a backend translatePath API.

This API can return informative errors, but the codehosting server is having them squashed into a VFS model because BzrDir.open2.1 (and similar) delegate to the regular BzrDir ControlDir implementation.

If we install a custom BzrDir.open verb (and other similar ones) then we can directly call the translatePath API and only if it succeeds delegate to the regular BzrDir ControlDir implementation.

If translatePath returns an error we can wrap that in FileNotFound for returning to the bzr client; the bzr client should show that error (and we can make sure it does) to the user, including the custom message translatePath generates.

This may require some detailed knowledge of bzr internals <-> codehosting glue.

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

Right, the error messages should be improved.

It's not clear to me what would be the best way, since the current lp:// scheme just builds on the existing branch-reference redirection built into the launchpad webapp. Setting to Medium importance out of indecision.

Changed in launchpad-bazaar:
importance: Undecided → Medium
status: Unconfirmed → Confirmed
Revision history for this message
Jonathan Lange (jml) wrote :

This should be fixed by the recent lp:/// work. Assigning to myself so I can confirm during this release.

Changed in launchpad-bazaar:
assignee: nobody → jml
milestone: none → 1.1.12
Revision history for this message
Jonathan Lange (jml) wrote :

Here's how it behaves now.

jml@rhino:~/Desktop/muckaround$ bzr branch lp:no-such-project
bzr: ERROR: Invalid url supplied to transport: "lp:no-such-project": No such product: no-such-project
jml@rhino:~/Desktop/muckaround$ bzr branch lp:///no-such-project
bzr: ERROR: Invalid url supplied to transport: "lp:///no-such-project": No such product: no-such-project
jml@rhino:~/Desktop/muckaround$ bzr branch lp://no-such-project
bzr: ERROR: Invalid url supplied to transport: "lp://no-such-project"
jml@rhino:~/Desktop/muckaround$ bzr branch lp://python
bzr: ERROR: Invalid url supplied to transport: "lp://python"
jml@rhino:~/Desktop/muckaround$ bzr branch lp:///subunit/fix-stdout
bzr: ERROR: Invalid url supplied to transport: "lp:///subunit/fix-stdout": Project subunit has no series called "fix-stdout"
jml@rhino:~/Desktop/muckaround$ bzr branch lp:~exarkun/subunit/fix-stdout
lp:~exarkun/subunit/fix-stdout is redirected to bzr+ssh://<email address hidden>/~exarkun/subunit/fix-stdout/
Branched 46 revision(s)
$ cd fix-stdout
$ bzr push lp:///~jml/+junk/new-branch
lp:///~jml/+junk/new-branch is redirected to bzr+ssh://<email address hidden>/~jml/+junk/new-branch/
bzr: ERROR: lp:///~jml/+junk/new-branch is redirected to bzr+ssh://<email address hidden>/~jml/+junk/new-branch

Revision history for this message
Jonathan Lange (jml) wrote :

The recent lp:/// work does make this better, but it doesn't fix it. Specifically, there's no reference to a place to get help, and "bzr: ERROR: Invalid url supplied to transport:" doesn't _really_ add any value to the message that the user sees.

I think the correct fix is to define a special exception class for BadLaunchpadURL.

Note that the flaw in the 'cannot push to new branch' message will be corrected by making it possible to push to new branches.

Re-assigning to Bazaar, since that's where the code change needs to happen.

Changed in launchpad-bazaar:
milestone: 1.1.12 → none
Revision history for this message
Jonathan Lange (jml) wrote :

I'd completely forgotten about this bug. Not going to work on it for the foreseeable future.

tags: added: launchpad
Changed in bzr:
assignee: Jonathan Lange (jml) → nobody
Jonathan Lange (jml)
tags: added: lp-directory
Jonathan Lange (jml)
tags: added: lpurl
removed: lp-directory
description: updated
Revision history for this message
Martin Pool (mbp) wrote :

I think we also need to consider separately the cases of trying to create these locations vs trying to read from them.

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 93609] Re: Better error messages for bzr lp://

On Wed, Oct 13, 2010 at 2:20 PM, Martin Pool <email address hidden> wrote:
> I think we also need to consider separately the cases of trying to
> create these locations vs trying to read from them.

We do, which is why I included on-demand creation pushes in the use
cases, I wasn't particularly clear that I was doing that in hindsight.

Code wise I don't think anything special will be needed.

-Rob

Tim Penhey (thumper)
Changed in launchpad-code:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Jonathan Lange (jml) wrote :

Here's what I got on a recent run of the test "script" above:

$ bzr branch lp:no-such-project
bzr: ERROR: Not a branch: "bzr+ssh://bazaar.launchpad.net/%2Bbranch/no-such-project/".
$ bzr branch lp://no-such-project
bzr: ERROR: Invalid url supplied to transport: "lp://no-such-project"
$ bzr branch lp:subunit/python3
bzr: ERROR: Permission denied: "Cannot create 'python3'. Only Bazaar branches are allowed."
$ bzr branch lp:~jml/subunit/no-such-branch
bzr: ERROR: Not a branch: "bzr+ssh://bazaar.launchpad.net/~jml/subunit/no-such-branch/".
$ bzr branch lp:ubuntu/no-such-package
bzr: ERROR: Not a branch: "bzr+ssh://bazaar.launchpad.net/%2Bbranch/ubuntu/no-such-package/".
$ bzr branch lp:ubuntu/natty/no-such-package
bzr: ERROR: Not a branch: "bzr+ssh://bazaar.launchpad.net/%2Bbranch/ubuntu/natty/no-such-package/".

$ bzr init trunk
Created a standalone tree (format: 2a)
$ cd !$
cd trunk
/trunk$ bzr push lp:no-such-project
bzr: ERROR: Permission denied: "+branch/no-such-project/": : Project 'no-such-project' does not exist.
/trunk$ bzr push lp://no-such-project
bzr: ERROR: Invalid url supplied to transport: "lp://no-such-project"
/trunk$ bzr push lp:subunit/python3
bzr: ERROR: Permission denied: "Cannot create 'python3'. Only Bazaar branches are allowed."
/trunk$ bzr push lp:ubuntu/no-such-package
bzr: ERROR: Permission denied: "+branch/ubuntu/no-such-package/": : No such source package: 'no-such-package'.
/trunk$ bzr push lp:ubuntu/natty/no-such-package
bzr: ERROR: Permission denied: "+branch/ubuntu/natty/no-such-package/": : No such source package: 'no-such-package'.
/trunk$ bzr push lp:~jml/no-such-project/trunk
bzr: ERROR: Invalid url supplied to transport: "lp:~jml/no-such-project/trunk": No such project: no-such-project

Revision history for this message
Robert Collins (lifeless) wrote :

not currently scheduled in launchpad - putting it in low to reflect its backlogged status. Sorry about the noise on the bzr task, misclicked.

Changed in bzr:
importance: Medium → Low
importance: Low → Medium
Changed in launchpad:
importance: Medium → Low
Revision history for this message
Cris Dywan (kalikiana) wrote :

Some cents since I ran into a wall not understanding the error messages the other day, in particular (real names replaced):

bzr push lp:~pokemon/+bulbasaur
Working tree "/home/kalikiana/projects/bulbasaur/" has uncommitted changes (See bzr status). Uncommitted changes will not be pushed.
bzr: ERROR: Invalid url supplied to transport: "lp:~pokemon/+bulbasaur": No such project: %2Bbulbasaur
> bzr push lp:~pokemon/+dungeon/bulbasaur
Working tree "/home/kalikiana/projects/bulbasaur/" has uncommitted changes (See bzr status). Uncommitted changes will not be pushed.
bzr: ERROR: Access denied: »~pokemon/+dungeon/bulbasaur/«: : Project '+dungeon' does not exist.

After some explanations it turns out there's teams, groups and projects and teams can host code as projects can, and even if it may seem to be very clear, I didn't understand the error messages at all. The "invalid url" part was especially puzzling since I double-checked that the syntax is perfectly correct, except it shouldn't be used for a team.

It would help a lot if it gave better suggestions such as "there is a team, not a project, so maybe you wanted to push to +junk instead", which is what I was advised to do eventually.

Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
Jelmer Vernooij (jelmer)
Changed in brz:
status: New → Triaged
importance: Undecided → Low
tags: removed: 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.