Bug 854707

Summary: IndexError in db migration
Product: [Fedora] Fedora EPEL Reporter: Michael Soulier <msoulier>
Component: python-sqlite2Assignee: Xavier Lamien <lxtnow>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: el6CC: dennis, lxtnow, pfrields
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: 2.6.3 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-30 15:03:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Michael Soulier 2012-09-05 15:36:37 UTC
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 05:59:29 UTC
Reassigning to correct component.

Comment 2 Ben Cotton 2020-11-05 16:49:27 UTC
This message is a reminder that EPEL 6 is nearing its end of life. Fedora will stop maintaining and issuing updates for EPEL 6 on 2020-11-30. It is our policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a 'version' of 'el6'.

Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later EPEL version.

Thank you for reporting this issue and we are sorry that we were not able to fix it before EPEL 6 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged  change the 'version' to a later Fedora version prior this bug is closed as described in the policy above.

Comment 3 Ben Cotton 2020-11-30 15:03:28 UTC
EPEL el6 changed to end-of-life (EOL) status on 2020-11-30. EPEL el6 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
EPEL please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.