Modify

Opened 11 years ago

Last modified 7 years ago

#11081 new defect

AssertionError moving to page 3 on the Configuration Wizard

Reported by: Ryan J Ollos Owned by:
Priority: normal Component: AccountManagerPlugin
Severity: normal Keywords:
Cc: Trac Release:

Description

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/main.py", line 423, in _dispatch_request
    dispatcher.dispatch(req)
  File "/home/user/Workspace/th11081/trac-0.11/trac/web/main.py", line 197, in dispatch
    resp = chosen_handler.process_request(req)
  File "/home/user/Workspace/th11081/trac-0.11/trac/admin/web_ui.py", line 109, in process_request
    path_info)
  File "/home/user/Workspace/trachacks.git/accountmanagerplugin/trunk/acct_mgr/admin.py", line 226, in render_admin_panel
    return self._do_config(req)
  File "/home/user/Workspace/trachacks.git/accountmanagerplugin/trunk/acct_mgr/admin.py", line 331, in _do_config
    assert is_enabled(env, SessionStore)
AssertionError


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 Ryan J Ollos 11 years ago.
ConfigurationError.png (10.0 KB) - added by Ryan J Ollos 10 years ago.

Download all attachments as: .zip

Change History (7)

Changed 11 years ago by Ryan J Ollos

Attachment: Step2.png added

comment:1 Changed 11 years ago by Ryan J Ollos

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 10 years ago by Ryan J Ollos

Attachment: ConfigurationError.png added

comment:2 Changed 10 years ago by Ryan J Ollos

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:

[components]
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:

[components]
acct_mgr.* = enabled

... or the 7 components listed above?

Last edited 10 years ago by Ryan J Ollos (previous) (diff)

comment:3 Changed 10 years ago by Steffen Hoffmann

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 9 years ago by Steffen Hoffmann

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

comment:5 Changed 7 years ago by Ryan J Ollos

Owner: Steffen Hoffmann deleted

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.

Add Comment


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

 
Note: See TracTickets for help on using tickets.