Bug 854707 - IndexError in db migration
IndexError in db migration
Status: NEW
Product: Fedora EPEL
Classification: Fedora
Component: python-sqlite2 (Show other bugs)
el6
i686 Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Xavier Lamien
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-05 11:36 EDT by Michael Soulier
Modified: 2016-09-19 22:48 EDT (History)
3 users (show)

See Also:
Fixed In Version: 2.6.3
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Michael Soulier 2012-09-05 11:36:37 EDT
Description of problem:
IndexError during migration with Django-south.


Version-Release number of selected component (if applicable):
python-sqlite2-2.3.5-2.el6.i686


How reproducible:
100% in my environment.

The debug output and traceback are:

DEBUG:south:south execute "CREATE TABLE "_south_new_mcdloads" ("fromversions"
varchar(4096))" with params "[]"
DEBUG:south:south execute "INSERT INTO "_south_new_mcdloads" ("fromversions")
SELECT "fromversions" FROM "mcdloads";" with params "[]"
DEBUG:south:south execute "DROP TABLE "mcdloads";" with params "[]"
DEBUG:south:south execute "ALTER TABLE "_south_new_mcdloads" RENAME TO
"mcdloads";" with params "[]"
DEBUG:south:south execute "CREATE TABLE "_south_new_mcdloads" ("fromversions"
varchar(4096), "version" varchar(32) NOT NULL PRIMARY KEY DEFAULT 'unknown')"
with params "[]"
DEBUG:south:south execute "INSERT INTO "_south_new_mcdloads" ("fromversions")
SELECT "fromversions" FROM "mcdloads";" with params "[]"
DEBUG:south:south execute "DROP TABLE "mcdloads";" with params "[]"
DEBUG:south:south execute "ALTER TABLE "_south_new_mcdloads" RENAME TO
"mcdloads";" with params "[]"
Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_manager(settings)
  File "/usr/lib/python2.6/site-packages/django/core/management/__init__.py",
line 438, in execute_manager
    utility.execute()
  File "/usr/lib/python2.6/site-packages/django/core/management/__init__.py",
line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python2.6/site-packages/django/core/management/base.py", line
191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/lib/python2.6/site-packages/django/core/management/base.py", line
220, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/python2.6/site-packages/south/management/commands/migrate.py",
line 105, in handle
    ignore_ghosts = ignore_ghosts,
  File "/usr/lib/python2.6/site-packages/south/migration/__init__.py", line 191,
in migrate_app
    success = migrator.migrate_many(target, workplan, database)
  File "/usr/lib/python2.6/site-packages/south/migration/migrators.py", line
221, in migrate_many
    result = migrator.__class__.migrate_many(migrator, target, migrations,
database)
  File "/usr/lib/python2.6/site-packages/south/migration/migrators.py", line
292, in migrate_many
    result = self.migrate(migration, database)
  File "/usr/lib/python2.6/site-packages/south/migration/migrators.py", line
125, in migrate
    result = self.run(migration)
  File "/usr/lib/python2.6/site-packages/south/migration/migrators.py", line 99,
in run
    return self.run_migration(migration)
  File "/usr/lib/python2.6/site-packages/south/migration/migrators.py", line 81,
in run_migration
    migration_function()
  File "/usr/lib/python2.6/site-packages/south/migration/migrators.py", line 57,
in <lambda>
    return (lambda: direction(orm))
  File
"/etc/e-smith/web/django/webproxy/main/migrations/0012_auto__del_field_service_i
d__chg_field_service_name__add_unique_service.py", line 27, in forwards
    db.add_column('mcdloads', 'mcdload',
self.gf('django.db.models.fields.files.FileField')(default='', max_length=100),
keep_default=False)
  File "/usr/lib/python2.6/site-packages/south/db/sqlite3.py", line 33, in
add_column
    field.column: self._column_sql_for_create(table_name, name, field, False),
  File "/usr/lib/python2.6/site-packages/south/db/sqlite3.py", line 50, in
_remake_table
    indexes = self._get_connection().introspection.get_indexes(cursor,
table_name)
  File
"/usr/lib/python2.6/site-packages/django/db/backends/sqlite3/introspection.py",
line 117, in get_indexes
    cursor.execute('PRAGMA index_list(%s)' %
self.connection.ops.quote_name(table_name))
  File "/usr/lib/python2.6/site-packages/django/db/backends/sqlite3/base.py",
line 234, in execute
    return Database.Cursor.execute(self, query, params)
IndexError: list index out of range

Stepping through the migration, it's dying in the C API from pysqlite2.

If I upgrade to pysqlite2 2.6.3, the problem does not occur.
Comment 1 Michael Stahnke 2012-11-05 00:59:29 EST
Reassigning to correct component.

Note You need to log in before you can comment on or make changes to this bug.