Openstack – ERROR oslo_db.sqlalchemy.exc_filters

8 Oct

keystone-error-utf8I have problem when trying to install Openstack keystone, the error was caused by default character set on mysql configuration. Debian using default charset utt8mb4 and we need to change it to utf8. Here is the error message when I ran keystone db_sync:

2017-10-08 12:03:33.453 9714 ERROR oslo_db.sqlalchemy.exc_filters [-] DBAPIError exception wrapped from (pymysql.err.InternalError) (1071, u’Specified key was too long; max key length is 767 bytes’) [SQL: u’\nCREATE TABLE migrate_version (\n\trepository_id VARCHAR(250) NOT NULL, \n\trepository_path TEXT, \n\tversion INTEGER, \n\tPRIMARY KEY (repository_id)\n)\n\n’]

And here is to solve Openstack – ERROR oslo_db.sqlalchemy.exc_filters:

Drop the keystone database:
> mysql -u root -p
> DROP DATABASE keystone;

Then edit /etc/mysql/my.cnf and add the following configuration to end of line:

bind-address =
default-storage-engine = innodb
innodb_file_per_table = on
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8

And restart the mysql service
> service mysql restart

Create keystone database;

And last, please try to run keystone db_sync:
> su -s /bin/sh -c “keystone-manage db_sync” keystone



Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.