MySQL/UTF-8: Issue while executing nova-manage db sync

Bug #829209 reported by Rasika Karunathilaka on 2011-08-19
30
This bug affects 6 people
Affects Status Importance Assigned to Milestone
MySQL Server
Unknown
Unknown
OpenStack Compute (nova)
Low
Peng Yong

Bug Description

When executing "/usr/bin/nova-manage db sync" following error was given at /var/log/manage/nova-manage.log.
Nova compute is trying to configure with MY SQL 5.1.53

(nova): TRACE: raise errorclass, errorvalue(nova): TRACE: OperationalError: (OperationalError) (1071, 'Specified key was too long; max key length is 1000 bytes') '\nCREATE TABLE user_project_association (\n\tcreated_at DATETIME, \n\tupdated_at DATETIME, \n\tdeleted_at DATETIME, \n\tdeleted BOOL, \n\tuser_id VARCHAR(255) NOT NULL, \n\tproject_id VARCHAR(255) NOT NULL, \n\tPRIMARY KEY (user_id, project_id), \n\tCHECK (deleted IN (0, 1)), \n\tFOREIGN KEY(project_id) REFERENCES projects (id), \n\tFOREIGN KEY(user_id) REFERENCES users (id)\n)\n\n' ()(nova): TRACE:

Thierry Carrez (ttx) wrote :

In UTF-8, PRIMARY KEY (user_id, project_id) with user_id VARCHAR(255) project_id VARCHAR(255) ends up being bigger than 1000 bytes.

Could you try "latin1" as the default charset ?

Changed in nova:
status: New → Incomplete
summary: - Issue while executing nova-manage db sync
+ MySQL/UTF-8: Issue while executing nova-manage db sync

Hi Thierry,
 After setting the CHARACTER SET AS 'latin1' it worked.

Thierry Carrez (ttx) on 2011-08-19
Changed in nova:
importance: Undecided → Low
status: Incomplete → Confirmed
Peng Yong (ppyy) wrote :

two method:
1. don't use UTF-8 as default character-set of mysql server, use latin1

or

2. don't use MYISAM as table type, please convert to INNODB
myisam has a limit for key, it's 1K long.

vi /etc/my.cnf

[mysqld]

default_table_type = InnoDB

character-set-server=utf8
init_connect=’SET NAMES utf8′

Changed in nova:
assignee: nobody → Peng Yong (ppyy)
Dolph Mathews (dolph) wrote :

What's the key that's being inserted?

Keystone supports UTF-8 ID's, so switching to latin1 doesn't seem like a real solution to me.

Dolph Mathews (dolph) wrote :

This might also be fixed by improved UTF-8 support in MySQL 5.5: http://dev.mysql.com/doc/refman/5.5/en/charset-unicode.html

Sean Dague (sdague) wrote :

nova now requires all database to be innodb, so I think we're ok now (this was released in Folsom)

Changed in nova:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.