Modify

Ticket #633 (closed defect: fixed)

Opened 9 years ago

Last modified 8 years ago

Fix traceback when updating sqlite database

Reported by: solj Owned by: desai
Priority: critical Milestone: Bcfg2 1.0.0 Release
Component: bcfg2-server Version: 0.9.x
Keywords: Cc:

Description

  • Create a new sqlite database like this
    $ python src/lib/Server/Reports/manage.py syncdb
    
  • Fire up bcfg2-info or bcfg2-server

This is the resulting traceback:

Jan 13 13:52:48 unstable bcfg2-server[13827]: Searching for new models to add to the statistics database
Jan 13 13:52:48 unstable bcfg2-server[13827]: Running upgrade of models to the new one
Jan 13 13:52:54 unstable bcfg2-server[13827]: Presently at version 0 updated the 2009-01-13T10:46:01.871063
Jan 13 13:52:54 unstable bcfg2-server[13827]: Failed to perform db update <function _merge_database_table_entries at 0x1c68488>#012Traceback (most recent call last):#012  File "/usr/lib/python2.5/site-packages/Bcfg2/Server/Reports/updatefix.py", line 78, in rollupdate#012    _fixes[i]()#012  File "/usr/lib/python2.5/site-packages/Bcfg2/Server/Reports/updatefix.py", line 21, in _merge_database_table_entries#012    """)#012  File "/var/lib/python-support/python2.5/django/db/backends/util.py", line 19, in execute#012    return self.cursor.execute(sql, params)#012  File "/var/lib/python-support/python2.5/django/db/backends/sqlite3/base.py", line 168, in execute#012    return Database.Cursor.execute(self, query, params)#012OperationalError: no such table: reports_extra
Jan 13 13:52:54 unstable bcfg2-server[13827]: Failed to perform db update drop table reports_bad;#012Traceback (most recent call last):#012  File "/usr/lib/python2.5/site-packages/Bcfg2/Server/Reports/updatefix.py", line 76, in rollupdate#012    connection.cursor().execute(_fixes[i])#012  File "/var/lib/python-support/python2.5/django/db/backends/util.py", line 19, in execute#012    return self.cursor.execute(sql, params)#012  File "/var/lib/python-support/python2.5/django/db/backends/sqlite3/base.py", line 168, in execute#012    return Database.Cursor.execute(self, query, params)#012OperationalError: no such table: reports_bad
Jan 13 13:52:54 unstable bcfg2-server[13827]: Failed to perform db update drop table reports_bad_interactions;#012Traceback (most recent call last):#012  File "/usr/lib/python2.5/site-packages/Bcfg2/Server/Reports/updatefix.py", line 76, in rollupdate#012    connection.cursor().execute(_fixes[i])#012  File "/var/lib/python-support/python2.5/django/db/backends/util.py", line 19, in execute#012    return self.cursor.execute(sql, params)#012  File "/var/lib/python-support/python2.5/django/db/backends/sqlite3/base.py", line 168, in execute#012    return Database.Cursor.execute(self, query, params)#012OperationalError: no such table: reports_bad_interactions
Jan 13 13:52:54 unstable bcfg2-server[13827]: Failed to perform db update drop table reports_extra;#012Traceback (most recent call last):#012  File "/usr/lib/python2.5/site-packages/Bcfg2/Server/Reports/updatefix.py", line 76, in rollupdate#012    connection.cursor().execute(_fixes[i])#012  File "/var/lib/python-support/python2.5/django/db/backends/util.py", line 19, in execute#012    return self.cursor.execute(sql, params)#012  File "/var/lib/python-support/python2.5/django/db/backends/sqlite3/base.py", line 168, in execute#012    return Database.Cursor.execute(self, query, params)#012OperationalError: no such table: reports_extra
Jan 13 13:52:54 unstable bcfg2-server[13827]: Failed to perform db update drop table reports_extra_interactions;#012Traceback (most recent call last):#012  File "/usr/lib/python2.5/site-packages/Bcfg2/Server/Reports/updatefix.py", line 76, in rollupdate#012    connection.cursor().execute(_fixes[i])#012  File "/var/lib/python-support/python2.5/django/db/backends/util.py", line 19, in execute#012    return self.cursor.execute(sql, params)#012  File "/var/lib/python-support/python2.5/django/db/backends/sqlite3/base.py", line 168, in execute#012    return Database.Cursor.execute(self, query, params)#012OperationalError: no such table: reports_extra_interactions
Jan 13 13:52:54 unstable bcfg2-server[13827]: Failed to perform db update drop table reports_modified;#012Traceback (most recent call last):#012  File "/usr/lib/python2.5/site-packages/Bcfg2/Server/Reports/updatefix.py", line 76, in rollupdate#012    connection.cursor().execute(_fixes[i])#012  File "/var/lib/python-support/python2.5/django/db/backends/util.py", line 19, in execute#012    return self.cursor.execute(sql, params)#012  File "/var/lib/python-support/python2.5/django/db/backends/sqlite3/base.py", line 168, in execute#012    return Database.Cursor.execute(self, query, params)#012OperationalError: no such table: reports_modified
Jan 13 13:52:54 unstable bcfg2-server[13827]: Failed to perform db update drop table reports_modified_interactions;#012Traceback (most recent call last):#012  File "/usr/lib/python2.5/site-packages/Bcfg2/Server/Reports/updatefix.py", line 76, in rollupdate#012    connection.cursor().execute(_fixes[i])#012  File "/var/lib/python-support/python2.5/django/db/backends/util.py", line 19, in execute#012    return self.cursor.execute(sql, params)#012  File "/var/lib/python-support/python2.5/django/db/backends/sqlite3/base.py", line 168, in execute#012    return Database.Cursor.execute(self, query, params)#012OperationalError: no such table: reports_modified_interactions
Jan 13 13:52:54 unstable bcfg2-server[13827]: Failed to perform db update drop table reports_repository;#012Traceback (most recent call last):#012  File "/usr/lib/python2.5/site-packages/Bcfg2/Server/Reports/updatefix.py", line 76, in rollupdate#012    connection.cursor().execute(_fixes[i])#012  File "/var/lib/python-support/python2.5/django/db/backends/util.py", line 19, in execute#012    return self.cursor.execute(sql, params)#012  File "/var/lib/python-support/python2.5/django/db/backends/sqlite3/base.py", line 168, in execute#012    return Database.Cursor.execute(self, query, params)#012OperationalError: no such table: reports_repository
Jan 13 13:52:54 unstable bcfg2-server[13827]: Failed to perform db update drop table reports_metadata;#012Traceback (most recent call last):#012  File "/usr/lib/python2.5/site-packages/Bcfg2/Server/Reports/updatefix.py", line 76, in rollupdate#012    connection.cursor().execute(_fixes[i])#012  File "/var/lib/python-support/python2.5/django/db/backends/util.py", line 19, in execute#012    return self.cursor.execute(sql, params)#012  File "/var/lib/python-support/python2.5/django/db/backends/sqlite3/base.py", line 168, in execute#012    return Database.Cursor.execute(self, query, params)#012OperationalError: no such table: reports_metadata
Jan 13 13:52:54 unstable bcfg2-server[13827]: Failed to perform db update alter table reports_interaction add server varchar(256) not null default 'N/A';#012Traceback (most recent call last):#012  File "/usr/lib/python2.5/site-packages/Bcfg2/Server/Reports/updatefix.py", line 76, in rollupdate#012    connection.cursor().execute(_fixes[i])#012  File "/var/lib/python-support/python2.5/django/db/backends/util.py", line 19, in execute#012    return self.cursor.execute(sql,params)#012  File "/var/lib/python-support/python2.5/django/db/backends/sqlite3/base.py", line 168, in execute#012    return Database.Cursor.execute(self, query, params)#012OperationalError: duplicate column name: server
Jan 13 13:52:54 unstable bcfg2-server[13827]: Error while updating the database
Jan 13 13:52:54 unstable bcfg2-server[13827]: Traceback (most recent call last):
Jan 13 13:52:54 unstable bcfg2-server[13827]:   File "/usr/lib/python2.5/site-packages/Bcfg2/Server/Reports/updatefix.py", line 135, in update_database
Jan 13 13:52:54 unstable bcfg2-server[13827]:     new_version = rollupdate(know_version.version)
Jan 13 13:52:54 unstable bcfg2-server[13827]:   File "/usr/lib/python2.5/site-packages/Bcfg2/Server/Reports/updatefix.py", line 84, in rollupdate
Jan 13 13:52:54 unstable bcfg2-server[13827]:     return ret
Jan 13 13:52:54 unstable bcfg2-server[13827]: UnboundLocalError: local variable 'ret' referenced before assignment
Jan 13 13:52:54 unstable bcfg2-server[13827]: TGenshi properties disabled

Attachments

Change History

comment:1 Changed 9 years ago by solj

  • Milestone changed from Bcfg2 0.9.6 Release to Bcfg2 1.0 Release

comment:2 Changed 9 years ago by solj

  • Priority changed from minor to critical

comment:3 Changed 8 years ago by desai

  • Status changed from new to closed
  • Resolution set to fixed

WARNING! You need to establish a session before you can create or edit tickets. Otherwise the ticket will get treated as spam.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


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

 
Note: See TracTickets for help on using tickets.