Disabling the gradebook breaks instances

Bug #717277 reported by Douglas Cerna
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SchoolTool Gradebook
Fix Released
Critical
Alan Elkner

Bug Description

Steps to reproduce:

1. Check out SchoolTool trunk
2. Add schooltool.gradebook to buildout
3. Make and run an instance
4. Start the server
5. Stop the server
6. Remove schooltool.gradebook from buildout and run buildout
7. Start the server

And you'll get:

---------- %< ----------
Traceback (most recent call last):
  File "bin/start-schooltool-instance", line 157, in <module>
    schooltool.paste.run.main()
  File "/home/replaceafill/.sandboxes/schooltool_docs/src/schooltool/paste/run.py", line 73, in main
    paste.script.command.run(['serve', conf_file] + extra_options)
  File "/home/replaceafill/.sandboxes/schooltool_docs/eggs/PasteScript-1.7.3-py2.6.egg/paste/script/command.py", line 84, in run
    invoke(command, command_name, options, args[1:])
  File "/home/replaceafill/.sandboxes/schooltool_docs/eggs/PasteScript-1.7.3-py2.6.egg/paste/script/command.py", line 123, in invoke
    exit_code = runner.run(args)
  File "/home/replaceafill/.sandboxes/schooltool_docs/eggs/PasteScript-1.7.3-py2.6.egg/paste/script/command.py", line 218, in run
    result = self.command()
  File "/home/replaceafill/.sandboxes/schooltool_docs/eggs/PasteScript-1.7.3-py2.6.egg/paste/script/serve.py", line 276, in command
    relative_to=base, global_conf=vars)
  File "/home/replaceafill/.sandboxes/schooltool_docs/eggs/PasteScript-1.7.3-py2.6.egg/paste/script/serve.py", line 313, in loadapp
    **kw)
  File "/home/replaceafill/.sandboxes/schooltool_docs/eggs/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/loadwsgi.py", line 204, in loadapp
    return loadobj(APP, uri, name=name, **kw)
  File "/home/replaceafill/.sandboxes/schooltool_docs/eggs/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/loadwsgi.py", line 225, in loadobj
    return context.create()
  File "/home/replaceafill/.sandboxes/schooltool_docs/eggs/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/loadwsgi.py", line 625, in create
    return self.object_type.invoke(self)
  File "/home/replaceafill/.sandboxes/schooltool_docs/eggs/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/loadwsgi.py", line 110, in invoke
    return fix_call(context.object, context.global_conf, **context.local_conf)
  File "/home/replaceafill/.sandboxes/schooltool_docs/eggs/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/util/fixtypeerror.py", line 57, in fix_call
    val = callable(*args, **kw)
  File "/home/replaceafill/.sandboxes/schooltool_docs/src/schooltool/paste/main.py", line 48, in schooltool_app_factory
    os.path.join(global_conf['here'], config_file))
  File "/home/replaceafill/.sandboxes/schooltool_docs/src/schooltool/paste/main.py", line 37, in __init__
    db = self.setup(options)
  File "/home/replaceafill/.sandboxes/schooltool_docs/src/schooltool/app/main.py", line 713, in setup
    notify(DatabaseOpened(db))
  File "/home/replaceafill/.sandboxes/schooltool_docs/eggs/zope.event-3.5.0_1-py2.6.egg/zope/event/__init__.py", line 23, in notify
    subscriber(event)
  File "/home/replaceafill/.sandboxes/schooltool_docs/eggs/zope.component-3.9.5-py2.6.egg/zope/component/event.py", line 24, in dispatch
    zope.component.subscribers(event, None)
  File "/home/replaceafill/.sandboxes/schooltool_docs/eggs/zope.component-3.9.5-py2.6.egg/zope/component/_api.py", line 136, in subscribers
    return sitemanager.subscribers(objects, interface)
  File "/home/replaceafill/.sandboxes/schooltool_docs/eggs/zope.component-3.9.5-py2.6.egg/zope/component/registry.py", line 321, in subscribers
    return self.adapters.subscribers(objects, provided)
  File "/home/replaceafill/.sandboxes/schooltool_docs/eggs/zope.interface-3.6.1-py2.6-linux-x86_64.egg/zope/interface/adapter.py", line 585, in subscribers
    subscription(*objects)
  File "/home/replaceafill/.sandboxes/schooltool_docs/eggs/zope.app.appsetup-3.14.0-py2.6.egg/zope/app/appsetup/bootstrap.py", line 175, in bootStrapSubscriber
    zope.event.notify(zope.processlifetime.DatabaseOpenedWithRoot(db))
  File "/home/replaceafill/.sandboxes/schooltool_docs/eggs/zope.event-3.5.0_1-py2.6.egg/zope/event/__init__.py", line 23, in notify
    subscriber(event)
  File "/home/replaceafill/.sandboxes/schooltool_docs/eggs/zope.component-3.9.5-py2.6.egg/zope/component/event.py", line 24, in dispatch
    zope.component.subscribers(event, None)
  File "/home/replaceafill/.sandboxes/schooltool_docs/eggs/zope.component-3.9.5-py2.6.egg/zope/component/_api.py", line 136, in subscribers
    return sitemanager.subscribers(objects, interface)
  File "/home/replaceafill/.sandboxes/schooltool_docs/eggs/zope.component-3.9.5-py2.6.egg/zope/component/registry.py", line 321, in subscribers
    return self.adapters.subscribers(objects, provided)
  File "/home/replaceafill/.sandboxes/schooltool_docs/eggs/zope.interface-3.6.1-py2.6-linux-x86_64.egg/zope/interface/adapter.py", line 585, in subscribers
    subscription(*objects)
  File "/home/replaceafill/.sandboxes/schooltool_docs/eggs/zope.app.appsetup-3.14.0-py2.6.egg/zope/app/appsetup/errorlog.py", line 35, in bootStrapSubscriber
    RootErrorReportingUtility, copy_to_zlog=False)
  File "/home/replaceafill/.sandboxes/schooltool_docs/eggs/zope.app.appsetup-3.14.0-py2.6.egg/zope/app/appsetup/bootstrap.py", line 77, in ensureUtility
    if (reg.provided.isOrExtends(interface) and reg.name == name)]
