bzr does not indicate that it's following redirects

Bug #271573 reported by David Cournapeau
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned
Launchpad itself
Invalid
Medium
Unassigned

Bug Description

I tried the following:

bzr branch http://bazaar.launchpad.net/~david-ar/vbem/trunk

Which returns:

bzr: ERROR: Not a branch: "https://code.launchpad.net/".

The error does seem bogus. The full log:

0.062 encoding stdout as sys.stdout encoding 'UTF-8'
0.063 bzr arguments: [u'branch', u'http://bazaar.launchpad.net/~david-ar/vbem/trunk']
0.063 looking for plugins in /home/cournapeau/.bazaar/plugins
0.066 looking for plugins in /export/bbc8/local/lib/python2.4/site-packages/bzrlib/plugins
0.067 Plugin name __init__ already loaded
0.067 Plugin name __init__ already loaded
0.141 looking for plugins in /usr/lib/python2.4/site-packages/bzrlib/plugins
0.152 encoding stdout as sys.stdout encoding 'UTF-8'
0.182 failed to import pycurl: No module named pycurl
0.182 failed to instantiate transport <bzrlib.registry._LazyObjectGetter object at -48519fd4, module='bzrlib.transport.http._pycurl' attribute='PyCurlTransport'> for 'http://bazaar.launchpad.net/~david-ar/vbem/trunk': <bzrlib.errors.DependencyNotPresent instance at 0xb7909bec>
0.763 Traceback (most recent call last):
  File "/home/cournapeau/local/stow/bzr-1.6.1/lib/python2.4/site-packages/bzrlib/commands.py", line 857, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/home/cournapeau/local/stow/bzr-1.6.1/lib/python2.4/site-packages/bzrlib/commands.py", line 797, in run_bzr
    ret = run(*run_argv)
  File "/home/cournapeau/local/stow/bzr-1.6.1/lib/python2.4/site-packages/bzrlib/commands.py", line 499, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/cournapeau/local/stow/bzr-1.6.1/lib/python2.4/site-packages/bzrlib/builtins.py", line 839, in run
    accelerator_tree, br_from = bzrdir.BzrDir.open_tree_or_branch(
  File "/home/cournapeau/local/stow/bzr-1.6.1/lib/python2.4/site-packages/bzrlib/bzrdir.py", line 878, in open_tree_or_branch
    bzrdir = klass.open(location)
  File "/home/cournapeau/local/stow/bzr-1.6.1/lib/python2.4/site-packages/bzrlib/bzrdir.py", line 756, in open
    return BzrDir.open_from_transport(t, _unsupported=_unsupported)
  File "/home/cournapeau/local/stow/bzr-1.6.1/lib/python2.4/site-packages/bzrlib/bzrdir.py", line 793, in open_from_transport
    redirected)
  File "/home/cournapeau/local/stow/bzr-1.6.1/lib/python2.4/site-packages/bzrlib/lazy_import.py", line 125, in __call__
    return obj(*args, **kwargs)
  File "/home/cournapeau/local/stow/bzr-1.6.1/lib/python2.4/site-packages/bzrlib/transport/__init__.py", line 1620, in do_catching_redirections
    transport = redirected(transport, e, redirection_notice)
  File "/home/cournapeau/local/stow/bzr-1.6.1/lib/python2.4/site-packages/bzrlib/bzrdir.py", line 777, in redirected
    raise errors.NotBranchError(path=e.target)
NotBranchError: Not a branch: "https://code.launchpad.net/".

0.763 return code 3

This may be a launchpad problem, though:

bzr branch http://code.launchpad.net/~david-ar/vbem/trunk

Gives me an error which is now understandable (the trunk branch does not exist):

bzr: ERROR: Not a branch: "https://code.launchpad.net/~david-ar/vbem/trunk/".

description: updated
description: updated
Revision history for this message
Andrew Bennetts (spiv) wrote :

The issue here is that http://bazaar.launchpad.net/~david-ar/vbem/trunk/.bzr redirects you to https://code.launchpad.net/, so bzr follows the redirect, then finds that the new URL is not a branch.

It's pretty weird that http://bazaar.launchpad.net/~david-ar/vbem/trunk/ is a 404, while http://bazaar.launchpad.net/~david-ar/vbem/trunk/.bzr is a redirect. I think the bazaar.launchpad.net webserver should probably not redirect in the latter case. A link to https://code.launchpad.net/ on the 404 page probably satisfies whatever need the redirect serves.

Also, bzr should be clearer about what's going on. It should tell the user that it's following a redirect, and then the error message will make sense.

Vincent Ladeuil (vila)
Changed in bzr:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Jonathan Lange (jml) wrote :

Weird. This is probably an accidental side-effect of our rewriting rules. Assigning to thumper who just loves this sort of thing.

Changed in launchpad-bazaar:
assignee: nobody → thumper
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Tim Penhey (thumper) wrote :

There has been changes in this area recently.

Is there still a problem?

Changed in launchpad-bazaar:
assignee: thumper → nobody
status: Triaged → Incomplete
Revision history for this message
David Cournapeau (david-ar) wrote :

No, it looks like the error message is the correct one. Thanks

Revision history for this message
David Cournapeau (david-ar) wrote :

I forgot to add that I was using bzr 1.11 from the PPA (if anyone else wonder which version works).

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

It's not mentioned elsewhere in the bug report, so I'll mention it here lp:~david-ar/vbem/trunk is not a branch. lp:~david-ar/vbem/main *is*. The "Not a branch" part of the error is perfectly acceptable. The "https://code.launchpad.net" part is not. This bug has nothing to do with https proxies.

As spiv points out, Launchpad's redirection behaviour here is sub-par. I've filed bug 348749 for it and have closed off the launchpad-bazaar part of this bug. Andre

Changed in launchpad-bazaar:
status: Incomplete → Invalid
summary: - bzr cannot access launchpad branch behind https proxy
+ bzr does not indicate that it's following redirects
Revision history for this message
Jonathan Lange (jml) wrote :

OK. It *is* mentioned, but I didn't see it :)

Martin Pool (mbp)
Changed in bzr:
status: Triaged → Confirmed
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.