Hit the same issue with follow error message, will look into the issue and check whether this is caused by the old .pyc as ayong methioned.
/usr/local/bin/keystone-manage db_sync --extension endpoint_filter
31365 TRACE keystone Traceback (most recent call last): 31365 TRACE keystone File "/usr/local/bin/keystone-manage", line 6, in <module> 31365 TRACE keystone exec(compile(open(__file__).read(), __file__, 'exec')) 31365 TRACE keystone File "/opt/stack/keystone/bin/keystone-manage", line 44, in <module> 31365 TRACE keystone cli.main(argv=sys.argv, config_files=config_files) 31365 TRACE keystone File "/opt/stack/keystone/keystone/cli.py", line 311, in main 31365 TRACE keystone CONF.command.cmd_class.main() 31365 TRACE keystone File "/opt/stack/keystone/keystone/cli.py", line 74, in main 31365 TRACE keystone migration_helpers.sync_database_to_version(extension, version) 31365 TRACE keystone File "/opt/stack/keystone/keystone/common/sql/migration_helpers.py", line 211, in sync_database_to_version 31365 TRACE keystone _sync_extension_repo(extension, version) 31365 TRACE keystone File "/opt/stack/keystone/keystone/common/sql/migration_helpers.py", line 199, in _sync_extension_repo 31365 TRACE keystone init_version=init_version) 31365 TRACE keystone File "/usr/local/lib/python2.7/dist-packages/oslo_db/sqlalchemy/migration.py", line 79, in db_sync 31365 TRACE keystone return versioning_api.upgrade(engine, repository, version) 31365 TRACE keystone File "/usr/local/lib/python2.7/dist-packages/migrate/versioning/api.py", line 186, in upgrade 31365 TRACE keystone return _migrate(url, repository, version, upgrade=True, err=err, **opts) 31365 TRACE keystone File "<string>", line 2, in _migrate 31365 TRACE keystone File "/usr/local/lib/python2.7/dist-packages/migrate/versioning/util/__init__.py", line 160, in with_engine 31365 TRACE keystone return f(*a, **kw) 31365 TRACE keystone File "/usr/local/lib/python2.7/dist-packages/migrate/versioning/api.py", line 366, in _migrate 31365 TRACE keystone schema.runchange(ver, change, changeset.step) 31365 TRACE keystone File "/usr/local/lib/python2.7/dist-packages/migrate/versioning/schema.py", line 93, in runchange 31365 TRACE keystone change.run(self.engine, step) 31365 TRACE keystone File "/usr/local/lib/python2.7/dist-packages/migrate/versioning/script/py.py", line 148, in run 31365 TRACE keystone script_func(engine) 31365 TRACE keystone File "/opt/stack/keystone/keystone/contrib/endpoint_filter/migrate_repo/versions/002_add_endpoint_groups.py", line 41, in upgrade 31365 TRACE keystone project_endpoint_group_table.create(migrate_engine, checkfirst=True) 31365 TRACE keystone File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/schema.py", line 707, in create 31365 TRACE keystone checkfirst=checkfirst) 31365 TRACE keystone File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1616, in _run_visitor 31365 TRACE keystone conn._run_visitor(visitorcallable, element, **kwargs) 31365 TRACE keystone File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1245, in _run_visitor 31365 TRACE keystone **kwargs).traverse_single(element) 31365 TRACE keystone File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/visitors.py", line 120, in traverse_single 31365 TRACE keystone return meth(obj, **kw) 31365 TRACE keystone File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/ddl.py", line 732, in visit_table 31365 TRACE keystone self.connection.execute(CreateTable(table)) 31365 TRACE keystone File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 729, in execute 31365 TRACE keystone return meth(self, multiparams, params) 31365 TRACE keystone File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/ddl.py", line 69, in _execute_on_connection 31365 TRACE keystone return connection._execute_ddl(self, multiparams, params) 31365 TRACE keystone File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 783, in _execute_ddl 31365 TRACE keystone compiled 31365 TRACE keystone File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 958, in _execute_context 31365 TRACE keystone context) 31365 TRACE keystone File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1155, in _handle_dbapi_exception 31365 TRACE keystone util.raise_from_cause(newraise, exc_info) 31365 TRACE keystone File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py", line 199, in raise_from_cause 31365 TRACE keystone reraise(type(exception), exception, tb=exc_tb) 31365 TRACE keystone File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 951, in _execute_context 31365 TRACE keystone context) 31365 TRACE keystone File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 436, in do_execute 31365 TRACE keystone cursor.execute(statement, parameters) 31365 TRACE keystone File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 205, in execute 31365 TRACE keystone self.errorhandler(self, exc, value) 31365 TRACE keystone File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler 31365 TRACE keystone raise errorclass, errorvalue 31365 TRACE keystone OperationalError: (OperationalError) (1005, "Can't create table 'keystone.project_endpoint_group' (errno: 150)") '\nCREATE TABLE project_endpoint_group (\n\tendpoint_group_id VARCHAR(64) NOT NULL, \n\tproject_id VARCHAR(64) NOT NULL, \n\tPRIMARY KEY (endpoint_group_id, project_id), \n\tFOREIGN KEY(endpoint_group_id) REFERENCES endpoint_group (id)\n)\n\n' () 31365 TRACE keystone
Hit the same issue with follow error message, will look into the issue and check whether this is caused by the old .pyc as ayong methioned.
/usr/local/ bin/keystone- manage db_sync --extension endpoint_filter
31365 TRACE keystone Traceback (most recent call last): bin/keystone- manage" , line 6, in <module> open(__ file__) .read() , __file__, 'exec')) keystone/ bin/keystone- manage" , line 44, in <module> argv=sys. argv, config_ files=config_ files) keystone/ keystone/ cli.py" , line 311, in main cmd_class. main() keystone/ keystone/ cli.py" , line 74, in main helpers. sync_database_ to_version( extension, version) keystone/ keystone/ common/ sql/migration_ helpers. py", line 211, in sync_database_ to_version _repo(extension , version) keystone/ keystone/ common/ sql/migration_ helpers. py", line 199, in _sync_extension _repo init_version) lib/python2. 7/dist- packages/ oslo_db/ sqlalchemy/ migration. py", line 79, in db_sync api.upgrade( engine, repository, version) lib/python2. 7/dist- packages/ migrate/ versioning/ api.py" , line 186, in upgrade lib/python2. 7/dist- packages/ migrate/ versioning/ util/__ init__. py", line 160, in with_engine lib/python2. 7/dist- packages/ migrate/ versioning/ api.py" , line 366, in _migrate runchange( ver, change, changeset.step) lib/python2. 7/dist- packages/ migrate/ versioning/ schema. py", line 93, in runchange run(self. engine, step) lib/python2. 7/dist- packages/ migrate/ versioning/ script/ py.py", line 148, in run keystone/ keystone/ contrib/ endpoint_ filter/ migrate_ repo/versions/ 002_add_ endpoint_ groups. py", line 41, in upgrade endpoint_ group_table. create( migrate_ engine, checkfirst=True) lib/python2. 7/dist- packages/ sqlalchemy/ sql/schema. py", line 707, in create checkfirst) lib/python2. 7/dist- packages/ sqlalchemy/ engine/ base.py" , line 1616, in _run_visitor visitor( visitorcallable , element, **kwargs) lib/python2. 7/dist- packages/ sqlalchemy/ engine/ base.py" , line 1245, in _run_visitor .traverse_ single( element) lib/python2. 7/dist- packages/ sqlalchemy/ sql/visitors. py", line 120, in traverse_single lib/python2. 7/dist- packages/ sqlalchemy/ sql/ddl. py", line 732, in visit_table .execute( CreateTable( table)) lib/python2. 7/dist- packages/ sqlalchemy/ engine/ base.py" , line 729, in execute lib/python2. 7/dist- packages/ sqlalchemy/ sql/ddl. py", line 69, in _execute_ on_connection _execute_ ddl(self, multiparams, params) lib/python2. 7/dist- packages/ sqlalchemy/ engine/ base.py" , line 783, in _execute_ddl lib/python2. 7/dist- packages/ sqlalchemy/ engine/ base.py" , line 958, in _execute_context lib/python2. 7/dist- packages/ sqlalchemy/ engine/ base.py" , line 1155, in _handle_ dbapi_exception from_cause( newraise, exc_info) lib/python2. 7/dist- packages/ sqlalchemy/ util/compat. py", line 199, in raise_from_cause type(exception) , exception, tb=exc_tb) lib/python2. 7/dist- packages/ sqlalchemy/ engine/ base.py" , line 951, in _execute_context lib/python2. 7/dist- packages/ sqlalchemy/ engine/ default. py", line 436, in do_execute execute( statement, parameters) lib/python2. 7/dist- packages/ MySQLdb/ cursors. py", line 205, in execute er(self, exc, value) lib/python2. 7/dist- packages/ MySQLdb/ connections. py", line 36, in defaulterrorhandler project_ endpoint_ group' (errno: 150)") '\nCREATE TABLE project_ endpoint_ group (\n\tendpoint_ group_id VARCHAR(64) NOT NULL, \n\tproject_id VARCHAR(64) NOT NULL, \n\tPRIMARY KEY (endpoint_group_id, project_id), \n\tFOREIGN KEY(endpoint_ group_id) REFERENCES endpoint_group (id)\n)\n\n' ()
31365 TRACE keystone File "/usr/local/
31365 TRACE keystone exec(compile(
31365 TRACE keystone File "/opt/stack/
31365 TRACE keystone cli.main(
31365 TRACE keystone File "/opt/stack/
31365 TRACE keystone CONF.command.
31365 TRACE keystone File "/opt/stack/
31365 TRACE keystone migration_
31365 TRACE keystone File "/opt/stack/
31365 TRACE keystone _sync_extension
31365 TRACE keystone File "/opt/stack/
31365 TRACE keystone init_version=
31365 TRACE keystone File "/usr/local/
31365 TRACE keystone return versioning_
31365 TRACE keystone File "/usr/local/
31365 TRACE keystone return _migrate(url, repository, version, upgrade=True, err=err, **opts)
31365 TRACE keystone File "<string>", line 2, in _migrate
31365 TRACE keystone File "/usr/local/
31365 TRACE keystone return f(*a, **kw)
31365 TRACE keystone File "/usr/local/
31365 TRACE keystone schema.
31365 TRACE keystone File "/usr/local/
31365 TRACE keystone change.
31365 TRACE keystone File "/usr/local/
31365 TRACE keystone script_func(engine)
31365 TRACE keystone File "/opt/stack/
31365 TRACE keystone project_
31365 TRACE keystone File "/usr/local/
31365 TRACE keystone checkfirst=
31365 TRACE keystone File "/usr/local/
31365 TRACE keystone conn._run_
31365 TRACE keystone File "/usr/local/
31365 TRACE keystone **kwargs)
31365 TRACE keystone File "/usr/local/
31365 TRACE keystone return meth(obj, **kw)
31365 TRACE keystone File "/usr/local/
31365 TRACE keystone self.connection
31365 TRACE keystone File "/usr/local/
31365 TRACE keystone return meth(self, multiparams, params)
31365 TRACE keystone File "/usr/local/
31365 TRACE keystone return connection.
31365 TRACE keystone File "/usr/local/
31365 TRACE keystone compiled
31365 TRACE keystone File "/usr/local/
31365 TRACE keystone context)
31365 TRACE keystone File "/usr/local/
31365 TRACE keystone util.raise_
31365 TRACE keystone File "/usr/local/
31365 TRACE keystone reraise(
31365 TRACE keystone File "/usr/local/
31365 TRACE keystone context)
31365 TRACE keystone File "/usr/local/
31365 TRACE keystone cursor.
31365 TRACE keystone File "/usr/local/
31365 TRACE keystone self.errorhandl
31365 TRACE keystone File "/usr/local/
31365 TRACE keystone raise errorclass, errorvalue
31365 TRACE keystone OperationalError: (OperationalError) (1005, "Can't create table 'keystone.
31365 TRACE keystone