branch redirect points to internal id url

Bug #340354 reported by Martin Pool on 2009-03-10
2
Affects Status Importance Assigned to Milestone
Launchpad itself
High
Unassigned

Bug Description

mbp@lithe% curl -v http://bazaar.launchpad.net/~mbp/bzr/progress/.bzr/branch/lock
* About to connect() to bazaar.launchpad.net port 80 (#0)
* Trying 91.189.90.11... connected
* Connected to bazaar.launchpad.net (91.189.90.11) port 80 (#0)
> GET /~mbp/bzr/progress/.bzr/branch/lock HTTP/1.1
> User-Agent: curl/7.18.2 (i486-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.10
> Host: bazaar.launchpad.net
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Date: Tue, 10 Mar 2009 07:13:25 GMT
< Server: Apache/2.2.8 (Ubuntu) mod_ssl/2.2.8 OpenSSL/0.9.8g
< Location: http://bazaar.launchpad.net/00/00/94/67/.bzr/branch/lock/
< Content-Length: 379
< Content-Type: text/html; charset=iso-8859-1
< Via: 1.1 bazaar.launchpad.net
<
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://bazaar.launchpad.net/00/00/94/67/.bzr/branch/lock/">here</a>.</p>
<hr>
<address>Apache/2.2.8 (Ubuntu) mod_ssl/2.2.8 OpenSSL/0.9.8g Server at bazaar.launchpad.net Port 80</address>
</body></html>
* Connection #0 to host bazaar.launchpad.net left intact
* Closing connection #0

Paul Hummer (rockstar) wrote :

jml and/or mwhudson, can either of you comment on the severity of this bug?

I don't think it's very urgent as I only hit it when debugging something else.

On 3/11/09, Paul Hummer <email address hidden> wrote:
> jml and/or mwhudson, can either of you comment on the severity of this
> bug?
>
> --
> branch redirect points to internal id url
> https://bugs.launchpad.net/bugs/340354
> You received this bug notification because you are a direct subscriber
> of the bug.
>
>

--
Martin <http://launchpad.net/~mbp/>

Jonathan Lange (jml) wrote :

Except that I would have said this was impossible.

Changed in launchpad-bazaar:
importance: Undecided → Medium
status: New → Triaged
Martin Pool (mbp) wrote :

I just hit this again, also while debugging something else

In [7]: t.has('.bzr')
---------------------------------------------------------------------------
RedirectRequested Traceback (most recent call last)

/home/mbp/bzr/doc/<ipython console> in <module>()

/home/mbp/bzr/doc/bzrlib/transport/http/_urllib.py in has(self, relpath)
    155 """Does the target location exist?
    156 """
--> 157 response = self._head(relpath)
    158
    159 code = response.code

/home/mbp/bzr/doc/bzrlib/transport/http/_urllib.py in _head(self, relpath)
    148 request = Request('HEAD', abspath,
    149 accepted_errors=[200, 404])
--> 150 response = self._perform(request)
    151
    152 return response

/home/mbp/bzr/doc/bzrlib/transport/http/_urllib.py in _perform(self, request)
     92 raise errors.RedirectRequested(request.get_full_url(),
     93 request.redirected_to,
---> 94 is_permanent=(code == 301))
     95
     96 if request.redirected_to is not None:

RedirectRequested: http://bazaar.launchpad.net/%7Embp/bzr/doc/.bzr is permanently redirected to http://bazaar.launchpad.net/00/00/8c/55/.bzr/

In [8]: t
Out[8]: <bzrlib.transport.http._urllib.HttpTransport_urllib url=http://bazaar.launchpad.net/%7Embp/bzr/doc/>

This seems to be with Apache's builtin behaviour that if foo is a directory and you ask for '/foo' you immediately get a redirect to '/foo/', and that's interacting somehow with the redirect map.

It's a bit bad that Launchpad gives out redirects to URLs which are then not accepted. (They're not actually 404; they give you a redirection back to the home page which is in some ways more confusing.)

Changed in launchpad:
importance: Medium → High
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers