file URLs built incorrectly (perhaps mod_proxy interaction?)

Bug #325505 reported by Karl Fogel
4
Affects Status Importance Assigned to Milestone
loggerhead
New
Undecided
Unassigned

Bug Description

With Loggerhead 1.10, browsing to a path or rev within a branch can fail, apparently because loggerhead tries build complete URLs (with host and port information) while running behind Apache mod_proxy.

If the reproduction recipe below isn't enough to point to the source of the problem, let me know; I can try to reproduce it with my own httpd setup. This recipe just demonstrates the problem using savannah.gnu.org, as described in https://savannah.gnu.org/support/index.php?106612#comment18 (the http config block for the loggerhead "lh" namespace is given there).

To reproduce, go to:

   http://bzr.savannah.gnu.org/lh/

Then click on "gnash", which should successfully bring you here:

  http://bzr.savannah.gnu.org/lh/gnash/files

Then click on "README", which fails because it tries this URL:

   http://bzr.savannah.gnu.org:8080/lh/gnash/annotate/head:/README

(The other files there have similar problems.)

To see that the problem is not about file-vs-directory, go back to the original URL:

   http://bzr.savannah.gnu.org/lh/

Then click on "gnujump":

   http://bzr.savannah.gnu.org/lh/gnujump/

Then click on "trunk":

   http://bzr.savannah.gnu.org/lh/gnujump/trunk/files

Then try any of the subdirectories that appear at the top of the listing there, such as "doc" or "src":

   http://bzr.savannah.gnu.org:8080/lh/gnujump/trunk/files/head:/doc/
   http://bzr.savannah.gnu.org:8080/lh/gnujump/trunk/files/head:/src/

The problem happens for them too. (Also, I wonder why clicking on "trunk" while in "gnujump" extended the URL by "trunk/files" instead of just by "trunk", but I'm not sure that's related to this problem.)

By the way, the same problem exists for revisions. This is the "35" next to the subdir "doc":

   http://bzr.savannah.gnu.org:8080/lh/gnujump/trunk/revision/35

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Well, it's demonstrably possible to do this right, because we do it on launchpad :)

Questions that spring to mind:

1) how are you starting loggerhead?
2) is paste.deploy installed? if so, what version?

Revision history for this message
Karl Fogel (kfogel) wrote :

In http://bazaar.launchpad.net/~loggerhead-team/loggerhead/trunk/revision/264 Michael Hudson committed a fix that at least causes Loggerhead's serve-branches to make a noise if paste.deploy is not installed *and* HTTP_X_FORWARDED_SERVER is set in the environment.

That doesn't necessarily fix this bug, but it makes it easier to detect an installation issue that could be the cause of this bug.

Revision history for this message
Sylvain Beucler (beuc) wrote :

1) how are you starting loggerhead?

Like this:
https://bugs.launchpad.net/ubuntu/+source/loggerhead/+bug/317843

2) is paste.deploy installed? if so, what version?

Yes, Etch's (1.0).

Revision history for this message
Ian Brandt (ian-ianbrandt) wrote :

Greetings. This bug was marked a duplicate of bug #305995, but then that bug was marked invalid for other reasons. https://bugs.launchpad.net/loggerhead/+bug/305995/comments/11 says, "I don't really care about the links thing, so you can file that bug if you do..."

How about using this issue to carry the torch for the absolute URLs issue? It is also referenced in bug #333755, and question #45503.

For now I am working around it with mod_proxy_html, but that is less than ideal. I'm afraid I'm not familiar with Paste at all, but in general to be a good proxy citizen a web app should use relative links exclusively in the HTML, CSS, JavaScript, etc. The HTTP Location header (i.e. redirect) is a notable exception. That should be absolute per rfc2616, but mod_proxy handles those just fine with ProxyPassReverse.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Ian, bugs are cheap. Please file a new one for your issue.

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.