mandriva

Ticket #335 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Adding a table to msc database breaks plugin loading / scheduler

Reported by: nnoirbent Owned by: oroussy
Priority: Normal Milestone: 1.2.1
Component: python-mmc-msc Version: 1.1.0
Severity: Major Keywords:
Cc:

Description

Unfortunately, the MscDatabase?.db_check() method is not called before MscDatabase?.initTables(), which fails if the database is not up to date with respect to the SQLAlchemy code (SQLAlchemy raises an error when it doesn't find the database relationships it expects).

This triggers this kind of tracebacks when looking at the mmc-agent logs / launching pulse2-scheduler manually :

Traceback (most recent call last):
  File "/usr/lib/python2.3/site-packages/mmc/agent.py", line 405, in agentService
    if (func()):
  File "/usr/lib/python2.3/site-packages/mmc/plugins/msc/__init__.py", line 78, in activate
    MscDatabase().activate()
  File "/usr/lib/python2.3/site-packages/mmc/plugins/msc/database.py", line 130, in activate
    self.initTables()
  File "/usr/lib/python2.3/site-packages/mmc/plugins/msc/database.py", line 184, in initTables
    autoload = True
  File "/usr/lib/python2.3/site-packages/sqlalchemy/schema.py", line 175, in __call__
    metadata._get_engine(raiseerr=True).reflecttable(table)
  File "/usr/lib/python2.3/site-packages/sqlalchemy/engine/base.py", line 806, in reflecttable
    self.dialect.reflecttable(conn, table)
  File "/usr/lib/python2.3/site-packages/sqlalchemy/databases/mysql.py", line 1109, in reflecttable
    raise exceptions.NoSuchTableError(table.fullname)
NoSuchTableError: bundle

The most obvious fix for this would be to call db_check() before calling initTables() in MscDatabase?.activate(), which would in turn entail adding a return value to activate() and checking for this value where it is called.

Attachments

Change History

Changed 3 years ago by dchrisment

  • milestone changed from Dispatch Me ! to 1.2.1

Changed 3 years ago by oroussy

  • owner changed from nrueff to oroussy

Changed 3 years ago by oroussy

  • status changed from new to closed
  • resolution set to fixed

Add/Change #335 (Adding a table to msc database breaks plugin loading / scheduler)

Author



Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.