Opened 9 years ago

Closed 6 weeks ago

#3521 closed defect (wontfix)

Internal Error when logged out

Reported by: cgaert@… Owned by: tsooboi
Priority: normal Component: NavControlPlugin
Severity: minor Keywords:
Cc: Trac Release: 0.11


When I have the NavControlPlugin enabled and am not logged in I get this error on every page I try to load:

Trac detected an internal error: KeyError: 'mainnav'

That's another message on the error page (here I tried to load the login page):

The action that triggered the error was: GET: /login

I don't have the problem when I'm logged in. I use the AccountManagerPlugin with HtPasswdStore. Because I can't load the login page I can't login hence can't use Trac.

Attachments (0)

Change History (7)

comment:1 in reply to:  description Changed 9 years ago by tsooboi

Status: newassigned

Replying to

Can you provide your configuration setup and permissions for anonymous? I have this setup and it works without any problems when I'm either logged in or logged out. I also use the AccountManagerPlugin with HtPasswdStore.


comment:2 Changed 9 years ago by cgaert

anonymous hasn't any permissions because it's a private Trac installation.

comment:3 in reply to:  2 Changed 9 years ago by tsooboi

Priority: highlow
Resolution: invalid
Severity: blockertrivial
Status: assignedclosed

I tried this. I removed all permissions for anonymous in my private setup and disabled my plugin and got the same error.

This has nothing to do with my plugin.

You should enable WIKI_VIEW permission for anonymous to your trac setup.

  • trac-admin in interactive mode
    trac-admin /path/to/your/private/trac
  • !add the permission as follows:
    permission add anonymous WIKI_VIEW

This should enable you to go to the login page.

Again, it has nothing to do with the plugin. Thanks

comment:4 Changed 9 years ago by tsooboi

Priority: lownormal
Resolution: invalid
Severity: trivialminor
Status: closedreopened

Reopened because after further testing.

A quick fix will be to enable WIKI_VIEW for anonymous but I will take a look to see if there are other ways.


comment:5 Changed 9 years ago by cgaert

Thanks, this helps.

I use the PrivateWikiPlugin and set WikiStart as private. Now I can give WIKI_VIEW permissions to anonymous. With these settings anonymous will not be able to see the Wiki but the login page. Now everything works as I expected.

comment:6 Changed 9 years ago by Pedro Paixao

if you change your post_process_request to

def post_process_request(self, req, template, data, content_type):
        if req.authname == 'anonymous':
            return template, data, content_type
        self._remove_items(req, 'mainnav')
        self._remove_items(req, 'metanav')    
        self._move_items(req, 'main2meta')
        self._move_items(req, 'meta2main')
        return template, data, content_type

then the WIKI_VIEW permissions are not needed to login if you're using the AccountManagerPlugin. I also use the PermRedirectPlugin to redirect all permission errors to the login page.

comment:7 Changed 6 weeks ago by Ryan J Ollos

Resolution: wontfix
Status: reopenedclosed

Plugin is deprecated.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain tsooboi.
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.