Migration error in Racks

Bug #1580549 reported by Alexander Charykov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Released
Medium
Fuel Infra Apps

Bug Description

Unable to perform migration on clean DB.

./manage.py migrate
Running migrations for inventory:
 - Migrating forwards to 0019_update_constraints.
 > inventory:0001_initial
 > inventory:0002_auto__add_index_inventoryobject_name
 > inventory:0003_auto
 > inventory:0004_auto__add_l2address__add_field_inventoryobject_dcim_id__add_field_inve
 > inventory:0005_auto__add_field_inventoryobject_ipmi_host__add_field_inventoryobject_i
 > inventory:0006_dcmi_attributes_to_fields
 - Migration 'inventory:0006_dcmi_attributes_to_fields' is marked for no-dry-run.
 > inventory:0007_auto__add_lab
 > inventory:0008_auto__add_location__del_field_ipv4network_location__add_field_inventor
 > inventory:0009_create_locations_from_facts
 - Migration 'inventory:0009_create_locations_from_facts' is marked for no-dry-run.
 > inventory:0010_auto__del_field_inventoryobjectlocation_fullname
 > inventory:0011_auto
 > inventory:0012_rename_inventoryobjectlocation_to_facterlocation
 > inventory:0013_auto__add_field_inventoryobject_bugs__add_field_lab_bugs
 > inventory:0015_auto__add_field_inventoryobject_assigned_user__add_field_inventoryobje
 > inventory:0015_auto__add_field_inventoryobject_dcim_jira_issue
 > inventory:0015_auto__add_racksuser__add_racksgroup
 > inventory:0016_racks_users_groups
 - Migration 'inventory:0016_racks_users_groups' is marked for no-dry-run.
 > inventory:0017_racks_users_and_groups
 > inventory:0018_update_constraints
FATAL ERROR - The following SQL query failed:
                SELECT kc.constraint_name, kc.column_name, c.constraint_type
                FROM information_schema.constraint_column_usage AS kc
                JOIN information_schema.table_constraints AS c ON
                    kc.table_schema = c.table_schema AND
                    kc.table_name = c.table_name AND
                    kc.constraint_name = c.constraint_name
                WHERE
                    kc.table_schema = %s AND
                    kc.table_name = %s

The error was: no such table: information_schema.constraint_column_usage
Traceback (most recent call last):
  File "./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/m/tmp/python-django-racks/venv/local/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/core/management/__init__.py", line 399, in execute_from_command_line
    utility.execute()
  File "/home/m/tmp/python-django-racks/venv/local/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/m/tmp/python-django-racks/venv/local/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/core/management/base.py", line 242, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/home/m/tmp/python-django-racks/venv/local/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/core/management/base.py", line 285, in execute
    output = self.handle(*args, **options)
  File "/home/m/tmp/python-django-racks/venv/local/lib/python2.7/site-packages/South-0.7.5-py2.7.egg/south/management/commands/migrate.py", line 107, in handle
    ignore_ghosts = ignore_ghosts,
  File "/home/m/tmp/python-django-racks/venv/local/lib/python2.7/site-packages/South-0.7.5-py2.7.egg/south/migration/__init__.py", line 219, in migrate_app
    success = migrator.migrate_many(target, workplan, database)
  File "/home/m/tmp/python-django-racks/venv/local/lib/python2.7/site-packages/South-0.7.5-py2.7.egg/south/migration/migrators.py", line 235, in migrate_many
    result = migrator.__class__.migrate_many(migrator, target, migrations, database)
  File "/home/m/tmp/python-django-racks/venv/local/lib/python2.7/site-packages/South-0.7.5-py2.7.egg/south/migration/migrators.py", line 310, in migrate_many
    result = self.migrate(migration, database)
  File "/home/m/tmp/python-django-racks/venv/local/lib/python2.7/site-packages/South-0.7.5-py2.7.egg/south/migration/migrators.py", line 133, in migrate
    result = self.run(migration)
  File "/home/m/tmp/python-django-racks/venv/local/lib/python2.7/site-packages/South-0.7.5-py2.7.egg/south/migration/migrators.py", line 107, in run
    return self.run_migration(migration)
  File "/home/m/tmp/python-django-racks/venv/local/lib/python2.7/site-packages/South-0.7.5-py2.7.egg/south/migration/migrators.py", line 86, in run_migration
    print self.run_migration_error(migration)
  File "/home/m/tmp/python-django-racks/venv/local/lib/python2.7/site-packages/South-0.7.5-py2.7.egg/south/migration/migrators.py", line 304, in run_migration_error
    (self.format_backwards(migration), extra_info))
  File "/home/m/tmp/python-django-racks/venv/local/lib/python2.7/site-packages/South-0.7.5-py2.7.egg/south/migration/migrators.py", line 291, in format_backwards
    self.backwards(migration)()
  File "/home/m/tmp/python-django-racks/venv/local/lib/python2.7/site-packages/South-0.7.5-py2.7.egg/south/migration/migrators.py", line 57, in <lambda>
    return (lambda: direction(orm))
  File "/home/m/tmp/python-django-racks/racks/inventory/migrations/0018_update_constraints.py", line 67, in backwards
    to=orm['auth.User'],
  File "/home/m/tmp/python-django-racks/venv/local/lib/python2.7/site-packages/South-0.7.5-py2.7.egg/south/orm.py", line 169, in __getitem__
    raise KeyError("The model '%s' from the app '%s' is not available in this migration." % (model, app))
KeyError: "The model 'user' from the app 'auth' is not available in this migration."

Andrey Nikitin (heos)
Changed in fuel:
milestone: none → 10.0
Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Fix proposed to fuel-infra/packages/python-django-racks (master)

Fix proposed to branch: master
Change author: Alexander Charykov <email address hidden>
Review: https://review.fuel-infra.org/21687

Changed in fuel:
status: Confirmed → In Progress
Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Fix merged to fuel-infra/packages/python-django-racks (master)

Reviewed: https://review.fuel-infra.org/21687
Submitter: Alexander Charykov <email address hidden>
Branch: master

Commit: a9e6bffcd25448f0c407eddd5f58691b2295cdbc
Author: Alexander Charykov <email address hidden>
Date: Mon Jun 6 12:47:49 2016

Fix migration issues with south

Change-Id: I0ffde3010c4770cd0d007611caff9836f46d05be
Closes-Bug: #1580549

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.