Opened 10 years ago

Closed 7 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


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?

Attachments (0)

Change History (13)

comment:1 Changed 10 years ago by anonymous

Cc: cwmoad@… added; anonymous removed

comment:2 Changed 10 years ago by cwmoad@…

Cc: anonymous added; cwmoad@… removed

comment:3 Changed 10 years ago by anonymous

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.

comment:4 Changed 10 years ago by Anton Graham

Err.. The above was me

comment:5 Changed 10 years ago by cwmoad@…

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.


comment:6 Changed 10 years ago by Anton Graham

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 10 years ago by cwmoad@…


<Location "/trac">
  SetHandler mod_python
  PythonHandler trac.web.modpython_frontend
  PythonOption TracEnvParentDir /var/lib/trac
  PythonOption TracUriRoot /trac

Project config

descr = Systems information for the ***********************.
footer = Visit the Trac open source project at<br /><a href=""></a>
icon = /ima-logo.ico
name = IMA System Information
url = http://*****.***.******/trac/imasys

Trac config

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 10 years ago by Anton Graham

Okay, I've managed to take a look at this. Please try the following:

  • 0.10/tracauthrequired/

    5454        self.log.debug('Redirecting anonymous request to /login')
    5555        #req.redirect(req.href.login())
    5656        # Testing new redirect syntax.  Thanks to
    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)})
    5858        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.

comment:9 Changed 10 years ago by cwmoad@…

Resolution: fixed
Status: newclosed

The hard-code was my quick check. Your patch works fine.



comment:10 Changed 10 years ago by Anton Graham

(In [2462]) Removed spurious self.env.href() that caused redirection issues on trac installation not at root of vhost. (fixes #1771)

comment:11 Changed 9 years ago by Richard Liao

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 7 years ago by sdistefano@…

Resolution: fixed
Status: closedreopened
Trac Release: 0.100.11

I am having this same problem, but cannot find "tracauthrequired/" to make the change. I started with vers 10.4 and upgraded to vers 11.

Any ideas where this file is located?



comment:13 Changed 7 years ago by anonymous

Resolution: worksforme
Status: reopenedclosed

nm, I fixed, recreated the user's acct.

thanks anyway.


Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Anton Graham.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.