Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Mitaka on 16.04 Xenial and mysql's new default utf8mb4 charset

Fresh install of Mitaka on default install of Xenial fails during populating the database steps.

The default character set of mysqld in Debian has been changed to utf8mb4 (from utf8), and "glance-manage db_sync" fails with:

2016-04-26 16:09:13.091 21061 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']

The length of the key for 'repository_id' with max 250 chars and 4 bytes per char makes it longer than the 767 allowed by innodb.

http://docs.openstack.org/mitaka/install-guide-ubuntu/glance-install.html#prerequisites

Note:this was a multi-region setup, so glance was first component that needed a database sync. Most likely keystone install would also fail if one did install the identity service (during "keystone-manage db_sync") - http://docs.openstack.org/mitaka/install-guide-ubuntu/keystone-install.html

The settings in /etc/mysql/conf.d/openstack.cnf (eg, "character-set-server = utf8", init-connect and collation-server) don't seem to suffice.

Need to also set the following:

/etc/mysql/mariadb.conf.d/50-server.cnf:character-set-server = utf8

/etc/mysql/mariadb.conf.d/50-server.cnf:collation-server = utf8_general_ci

/etc/mysql/mariadb.conf.d/50-client.cnf:default-character-set = utf8

/etc/mysql/mariadb.conf.d/50-mysql-clients.cnf:default-character-set = utf8

Had the above logged to https://bugs.launchpad.net/openstack-manuals/+bug/1575688 in case you need to follow-up