My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 447: Permalinks don't send the user to the right place due to incorrect path
1 person starred this issue and may be notified of changes. Back to list
Status:  Invalid
Owner:  ----
Closed:  Feb 2010


Sign in to add a comment
 
Reported by mike.lifeguard@gmail.com, Feb 12, 2010
Affected Version: 2.1.1
Environment: Ubuntu (karmic)

What steps will reproduce the problem?
1. Set up gerrit behind a reverse proxy (apache)
2. Commit something
3. Follow the resultant permalink

The permalink needs to have the correct path. Instead of /gerrit/1 doing a
302 Found redirect to /gerrit/#q,1,n,z it redirects to the wrong place:
/#q,1,n,z - depending on the server, this could send the user not just to a
slightly wrong place, but to a totally different web app, or to a page
which cannot be resolved. See http://p.defau.lt/?ccnsLNAUaNxLBjTSEigKAQ to
see HTTP headers.

This probably has nothing to do with garret being behind a reverse proxy.
Feb 13, 2010
#1 sop@google.com
What are the following configuration settings?

  gerrit.canonicalWebUrl
  httpd.listenAddress

I haven't seen this behavior before, and I'm running Gerrit both at
the root of the server ("/") and within a subdirectory ("/r/", "/g/")
and none of those installations shows this problem.

For example:

  [gerrit]
	canonicalWebUrl = https://example.com/g/

  [httpd]
	listenUrl = proxy-https://localhost:8081/g

Feb 13, 2010
#2 sop@google.com
(No comment was entered for this change.)
Status: AwaitingInformation
Feb 13, 2010
#3 mike.lifeguard@gmail.com
[gerrit]
    canonicalWebUrl = http://host.com/gerrit/
[httpd]
    listenUrl = proxy-http://127.0.0.1:8080

Feb 13, 2010
#4 sop@google.com
Your httpd.listenUrl is the problem.  You need to give
Gerrit the context path you have mounted it at within
the web server URI space, otherwise it generates bad
URLs.  :-)

Change it to:

  [httpd]
    listenUrl = proxy-http://127.0.0.1:8080/gerrit

to match what your Apache server thinks it is, and what the
canonicalWebUrl thinks it is, and the redirect error should
go away.  I suspect you'll also need to change your ProxyPass
line in Apache to use /gerrit/ suffix on the right hand side.
Status: WontFix
Feb 13, 2010
#5 mike.lifeguard@gmail.com
This was resolved by adding the /gerrit suffix to listenUrl, and altering the
ProxyPass directive accordingly. Would you mind tweaking the docs to make this clearer?

This should be marked as invalid, but I don't see how to do so in this bug tracker.
Feb 13, 2010
#6 sop@google.com
I thought the docs were already pretty clear on this, but
if you have a suggestion on specific wording to insert, I
would appreciate it.

http://gerrit.googlecode.com/svn/documentation/2.1/config-apache2.html
Status: Invalid
Feb 13, 2010
#7 mike.lifeguard@gmail.com
Configure an Apache VirtualHost to proxy to the Gerrit daemon, setting the ProxyPass
line to use the http:// URL configured above. Ensure the path of ProxyPass and
httpd.listenUrl match, or links will redirect to incorrect locations.
Sign in to add a comment

Powered by Google Project Hosting