Opened 17 years ago
Closed 15 years ago
#1771 closed defect (worksforme)
"The page isn't redirecting properly" Error
Reported by: | anonymous | Owned by: | Anton Graham |
---|---|---|---|
Priority: | normal | Component: | AuthRequiredPlugin |
Severity: | major | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
As of 0.3 I am getting a bad redirection error. I am using trac 10.4 and firefox.
My trac is installed at: http://mywebhost/trac/imasys/
When I hit the url, the address bar says this: http://mywebhost/trac/imasys/trac/imasys/login?referer=http%3A%2F%2Fgamma.ima.museum%2Ftrac%2Fimasys%2Ftrac%2Fimasys%2Flogin
Attachments (0)
Change History (13)
comment:1 Changed 17 years ago by
Cc: | cwmoad@… added; anonymous removed |
---|
comment:2 Changed 17 years ago by
Cc: | anonymous added; cwmoad@… removed |
---|
comment:3 Changed 17 years ago by
comment:5 Changed 17 years ago by
This line seems to be the culprit for me:
req.redirect(self.env.href(req.href.login(), {'referer':req.abs_href(req.path_info)}))
"req.href.login()" returns "/trac/imasys/login" and the "self.env.href" function appends an additional "/trac/imasys" to the beginning of the url. I am not sure what configuration problem could be causing the error. I just changed the above line to:
req.redirect(self.env.href('login/', {'referer':req.abs_href(req.path_info)}))
... and it works for me. This might be accounting for my "misconfiguration" though.
Thoughts?
comment:6 Changed 17 years ago by
This sounds plausible. In order to determine possible configuration issues I will need some information. (Essentially, before I decide that this is indeed broken, I need to be certain that there isn't a configuration issue causing this.)
What I need are the sections of your httpd.conf responsible for serving trac (everything in the <Location (trac_location)/> ... </Location>) and the [project] and [trac] sections of your trac.ini.
I do not currently have anyplace to set up a test trac to debug this issue, so will be somewhat dependant on you and the reporter of #1777 to test :/
comment:7 Changed 17 years ago by
http.conf
<Location "/trac"> SetHandler mod_python PythonHandler trac.web.modpython_frontend PythonOption TracEnvParentDir /var/lib/trac PythonOption TracUriRoot /trac </Location>
Project config
[project] descr = Systems information for the ***********************. footer = Visit the Trac open source project at<br /><a href="http://trac.edgewall.org/">http://trac.edgewall.org/</a> icon = /ima-logo.ico name = IMA System Information url = http://*****.***.******/trac/imasys
Trac config
[trac] authz_file = authz_module_name = base_url = http://*****.***.******/trac/imasys check_auth_ip = true database = sqlite:db/trac.db default_charset = iso-8859-15 default_handler = WikiModule htdocs_location = ignore_auth_case = false mainnav = wiki,timeline,roadmap,browser,tickets,newticket,search metanav = login,logout,settings,help,about permission_store = DefaultPermissionStore repository_dir = /var/lib/svn/ima repository_type = svn timeout = 20
comment:8 Changed 17 years ago by
Okay, I've managed to take a look at this. Please try the following:
-
0.10/tracauthrequired/authrequired.py
54 54 self.log.debug('Redirecting anonymous request to /login') 55 55 #req.redirect(req.href.login()) 56 56 # Testing new redirect syntax. Thanks to jfernandez@ist.psu.edu 57 req.redirect( self.env.href(req.href.login(), {'referer':req.abs_href(req.path_info)}))57 req.redirect(req.href.login(), {'referer':req.abs_href(req.path_info)}) 58 58 return [] # We don't really get here, but what the heck...
While your workaround works, we don't really want to hardcode /login as it is possible that some patch, future update, or another plugin could change the login url from /login. I have verified that the above does work in trac installs on the root of the vhost (i.e. https://trac.example.org/)
comment:9 Changed 17 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
The hard-code was my quick check. Your patch works fine.
Thanks,
Charlie
comment:10 Changed 17 years ago by
comment:11 Changed 16 years ago by
In 0.11, this line should be:
- req.redirect(req.href.login(), {'referer':req.abs_href(req.path_info)}) + req.redirect(req.href.login(referer = req.abs_href(req.path_info)))
comment:12 Changed 15 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Trac Release: | 0.10 → 0.11 |
I am having this same problem, but cannot find "tracauthrequired/authrequired.py" to make the change. I started with vers 10.4 and upgraded to vers 11.
Any ideas where this file is located?
Thanks,
S
comment:13 Changed 15 years ago by
Resolution: | → worksforme |
---|---|
Status: | reopened → closed |
nm, I fixed, recreated the user's acct.
thanks anyway.
S
This looks like a trac configuration error. The plugin's redirect redirects to the trac installation's login page. This type of error can be a result of incorrect Apache configuration and/or errors in trac.ini.
Please uninstall the plugin and click the login link in the navigation contributors. I suspect you will get the same result.