UnableToEvolve database from schooltool 1.2

Reported by Helder Sousa on 2012-06-01
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SchoolTool
High
Gediminas Paulauskas

Bug Description

When upgrading from version 1.2 into 2.0.3 schooltool fails to start, reporting UnableToEvolve error.
Trace is below.

To replicate just start 2.0.3 with a 1.2 database file, or use the one attached.

Traceback (most recent call last):
  File "/usr/bin/paster", line 8, in <module>
    load_entry_point('PasteScript==1.7.5', 'console_scripts', 'paster')()
  File "/usr/lib/python2.6/site-packages/paste/script/command.py", line 104, in run
    invoke(command, command_name, options, args[1:])
  File "/usr/lib/python2.6/site-packages/paste/script/command.py", line 143, in invoke
    exit_code = runner.run(args)
  File "/usr/lib/python2.6/site-packages/paste/script/command.py", line 238, in run
    result = self.command()
  File "/usr/lib/python2.6/site-packages/paste/script/serve.py", line 284, in command
    relative_to=base, global_conf=vars)
  File "/usr/lib/python2.6/site-packages/paste/script/serve.py", line 321, in loadapp
    **kw)
  File "/usr/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
    return loadobj(APP, uri, name=name, **kw)
  File "/usr/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 272, in loadobj
    return context.create()
  File "/usr/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 713, in create
    return self.object_type.invoke(self)
  File "/usr/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 144, in invoke
    **context.local_conf)
  File "/usr/lib/python2.6/site-packages/paste/deploy/util.py", line 56, in fix_call
    val = callable(*args, **kw)
  File "/usr/lib/python2.6/site-packages/paste/urlmap.py", line 25, in urlmap_factory
    app = loader.get_app(app_name, global_conf=global_conf)
  File "/usr/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 350, in get_app
    name=name, global_conf=global_conf).create()
  File "/usr/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 713, in create
    return self.object_type.invoke(self)
  File "/usr/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 146, in invoke
    return fix_call(context.object, context.global_conf, **context.local_conf)
  File "/usr/lib/python2.6/site-packages/paste/deploy/util.py", line 56, in fix_call
    val = callable(*args, **kw)
  File "/usr/lib/python2.6/site-packages/schooltool/paste/main.py", line 48, in schooltool_app_factory
    os.path.join(global_conf['here'], config_file))
  File "/usr/lib/python2.6/site-packages/schooltool/paste/main.py", line 37, in __init__
    db = self.setup(options)
  File "/usr/lib/python2.6/site-packages/schooltool/app/main.py", line 679, in setup
    notify(DatabaseOpened(db))
  File "/usr/lib/python2.6/site-packages/zope/event/__init__.py", line 31, in notify
    subscriber(event)
  File "/usr/lib/python2.6/site-packages/zope/component/event.py", line 24, in dispatch
    zope.component.subscribers(event, None)
  File "/usr/lib/python2.6/site-packages/zope/component/_api.py", line 136, in subscribers
    return sitemanager.subscribers(objects, interface)
  File "/usr/lib/python2.6/site-packages/zope/component/registry.py", line 321, in subscribers
    return self.adapters.subscribers(objects, provided)
  File "/usr/lib/python2.6/site-packages/zope/interface/adapter.py", line 585, in subscribers
    subscription(*objects)
  File "/usr/lib/python2.6/site-packages/zope/app/appsetup/bootstrap.py", line 175, in bootStrapSubscriber
    zope.event.notify(zope.processlifetime.DatabaseOpenedWithRoot(db))
  File "/usr/lib/python2.6/site-packages/zope/event/__init__.py", line 31, in notify
    subscriber(event)
  File "/usr/lib/python2.6/site-packages/zope/component/event.py", line 24, in dispatch
    zope.component.subscribers(event, None)
  File "/usr/lib/python2.6/site-packages/zope/component/_api.py", line 136, in subscribers
    return sitemanager.subscribers(objects, interface)
  File "/usr/lib/python2.6/site-packages/zope/component/registry.py", line 321, in subscribers
    return self.adapters.subscribers(objects, provided)
  File "/usr/lib/python2.6/site-packages/zope/interface/adapter.py", line 585, in subscribers
    subscription(*objects)
  File "/usr/lib/python2.6/site-packages/zope/app/generations/generations.py", line 521, in evolveMinimumSubscriber
    evolve(event.database, EVOLVEMINIMUM)
  File "/usr/lib/python2.6/site-packages/zope/app/generations/generations.py", line 506, in evolve
    manager.generation)
zope.app.generations.interfaces.UnableToEvolve: (36, u'schooltool', 38)

Helder Sousa (hlsousa) wrote :
Changed in schooltool:
assignee: nobody → Gediminas Paulauskas (menesis)
importance: Undecided → High
status: New → Triaged
milestone: none → 1.7.1
milestone: 1.7.1 → 2.1.1
Changed in schooltool:
status: Triaged → In Progress
Gediminas Paulauskas (menesis) wrote :

I cannot reproduce the exact same failure with the attached database, but my guess is that you hit the Bug #1003834 that was recently reported as https://answers.launchpad.net/schooltool/+question/198155

