← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1362039] [NEW] Cannot Upgrade from Keystone Essex to Keystone Icehouse

 

Public bug reported:

When trying to update from Essex to Icehosue in a test environment with
an existing keystone daabase table I get the following error:

6:07:38.888 11464 TRACE keystone     return versioning_api.upgrade(engine, repository, version)#0122014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib/python2.6/site-packages/migrate/versioning/api.py", line 185, in upgrade#0122014-08-26 16:07:38.888 11464 TRACE keystone     return _migrate(url, repository, version, upgrade=True, err=err, **opts)#0122014-08-26 16:07:38.888 11464 TRACE keystone   File "<string>", line 2, in _migrate#0122014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib/python2.6/site-packages/migrate/versioning/util/__init__.py", line 160, in with_engine#0122014-08-26 16:07:38.888 11464 TRACE keystone     return f(*a, **kw)#012
2014-08-26 16:07:38.888 11464 CRITICAL keystone [-] OperationalError: (OperationalError) (1060, "Duplicate column name 'valid'") '\nALTER TABLE token ADD valid BOOL' ()
2014-08-26 16:07:38.888 11464 TRACE keystone Traceback (most recent call last):
2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/bin/keystone-manage", line 51, in <module>
2014-08-26 16:07:38.888 11464 TRACE keystone     cli.main(argv=sys.argv, config_files=config_files)
2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib/python2.6/site-packages/keystone/cli.py", line 190, in main
2014-08-26 16:07:38.888 11464 TRACE keystone     CONF.command.cmd_class.main()
2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib/python2.6/site-packages/keystone/cli.py", line 66, in main
2014-08-26 16:07:38.888 11464 TRACE keystone     migration_helpers.sync_database_to_version(extension, version)
2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib/python2.6/site-packages/keystone/common/sql/migration_helpers.py", line 139, in sync_database_to_version
2014-08-26 16:07:38.888 11464 TRACE keystone     migration.db_sync(sql.get_engine(), abs_path, version=version)
2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib/python2.6/site-packages/keystone/openstack/common/db/sqlalchemy/migration.py", line 197, in db_sync
2014-08-26 16:07:38.888 11464 TRACE keystone     return versioning_api.upgrade(engine, repository, version)
2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib/python2.6/site-packages/migrate/versioning/api.py", line 185, in upgrade
2014-08-26 16:07:38.888 11464 TRACE keystone     return _migrate(url, repository, version, upgrade=True, err=err, **opts)
2014-08-26 16:07:38.888 11464 TRACE keystone   File "<string>", line 2, in _migrate
2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib/python2.6/site-packages/migrate/versioning/util/__init__.py", line 160, in with_engine
2014-08-26 16:07:38.888 11464 TRACE keystone     return f(*a, **kw)
2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib/python2.6/site-packages/migrate/versioning/api.py", line 364, in _migrate
2014-08-26 16:07:38.888 11464 TRACE keystone     schema.runchange(ver, change, changeset.step)
2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib/python2.6/site-packages/migrate/versioning/schema.py", line 90, in runchange
2014-08-26 16:07:38.888 11464 TRACE keystone     change.run(self.engine, step)
2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib/python2.6/site-packages/migrate/versioning/script/py.py", line 145, in run
2014-08-26 16:07:38.888 11464 TRACE keystone     script_func(engine)
2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib/python2.6/site-packages/keystone/common/sql/migrate_repo/versions/003_token_valid.py", line 28, in upgrade
2014-08-26 16:07:38.888 11464 TRACE keystone     valid.create(token, populate_default=True)
2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib/python2.6/site-packages/migrate/changeset/schema.py", line 526, in create
2014-08-26 16:07:38.888 11464 TRACE keystone     engine._run_visitor(visitorcallable, self, connection, **kwargs)
2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 1479, in _run_visitor
2014-08-26 16:07:38.888 11464 TRACE keystone     conn._run_visitor(visitorcallable, element, **kwargs)
2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 1122, in _run_visitor
2014-08-26 16:07:38.888 11464 TRACE keystone     **kwargs).traverse_single(element)
2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib/python2.6/site-packages/migrate/changeset/ansisql.py", line 55, in traverse_single
2014-08-26 16:07:38.888 11464 TRACE keystone     ret = super(AlterTableVisitor, self).traverse_single(elem)
2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib64/python2.6/site-packages/sqlalchemy/sql/visitors.py", line 122, in traverse_single
2014-08-26 16:07:38.888 11464 TRACE keystone     return meth(obj, **kw)
2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib/python2.6/site-packages/migrate/changeset/ansisql.py", line 103, in visit_column
2014-08-26 16:07:38.888 11464 TRACE keystone     self.execute()
2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib/python2.6/site-packages/migrate/changeset/ansisql.py", line 44, in execute
2014-08-26 16:07:38.888 11464 TRACE keystone     return self.connection.execute(self.buffer.getvalue())
2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 662, in execute
2014-08-26 16:07:38.888 11464 TRACE keystone     params)
2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 805, in _execute_text
2014-08-26 16:07:38.888 11464 TRACE keystone     statement, parameters
2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 874, in _execute_context
2014-08-26 16:07:38.888 11464 TRACE keystone     context)
2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 1024, in _handle_dbapi_exception
2014-08-26 16:07:38.888 11464 TRACE keystone     exc_info
2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib64/python2.6/site-packages/sqlalchemy/util/compat.py", line 196, in raise_from_cause
2014-08-26 16:07:38.888 11464 TRACE keystone     reraise(type(exception), exception, tb=exc_tb)
2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 867, in _execute_context
2014-08-26 16:07:38.888 11464 TRACE keystone     context)
2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/default.py", line 324, in do_execute
2014-08-26 16:07:38.888 11464 TRACE keystone     cursor.execute(statement, parameters)
2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib64/python2.6/site-packages/MySQLdb/cursors.py", line 173, in execute
2014-08-26 16:07:38.888 11464 TRACE keystone     self.errorhandler(self, exc, value)
2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib64/python2.6/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
2014-08-26 16:07:38.888 11464 TRACE keystone     raise errorclass, errorvalue
2014-08-26 16:07:38.888 11464 TRACE keystone OperationalError: (OperationalError) (1060, "Duplicate column name 'valid'") '\nALTER TABLE token ADD valid BOOL' ()
2014-08-26 16:07:38.888 11464 TRACE keystone 