AttributeError: type object 'ICustomScoreSystem' has no attribute 'isOrExtends'
make: *** [run] Error 1
---------- %< ----------

As far as I understand the problem is that on initialization the gradebook stores some score systems in the application site manager that are used like utilities. These should be stored in a separated container and registered in a different way. This needs to be confirmed.

Changed in schooltool.gradebook:
assignee: nobody → Douglas Cerna (replaceafill)
Changed in schooltool.gradebook:
importance: Undecided → High
status: New → Triaged
milestone: none → 0.9.1
Alan Elkner (aelkner)
Changed in schooltool.gradebook:
assignee: Douglas Cerna (replaceafill) → Alan Elkner (aelkner)
importance: High → Critical
status: Triaged → In Progress
Revision history for this message
Alan Elkner (aelkner) wrote :
Download full text (18.6 KiB)

I tested moving a Data.fs file from an instance of schooltool.gradebook to a schooltool-only instnace, and the server was able to start. I assume that moving the custom scoresystems out of the site manager had something to do with that. However, as soon as I visit localhost:7080 in the bowser, I get a number of exceptions:

aelkner@ubuntu:~/sandboxes/scoresystems_container/schooltool$ make run
bin/start-schooltool-instance instance
Reading configuration from /home/aelkner/sandboxes/scoresystems_container/schooltool/instance/schooltool.conf
2011-04-27 01:00:08,311 main db: evolving in mode EVOLVEMINIMUM
Starting server in PID 17404.
serving on http://127.0.0.1:7080
2011-04-27 01:00:12,146 Couldn't load state for 0xa2
Traceback (most recent call last):
  File "/home/aelkner/sandboxes/scoresystems_container/schooltool/eggs/ZODB3-3.9.7-py2.6-linux-x86_64.egg/ZODB/Connection.py", line 851, in setstate
    self._setstate(obj)
  File "/home/aelkner/sandboxes/scoresystems_container/schooltool/eggs/ZODB3-3.9.7-py2.6-linux-x86_64.egg/ZODB/Connection.py", line 919, in _setstate
    self._reader.setGhostState(obj, p)
  File "/home/aelkner/sandboxes/scoresystems_container/schooltool/eggs/ZODB3-3.9.7-py2.6-linux-x86_64.egg/ZODB/serialize.py", line 630, in setGhostState
    obj.__setstate__(state)
  File "/home/aelkner/sandboxes/scoresystems_container/schooltool/eggs/zope.component-3.9.5-py2.6.egg/zope/component/persistentregistry.py", line 40, in __setstate__
    self._createLookup()
  File "/home/aelkner/sandboxes/scoresystems_container/schooltool/eggs/zope.interface-3.6.1-py2.6-linux-x86_64.egg/zope/interface/adapter.py", line 91, in _createLookup
    self._v_lookup = self.LookupClass(self)
  File "/home/aelkner/sandboxes/scoresystems_container/schooltool/eggs/zope.interface-3.6.1-py2.6-linux-x86_64.egg/zope/interface/adapter.py", line 439, in __init__
    self.init_extendors()
  File "/home/aelkner/sandboxes/scoresystems_container/schooltool/eggs/zope.interface-3.6.1-py2.6-linux-x86_64.egg/zope/interface/adapter.py", line 476, in init_extendors
    self.add_extendor(p)
  File "/home/aelkner/sandboxes/scoresystems_container/schooltool/eggs/zope.interface-3.6.1-py2.6-linux-x86_64.egg/zope/interface/adapter.py", line 480, in add_extendor
    for i in provided.__iro__:
AttributeError: type object 'ICustomScoreSystem' has no attribute '__iro__'
2011-04-27 01:00:12,148 Couldn't load state for 0xa2
Traceback (most recent call last):
  File "/home/aelkner/sandboxes/scoresystems_container/schooltool/eggs/ZODB3-3.9.7-py2.6-linux-x86_64.egg/ZODB/Connection.py", line 851, in setstate
    self._setstate(obj)
  File "/home/aelkner/sandboxes/scoresystems_container/schooltool/eggs/ZODB3-3.9.7-py2.6-linux-x86_64.egg/ZODB/Connection.py", line 919, in _setstate
    self._reader.setGhostState(obj, p)
  File "/home/aelkner/sandboxes/scoresystems_container/schooltool/eggs/ZODB3-3.9.7-py2.6-linux-x86_64.egg/ZODB/serialize.py", line 630, in setGhostState
    obj.__setstate__(state)
  File "/home/aelkner/sandboxes/scoresystems_container/schooltool/eggs/zope.component-3.9.5-py2.6.egg/zope/component/persistentregistry.py", line 40, in __setstate__
    self._createLookup()
  Fil...

Changed in schooltool.gradebook:
status: In Progress → Fix Committed
Changed in schooltool.gradebook:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.