The indication is that at the end of /var/log/schooltool/error.log there is an error:

AttributeError: 'Timetable' object has no attribute 'uniqueMeetingId'

However, with your database I got an error in the next stage of upgrade,

2012-06-01 17:09:58,130 main db/schooltool: failed to evolve to generation 37
Traceback (most recent call last):
  File "/home/menesis/.buildout/eggs/zope.app.generations-3.6.1-py2.7.egg/zope/app/generations/generations.py", line 494, in evolve
    manager.evolve(context, generation)
  File "/home/menesis/.buildout/eggs/zope.app.generations-3.6.1-py2.7.egg/zope/app/generations/generations.py", line 145, in evolve
    evolver.evolve(context)
  File "/home/menesis/src/schooltool/2.1/src/schooltool/src/schooltool/generations/evolve37.py", line 67, in evolve
    del app[LEVELS_APP_KEY]
  File "/home/menesis/.buildout/eggs/zope.container-3.12.0-py2.7-linux-i686.egg/zope/container/sample.py", line 88, in __delitem__
    uncontained(self.__data[key], self, key)
  File "/home/menesis/src/schooltool/2.1/python/lib/python2.7/UserDict.py", line 23, in __getitem__
    raise KeyError(key)
KeyError: 'schooltool.level.level'
Traceback (most recent call last):
  ...
zope.app.generations.interfaces.UnableToEvolve: (37, u'schooltool', 38)

That I am fixing now.

Download full text (7.0 KiB)

Regarding the bug, Justas has more details about the problem... he seen it
happen and actually did some debug about it here in Portugal.

2012/6/1 Gediminas Paulauskas <email address hidden>

> I cannot reproduce the exact same failure with the attached database,
> but my guess is that you hit the Bug #1003834 that was recently reported
> as https://answers.launchpad.net/schooltool/+question/198155
>
> The indication is that at the end of /var/log/schooltool/error.log there
> is an error:
>
> AttributeError: 'Timetable' object has no attribute 'uniqueMeetingId'
>
> However, with your database I got an error in the next stage of upgrade,
>
> 2012-06-01 17:09:58,130 main db/schooltool: failed to evolve to generation
> 37
> Traceback (most recent call last):
> File
> "/home/menesis/.buildout/eggs/zope.app.generations-3.6.1-py2.7.egg/zope/app/generations/generations.py",
> line 494, in evolve
> manager.evolve(context, generation)
> File
> "/home/menesis/.buildout/eggs/zope.app.generations-3.6.1-py2.7.egg/zope/app/generations/generations.py",
> line 145, in evolve
> evolver.evolve(context)
> File
> "/home/menesis/src/schooltool/2.1/src/schooltool/src/schooltool/generations/evolve37.py",
> line 67, in evolve
> del app[LEVELS_APP_KEY]
> File
> "/home/menesis/.buildout/eggs/zope.container-3.12.0-py2.7-linux-i686.egg/zope/container/sample.py",
> line 88, in __delitem__
> uncontained(self.__data[key], self, key)
> File "/home/menesis/src/schooltool/2.1/python/lib/python2.7/UserDict.py",
> line 23, in __getitem__
> raise KeyError(key)
> KeyError: 'schooltool.level.level'
> Traceback (most recent call last):
> ...
> zope.app.generations.interfaces.UnableToEvolve: (37, u'schooltool', 38)
>
> That I am fixing now.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1007361
>
> Title:
> UnableToEvolve database from schooltool 1.2
>
> Status in SchoolTool:
> In Progress
>
> Bug description:
> When upgrading from version 1.2 into 2.0.3 schooltool fails to start,
> reporting UnableToEvolve error.
> Trace is below.
>
> To replicate just start 2.0.3 with a 1.2 database file, or use the one
> attached.
>
> Traceback (most recent call last):
> File "/usr/bin/paster", line 8, in <module>
> load_entry_point('PasteScript==1.7.5', 'console_scripts', 'paster')()
> File "/usr/lib/python2.6/site-packages/paste/script/command.py", line
> 104, in run
> invoke(command, command_name, options, args[1:])
> File "/usr/lib/python2.6/site-packages/paste/script/command.py", line
> 143, in invoke
> exit_code = runner.run(args)
> File "/usr/lib/python2.6/site-packages/paste/script/command.py", line
> 238, in run
> result = self.command()
> File "/usr/lib/python2.6/site-packages/paste/script/serve.py", line
> 284, in command
> relative_to=base, global_conf=vars)
> File "/usr/lib/python2.6/site-packages/paste/script/serve.py", line
> 321, in loadapp
> **kw)
> File "/usr/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line
> 247, in loadapp
> return loadobj(APP, uri, name=name, **kw)
> File "/usr/lib/python2.6/site-packages/...

Read more...

Gediminas Paulauskas (menesis) wrote :

Can you attach the last traceback from /var/log/schooltool/error.log? (or somewhere you put error.log)
Because the exception in description is not very helpful.

Helder Sousa (hlsousa) wrote :

Find attached the error.log and paste.log

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

Other bug subscribers