yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #52584
[Bug 1594592] [NEW] federated_user table failed functional test if db engine is MyISAM
Public bug reported:
094_add_federated_user_table.py failed functional test if the default db
engine is MyISAM for MySQL. We need to follow the established pattern of
adding the following
mysql_engine='InnoDB',
mysql_charset='utf8'
to the script during table creation.
Here's an example of one of the failures.
keystone.tests.unit.test_sql_upgrade.MySQLOpportunisticUpgradeTestCase.test_migration_96_constraint_exists
----------------------------------------------------------------------------------------------------------
Captured traceback:
~~~~~~~~~~~~~~~~~~~
Traceback (most recent call last):
File "keystone/tests/unit/test_sql_upgrade.py", line 1113, in test_migration_96_constraint_exists
self.upgrade(95)
File "keystone/tests/unit/test_sql_upgrade.py", line 262, in upgrade
self._migrate(*args, **kwargs)
File "keystone/tests/unit/test_sql_upgrade.py", line 276, in _migrate
self.schema_.runchange(ver, change, changeset.step)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/migrate/versioning/schema.py", line 93, in runchange
change.run(self.engine, step)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/migrate/versioning/script/py.py", line 148, in run
script_func(engine)
File "/home/gyee/projects/keystone/keystone/common/sql/migrate_repo/versions/094_add_federated_user_table.py", line 39, in upgrade
federated_table.create(migrate_engine, checkfirst=True)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/sql/schema.py", line 725, in create
checkfirst=checkfirst)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1856, in _run_visitor
conn._run_visitor(visitorcallable, element, **kwargs)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1481, in _run_visitor
**kwargs).traverse_single(element)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/sql/visitors.py", line 121, in traverse_single
return meth(obj, **kw)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/sql/ddl.py", line 764, in visit_table
include_foreign_key_constraints=include_foreign_key_constraints
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 914, in execute
return meth(self, multiparams, params)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/sql/ddl.py", line 68, in _execute_on_connection
return connection._execute_ddl(self, multiparams, params)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 968, in _execute_ddl
compiled
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1146, in _execute_context
context)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1337, in _handle_dbapi_exception
util.raise_from_cause(newraise, exc_info)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 202, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
context)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 450, in do_execute
cursor.execute(statement, parameters)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/pymysql/cursors.py", line 161, in execute
result = self._query(query)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/pymysql/cursors.py", line 317, in _query
conn.query(q)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/pymysql/connections.py", line 835, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/pymysql/connections.py", line 1019, in _read_query_result
result.read()
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/pymysql/connections.py", line 1302, in read
first_packet = self.connection._read_packet()
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/pymysql/connections.py", line 981, in _read_packet
packet.check_error()
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/pymysql/connections.py", line 393, in check_error
err.raise_mysql_exception(self._data)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/pymysql/err.py", line 120, in raise_mysql_exception
_check_mysql_exception(errinfo)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/pymysql/err.py", line 115, in _check_mysql_exception
raise InternalError(errno, errorvalue)
oslo_db.exception.DBError: (pymysql.err.InternalError) (1071, u'Specified key was too long; max key length is 1000 bytes') [SQL: u'\nCREATE TABLE federated_user (\n\tid INTEGER NOT NULL AUTO_INCREMENT, \n\tuser_id VARCHAR(64) NOT NULL, \n\tidp_id VARCHAR(64) NOT NULL, \n\tprotocol_id VARCHAR(64) NOT NULL, \n\tunique_id VARCHAR(255) NOT NULL, \n\tdisplay_name VARCHAR(255), \n\tPRIMARY KEY (id), \n\tUNIQUE (idp_id, protocol_id, unique_id), \n\tFOREIGN KEY(user_id) REFERENCES user (id) ON DELETE CASCADE, \n\tFOREIGN KEY(idp_id) REFERENCES identity_provider (id) ON DELETE CASCADE\n)\n\n']
** Affects: keystone
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Identity (keystone).
https://bugs.launchpad.net/bugs/1594592
Title:
federated_user table failed functional test if db engine is MyISAM
Status in OpenStack Identity (keystone):
New
Bug description:
094_add_federated_user_table.py failed functional test if the default
db engine is MyISAM for MySQL. We need to follow the established
pattern of adding the following
mysql_engine='InnoDB',
mysql_charset='utf8'
to the script during table creation.
Here's an example of one of the failures.
keystone.tests.unit.test_sql_upgrade.MySQLOpportunisticUpgradeTestCase.test_migration_96_constraint_exists
----------------------------------------------------------------------------------------------------------
Captured traceback:
~~~~~~~~~~~~~~~~~~~
Traceback (most recent call last):
File "keystone/tests/unit/test_sql_upgrade.py", line 1113, in test_migration_96_constraint_exists
self.upgrade(95)
File "keystone/tests/unit/test_sql_upgrade.py", line 262, in upgrade
self._migrate(*args, **kwargs)
File "keystone/tests/unit/test_sql_upgrade.py", line 276, in _migrate
self.schema_.runchange(ver, change, changeset.step)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/migrate/versioning/schema.py", line 93, in runchange
change.run(self.engine, step)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/migrate/versioning/script/py.py", line 148, in run
script_func(engine)
File "/home/gyee/projects/keystone/keystone/common/sql/migrate_repo/versions/094_add_federated_user_table.py", line 39, in upgrade
federated_table.create(migrate_engine, checkfirst=True)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/sql/schema.py", line 725, in create
checkfirst=checkfirst)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1856, in _run_visitor
conn._run_visitor(visitorcallable, element, **kwargs)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1481, in _run_visitor
**kwargs).traverse_single(element)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/sql/visitors.py", line 121, in traverse_single
return meth(obj, **kw)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/sql/ddl.py", line 764, in visit_table
include_foreign_key_constraints=include_foreign_key_constraints
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 914, in execute
return meth(self, multiparams, params)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/sql/ddl.py", line 68, in _execute_on_connection
return connection._execute_ddl(self, multiparams, params)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 968, in _execute_ddl
compiled
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1146, in _execute_context
context)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1337, in _handle_dbapi_exception
util.raise_from_cause(newraise, exc_info)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 202, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
context)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 450, in do_execute
cursor.execute(statement, parameters)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/pymysql/cursors.py", line 161, in execute
result = self._query(query)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/pymysql/cursors.py", line 317, in _query
conn.query(q)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/pymysql/connections.py", line 835, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/pymysql/connections.py", line 1019, in _read_query_result
result.read()
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/pymysql/connections.py", line 1302, in read
first_packet = self.connection._read_packet()
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/pymysql/connections.py", line 981, in _read_packet
packet.check_error()
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/pymysql/connections.py", line 393, in check_error
err.raise_mysql_exception(self._data)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/pymysql/err.py", line 120, in raise_mysql_exception
_check_mysql_exception(errinfo)
File "/home/gyee/projects/keystone/.tox/py27/local/lib/python2.7/site-packages/pymysql/err.py", line 115, in _check_mysql_exception
raise InternalError(errno, errorvalue)
oslo_db.exception.DBError: (pymysql.err.InternalError) (1071, u'Specified key was too long; max key length is 1000 bytes') [SQL: u'\nCREATE TABLE federated_user (\n\tid INTEGER NOT NULL AUTO_INCREMENT, \n\tuser_id VARCHAR(64) NOT NULL, \n\tidp_id VARCHAR(64) NOT NULL, \n\tprotocol_id VARCHAR(64) NOT NULL, \n\tunique_id VARCHAR(255) NOT NULL, \n\tdisplay_name VARCHAR(255), \n\tPRIMARY KEY (id), \n\tUNIQUE (idp_id, protocol_id, unique_id), \n\tFOREIGN KEY(user_id) REFERENCES user (id) ON DELETE CASCADE, \n\tFOREIGN KEY(idp_id) REFERENCES identity_provider (id) ON DELETE CASCADE\n)\n\n']
To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1594592/+subscriptions
Follow ups