[Bug 493015] New: Migration failure and database table destruction in OBS 1.5.1
http://bugzilla.novell.com/show_bug.cgi?id=493015 Summary: Migration failure and database table destruction in OBS 1.5.1 Classification: openSUSE Product: openSUSE.org Version: unspecified Platform: Other OS/Version: openSUSE 11.0 Status: NEW Severity: Critical Priority: P5 - None Component: BuildService AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: jfunk@funktronics.ca QAContact: adrian@novell.com Found By: --- User-Agent: Mozilla/5.0 (compatible; Konqueror/4.2; Linux) KHTML/4.2.1 (like Gecko) SUSE I just upgraded an OBS 1.0 system to 1.5.1. I tried to perform the database migration with the following command: RAILS_ENV="production_slave" rake db:migrate I received the following error: (in /srv/www/obs/frontend) rake aborted! Duplicate migration 43. Please renumber your migrations to resolve the conflict. It turns out that there ware two files with names starting with 043 in the db/migrate directory: 043_add_archs.rb 043_add_archs_2.rb The first one was empty, so I deleted it and re-ran the migration. That resulted in this error: uninitialized constant AddArchs I then ran the migration again, but it attempted to start from scratch: == 1 InitialDatabase: migrating =============================================== -- create_table("groups", {:force=>true}) -> 0.0906s -- add_index("groups", ["parent_id"], {:name=>"groups_parent_id_index"}) -> 0.0663s -- create_table("groups_roles", {:force=>true, :id=>false}) ..and so on until it gets to this error: == 6 CreateTaggings: migrating ================================================ -- create_table(:taggings) rake aborted! Mysql::Error: Table 'taggings' already exists: CREATE TABLE `taggings` (`id` int(11) DEFAULT NULL auto_increment PRIMARY KEY, `taggable_id` int(11), `taggable_type` varchar(255), `tag_id` int(11), `user_id` int(11)) ENGINE=InnoDB Now, everytime I attempt the migration, it produces the above error. However, if I run RAILS_ENV="production_slave" rake db:version, I get this: Current version: 44 I checked the schema_info table directly with mysql and it confirms that the version is 44. Now it appears that portions of my database are hosed. The users table was apparently reset to a default state, for example. Projects and packages are there, but ownerships do not match users anymore It looks like there's one more migration script to execute, 046_add_bcntsynctag.rb, (45 is missing, I guess), but the Rails migration scripts are refusing to work properly and my database is now a mess. Reproducible: Always -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=493015 User jfunk@funktronics.ca added comment http://bugzilla.novell.com/show_bug.cgi?id=493015#c1 --- Comment #1 from James Oakley <jfunk@funktronics.ca> 2009-04-08 07:05:28 MDT --- The schema_migrations table appears to be incomplete. Maybe this is a rails bug? Why were only certain versions removed? mysql> select * from schema_migrations; +---------+ | version | +---------+ | 1 | | 10 | | 14 | | 15 | | 2 | | 21 | | 22 | | 23 | | 25 | | 27 | | 28 | | 3 | | 30 | | 31 | | 33 | | 34 | | 36 | | 37 | | 38 | | 39 | | 4 | | 41 | | 42 | | 43 | | 44 | | 5 | | 7 | | 9 | +---------+ -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=493015 Adrian Schröter <adrian@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|bnc-team-screening@forge.pr |abauer@novell.com |ovo.novell.com | -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=493015 Andreas Bauer <abauer@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tschmidt@novell.com AssignedTo|abauer@novell.com |mrueckert@novell.com -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=493015 User tschmidt@novell.com added comment http://bugzilla.novell.com/show_bug.cgi?id=493015#c2 Thomas Schmidt <tschmidt@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO Info Provider| |jfunk@funktronics.ca --- Comment #2 from Thomas Schmidt <tschmidt@novell.com> 2009-09-25 16:38:01 CEST --- Do you still have this problem? The schema migration numbers don't have to be complete, they are run alphabetically afaic. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=493015 User jfunk@funktronics.ca added comment http://bugzilla.novell.com/show_bug.cgi?id=493015#c3 James Oakley <jfunk@funktronics.ca> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW Info Provider|jfunk@funktronics.ca | --- Comment #3 from James Oakley <jfunk@funktronics.ca> 2009-09-25 10:40:16 MDT --- I've done an upgrade since this happened, and it worked fine. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=493015 User tschmidt@novell.com added comment http://bugzilla.novell.com/show_bug.cgi?id=493015#c4 Thomas Schmidt <tschmidt@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |WONTFIX --- Comment #4 from Thomas Schmidt <tschmidt@novell.com> 2009-09-26 13:46:18 CEST --- no more relevant -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com