Closed Bug 755236 Opened 13 years ago Closed 13 years ago

webpagemaker-dev.allizom.org needs to run DB migrations

Categories

(Infrastructure & Operations Graveyard :: WebOps: Other, task)

All
Other
task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: avarma, Assigned: cturra)

Details

Hey, I set up migrations for webpagemaker using the standard playdoh migration workflow [1], but it doesn't seem like this one has been run on the dev instance: https://github.com/mozilla/webpagemaker/blob/development/migrations/02-added-original-url-field.sql Is there some reason this didn't get run earlier? Or can the dev instance be configured so that future migrations are run? [1] http://playdoh.readthedocs.org/en/latest/userguide/migrations.html
Component: Server Operations → Server Operations: Web Operations
QA Contact: phong → cshields
Please don't file Web Ops bugs as major, unless a production site is down, as that causes on-call to get paged Also, please file these under Server Ops - Web Operations in the future, I or :cturra will look into this shortly.
Assignee: server-ops → bburton
Severity: major → normal
:atul running the manage.py migrate in -dev returns a "Table 'api_page' already exists" error. the following is fthe full traceback. $ sudo python manage.py migrate Running migrations for api: - Migrating forwards to 0001_initial. > api:0001_initial ! Error found during real run of migration! Aborting. ! Since you have a database that does not support running ! schema-altering statements in transactions, we have had ! to leave it in an interim state between migrations. ! You *might* be able to recover with: = DROP TABLE `api_page` CASCADE; [] ! The South developers regret this has happened, and would ! like to gently persuade you to consider a slightly ! easier-to-deal-with DBMS (one that supports DDL transactions) ! NOTE: The error which caused the migration to fail is further up. Error in migration: api:0001_initial Traceback (most recent call last): File "manage.py", line 27, in <module> manage.main() File "/data/genericrhel6-dev/src/webpagemaker-dev.allizom.org/webpagemaker/vendor/src/funfactory/funfactory/manage.py", line 139, in main execute_manager(current_settings) File "/data/genericrhel6-dev/src/webpagemaker-dev.allizom.org/webpagemaker/vendor/lib/python/django/core/management/__init__.py", line 438, in execute_manager utility.execute() File "/data/genericrhel6-dev/src/webpagemaker-dev.allizom.org/webpagemaker/vendor/lib/python/django/core/management/__init__.py", line 379, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/data/genericrhel6-dev/src/webpagemaker-dev.allizom.org/webpagemaker/vendor/lib/python/django/core/management/base.py", line 191, in run_from_argv self.execute(*args, **options.__dict__) File "/data/genericrhel6-dev/src/webpagemaker-dev.allizom.org/webpagemaker/vendor/lib/python/django/core/management/base.py", line 220, in execute output = self.handle(*args, **options) File "/data/genericrhel6-dev/src/webpagemaker-dev.allizom.org/webpagemaker/vendor-local/src/django-south/south/management/commands/migrate.py", line 107, in handle ignore_ghosts = ignore_ghosts, File "/data/genericrhel6-dev/src/webpagemaker-dev.allizom.org/webpagemaker/vendor-local/src/django-south/south/migration/__init__.py", line 219, in migrate_app success = migrator.migrate_many(target, workplan, database) File "/data/genericrhel6-dev/src/webpagemaker-dev.allizom.org/webpagemaker/vendor-local/src/django-south/south/migration/migrators.py", line 235, in migrate_many result = migrator.__class__.migrate_many(migrator, target, migrations, database) File "/data/genericrhel6-dev/src/webpagemaker-dev.allizom.org/webpagemaker/vendor-local/src/django-south/south/migration/migrators.py", line 310, in migrate_many result = self.migrate(migration, database) File "/data/genericrhel6-dev/src/webpagemaker-dev.allizom.org/webpagemaker/vendor-local/src/django-south/south/migration/migrators.py", line 133, in migrate result = self.run(migration) File "/data/genericrhel6-dev/src/webpagemaker-dev.allizom.org/webpagemaker/vendor-local/src/django-south/south/migration/migrators.py", line 107, in run return self.run_migration(migration) File "/data/genericrhel6-dev/src/webpagemaker-dev.allizom.org/webpagemaker/vendor-local/src/django-south/south/migration/migrators.py", line 81, in run_migration migration_function() File "/data/genericrhel6-dev/src/webpagemaker-dev.allizom.org/webpagemaker/vendor-local/src/django-south/south/migration/migrators.py", line 57, in <lambda> return (lambda: direction(orm)) File "/data/genericrhel6-dev/src/webpagemaker-dev.allizom.org/webpagemaker/webpagemaker/api/migrations/0001_initial.py", line 15, in forwards ('original_url', self.gf('django.db.models.fields.URLField')(default='', max_length=200, blank=True)), File "/data/genericrhel6-dev/src/webpagemaker-dev.allizom.org/webpagemaker/vendor-local/src/django-south/south/db/generic.py", line 46, in _cache_clear return func(self, table, *args, **opts) File "/data/genericrhel6-dev/src/webpagemaker-dev.allizom.org/webpagemaker/vendor-local/src/django-south/south/db/generic.py", line 346, in create_table ', '.join([col for col in columns if col]), File "/data/genericrhel6-dev/src/webpagemaker-dev.allizom.org/webpagemaker/vendor-local/src/django-south/south/db/generic.py", line 264, in execute cursor.execute(sql, params) File "/data/genericrhel6-dev/src/webpagemaker-dev.allizom.org/webpagemaker/vendor/lib/python/django/db/backends/mysql/base.py", line 86, in execute return self.cursor.execute(query, args) File "/usr/lib64/python2.6/site-packages/MySQLdb/cursors.py", line 173, in execute self.errorhandler(self, exc, value) File "/usr/lib64/python2.6/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler raise errorclass, errorvalue _mysql_exceptions.OperationalError: (1050, "Table 'api_page' already exists")
Assignee: bburton → cturra
Sorry about that Brandon, won't happen again! cturra: oh, I think I know what's going wrong, but at this point, since the dev instance doesn't actually have any valuable data on it, do you think you can just drop the database, re-create it, and then run 'syncdb' followed by 'migrate'? In other words, just reset the data? Thanks!
:atul - as requested, i dropped and recreated the database in -dev then ran manage.py syncdb/migrate. everything ran without error.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Component: Server Operations: Web Operations → WebOps: Other
Product: mozilla.org → Infrastructure & Operations
Product: Infrastructure & Operations → Infrastructure & Operations Graveyard
You need to log in before you can comment on or make changes to this bug.