Opened 4 years ago

Last modified 3 days ago

#11081 new defect

AssertionError moving to page 3 on the Configuration Wizard

Reported by: rjollos Owned by:
Priority: normal Component: AccountManagerPlugin
Severity: normal Keywords:
Cc: Trac Release:


I'm trying out the Configuration Wizard. This is a fresh install of Trac 0.11. I haven't kept up enough with recent development to know what is the typical use-case you expect, so I tried a few different ways. I've run into a few different issues, and it could be user error, but I will create a separate ticket for each in order to keep things straight (and they will be easier to close as invalid if I'm off-base).

I enabled what I thought would be the minimal set of required components (which was just a guess): acct_mgr.admin and acct_mgr.api. Well, it wasn't exactly a guess, as I noticed those two are the minimal set of components required to have the Configuration and Users WebAdmin panels to appear in the sidebar.

I accepted the defaults on page 1 and page 2. On page 2, I did not see a warning about SessionStore not being enabled this first time through (I started with a fresh install a few times to confirm this). After clicking next on page 2, I see an AssertionError:

How to Reproduce

While doing a POST operation on /admin/accounts/config, Trac issued an internal error.

(please provide additional details here)

Request parameters:

{'__FORM_TOKEN': u'6d4d48bcf3537892b4a7e899',
 'active': u'1',
 'cat_id': u'accounts',
 'etc_cfg': u'[account-manager]\r\nauth_url =\r\npassword_store = HttpAuthStore\r\n\r\n[components]\r\nacct_mgr.http.HttpAuthStore = enabled',
 'init_store': u'db',
 'init_store_file': u'htdigest',
 'next': u'Next',
 'panel_id': u'config',
 'path_info': None}

User Agent was: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.22 (KHTML, like Gecko) Ubuntu Chromium/25.0.1364.160 Chrome/25.0.1364.160 Safari/537.22

System Information

Trac 0.11
Python 2.7.3 (default, Aug 1 2012, 05:16:07)
[GCC 4.6.3]
setuptools 0.6
SQLite 3.7.9
pysqlite 2.6.0
Genshi 0.6
jQuery: 1.2.3

Python Traceback

Traceback (most recent call last):
  File "/home/user/Workspace/th11081/trac-0.11/trac/web/", line 423, in _dispatch_request
  File "/home/user/Workspace/th11081/trac-0.11/trac/web/", line 197, in dispatch
    resp = chosen_handler.process_request(req)
  File "/home/user/Workspace/th11081/trac-0.11/trac/admin/", line 109, in process_request
  File "/home/user/Workspace/trachacks.git/accountmanagerplugin/trunk/acct_mgr/", line 226, in render_admin_panel
    return self._do_config(req)
  File "/home/user/Workspace/trachacks.git/accountmanagerplugin/trunk/acct_mgr/", line 331, in _do_config
    assert is_enabled(env, SessionStore)

Whatever is the use-case, I'm imaging that either a warning should be shown about SessionStore not being enabled and I should be blocked from going on to page 3, or SessionStore should be automatically enabled for me when transitioning to page 3.

Attachments (2)

Step2.png (62.9 KB) - added by rjollos 4 years ago.
ConfigurationError.png (10.0 KB) - added by rjollos 3 years ago.

Download all attachments as: .zip

Change History (7)

Changed 4 years ago by rjollos

comment:1 Changed 4 years ago by rjollos

I also get the AssertionError if I hit Apply Changes. The message that says "Please apply these default options first" - does that mean that I should edit trac.ini to apply them, or apply them via Apply Changes?

Changed 3 years ago by rjollos

comment:2 Changed 3 years ago by rjollos

I've run through this scenario again recently, and I think I have a better handle on it.

With Trac 1.0.2dev (after the changes in trac:#10285), and a default configuration, the following components must be enabled when starting the configuration wizard:

acct_mgr.admin.accountmanageradminpanel = enabled
acct_mgr.api.accountmanager = enabled
acct_mgr.register.basiccheck = enabled
acct_mgr.register.bottrapcheck = enabled
acct_mgr.register.emailcheck = enabled
acct_mgr.register.regexpcheck = enabled
acct_mgr.register.usernamepermcheck = enabled

The latter 5 components are needed to avoid an error which is raised because the default value for [trac] register_check is BasicCheck, EmailCheck, BotTrapCheck, RegExpCheck, UsernamePermCheck, and the components in an OrderedExtensionOption must be enabled after the changes in trac:#10285.

It seems like the most straightforward solution to the exception that is encountered when moving to page 3 of the configuration wizard is to remove the assertions that these components are enabled, because they will be enabled as soon as the configuration is saved. I think that is the best solution unless you intend users to have the configuration [components] acct_mgr.* = enabled when starting the configuration wizard. However, for reasons I can't remember at the moment, enabling all the components seems to cause problems due to some components clashing with one another (or at least did in a previous version of AccountManagerPlugin). I'll explore the latter issue if you can confirm that [components] acct_mgr.* = enabled should be allowed.

Either way, we should document what the "starting configuration" should be when the user will invoke the configuration wizard, in terms of which components should be enabled. Is that:

acct_mgr.* = enabled

... or the 7 components listed above?

Last edited 3 years ago by rjollos (previous) (diff)

comment:3 Changed 3 years ago by hasienda

When developing the new configuration code I hoped to find a way for loading components at run-time without restarting Trac, without loosing configuration changes that have not yet been written to trac.ini. Reading the component manager code I believe, that there is such a way, but until now I couldn't find something similar in the Trac world. So it might be better to go the "enable-everything" way for initial configuration than staying with the current situation.

comment:4 Changed 2 years ago by hasienda

#12016 has been closed as a duplicate of this ticket.

comment:5 Changed 3 days ago by rjollos

  • Owner hasienda deleted

Add Comment

Modify Ticket

as new The ticket will remain with no owner.

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

Note: See TracTickets for help on using tickets.