It seems to be trying to add columns where they already exist.

Best Regards,
Leigh Hayward

** Affects: keystone
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Keystone.
https://bugs.launchpad.net/bugs/1362039

Title:
  Cannot Upgrade from Keystone Essex to Keystone Icehouse

Status in OpenStack Identity (Keystone):
  New

Bug description:
  When trying to update from Essex to Icehosue in a test environment
  with an existing keystone daabase table I get the following error:

  6:07:38.888 11464 TRACE keystone     return versioning_api.upgrade(engine, repository, version)#0122014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib/python2.6/site-packages/migrate/versioning/api.py", line 185, in upgrade#0122014-08-26 16:07:38.888 11464 TRACE keystone     return _migrate(url, repository, version, upgrade=True, err=err, **opts)#0122014-08-26 16:07:38.888 11464 TRACE keystone   File "<string>", line 2, in _migrate#0122014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib/python2.6/site-packages/migrate/versioning/util/__init__.py", line 160, in with_engine#0122014-08-26 16:07:38.888 11464 TRACE keystone     return f(*a, **kw)#012
  2014-08-26 16:07:38.888 11464 CRITICAL keystone [-] OperationalError: (OperationalError) (1060, "Duplicate column name 'valid'") '\nALTER TABLE token ADD valid BOOL' ()
  2014-08-26 16:07:38.888 11464 TRACE keystone Traceback (most recent call last):
  2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/bin/keystone-manage", line 51, in <module>
  2014-08-26 16:07:38.888 11464 TRACE keystone     cli.main(argv=sys.argv, config_files=config_files)
  2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib/python2.6/site-packages/keystone/cli.py", line 190, in main
  2014-08-26 16:07:38.888 11464 TRACE keystone     CONF.command.cmd_class.main()
  2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib/python2.6/site-packages/keystone/cli.py", line 66, in main
  2014-08-26 16:07:38.888 11464 TRACE keystone     migration_helpers.sync_database_to_version(extension, version)
  2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib/python2.6/site-packages/keystone/common/sql/migration_helpers.py", line 139, in sync_database_to_version
  2014-08-26 16:07:38.888 11464 TRACE keystone     migration.db_sync(sql.get_engine(), abs_path, version=version)
  2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib/python2.6/site-packages/keystone/openstack/common/db/sqlalchemy/migration.py", line 197, in db_sync
  2014-08-26 16:07:38.888 11464 TRACE keystone     return versioning_api.upgrade(engine, repository, version)
  2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib/python2.6/site-packages/migrate/versioning/api.py", line 185, in upgrade
  2014-08-26 16:07:38.888 11464 TRACE keystone     return _migrate(url, repository, version, upgrade=True, err=err, **opts)
  2014-08-26 16:07:38.888 11464 TRACE keystone   File "<string>", line 2, in _migrate
  2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib/python2.6/site-packages/migrate/versioning/util/__init__.py", line 160, in with_engine
  2014-08-26 16:07:38.888 11464 TRACE keystone     return f(*a, **kw)
  2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib/python2.6/site-packages/migrate/versioning/api.py", line 364, in _migrate
  2014-08-26 16:07:38.888 11464 TRACE keystone     schema.runchange(ver, change, changeset.step)
  2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib/python2.6/site-packages/migrate/versioning/schema.py", line 90, in runchange
  2014-08-26 16:07:38.888 11464 TRACE keystone     change.run(self.engine, step)
  2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib/python2.6/site-packages/migrate/versioning/script/py.py", line 145, in run
  2014-08-26 16:07:38.888 11464 TRACE keystone     script_func(engine)
  2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib/python2.6/site-packages/keystone/common/sql/migrate_repo/versions/003_token_valid.py", line 28, in upgrade
  2014-08-26 16:07:38.888 11464 TRACE keystone     valid.create(token, populate_default=True)
  2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib/python2.6/site-packages/migrate/changeset/schema.py", line 526, in create
  2014-08-26 16:07:38.888 11464 TRACE keystone     engine._run_visitor(visitorcallable, self, connection, **kwargs)
  2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 1479, in _run_visitor
  2014-08-26 16:07:38.888 11464 TRACE keystone     conn._run_visitor(visitorcallable, element, **kwargs)
  2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 1122, in _run_visitor
  2014-08-26 16:07:38.888 11464 TRACE keystone     **kwargs).traverse_single(element)
  2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib/python2.6/site-packages/migrate/changeset/ansisql.py", line 55, in traverse_single
  2014-08-26 16:07:38.888 11464 TRACE keystone     ret = super(AlterTableVisitor, self).traverse_single(elem)
  2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib64/python2.6/site-packages/sqlalchemy/sql/visitors.py", line 122, in traverse_single
  2014-08-26 16:07:38.888 11464 TRACE keystone     return meth(obj, **kw)
  2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib/python2.6/site-packages/migrate/changeset/ansisql.py", line 103, in visit_column
  2014-08-26 16:07:38.888 11464 TRACE keystone     self.execute()
  2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib/python2.6/site-packages/migrate/changeset/ansisql.py", line 44, in execute
  2014-08-26 16:07:38.888 11464 TRACE keystone     return self.connection.execute(self.buffer.getvalue())
  2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 662, in execute
  2014-08-26 16:07:38.888 11464 TRACE keystone     params)
  2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 805, in _execute_text
  2014-08-26 16:07:38.888 11464 TRACE keystone     statement, parameters
  2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 874, in _execute_context
  2014-08-26 16:07:38.888 11464 TRACE keystone     context)
  2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 1024, in _handle_dbapi_exception
  2014-08-26 16:07:38.888 11464 TRACE keystone     exc_info
  2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib64/python2.6/site-packages/sqlalchemy/util/compat.py", line 196, in raise_from_cause
  2014-08-26 16:07:38.888 11464 TRACE keystone     reraise(type(exception), exception, tb=exc_tb)
  2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/base.py", line 867, in _execute_context
  2014-08-26 16:07:38.888 11464 TRACE keystone     context)
  2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib64/python2.6/site-packages/sqlalchemy/engine/default.py", line 324, in do_execute
  2014-08-26 16:07:38.888 11464 TRACE keystone     cursor.execute(statement, parameters)
  2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib64/python2.6/site-packages/MySQLdb/cursors.py", line 173, in execute
  2014-08-26 16:07:38.888 11464 TRACE keystone     self.errorhandler(self, exc, value)
  2014-08-26 16:07:38.888 11464 TRACE keystone   File "/usr/lib64/python2.6/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
  2014-08-26 16:07:38.888 11464 TRACE keystone     raise errorclass, errorvalue
  2014-08-26 16:07:38.888 11464 TRACE keystone OperationalError: (OperationalError) (1060, "Duplicate column name 'valid'") '\nALTER TABLE token ADD valid BOOL' ()
  2014-08-26 16:07:38.888 11464 TRACE keystone 

  It seems to be trying to add columns where they already exist.

  Best Regards,
  Leigh Hayward

To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1362039/+subscriptions


Follow ups

References