Ask Your Question
1

UnicodeError occurs in glance installaion. [closed]

asked 2015-01-09 10:54:57 -0500

darren-wang gravatar image

updated 2015-01-09 19:00:26 -0500

smaffulli gravatar image

Hi, this error occurs when I was installing glance, could anyone help me to fix it? Thanks a lot!

The traceback is listed as below, and when I test with "$ glance image-list", the CLI responds me with "HTTPInternalServerError (HTTP 500)", I can provide with my glance-api.conf and glance-registry.conf if you need.

2015-01-10 00:46:32.917 11534 CRITICAL glance [-] UnicodeError: Message objects do not support str() because they may contain non-ascii characters. Please use unicode() or translate() instead.
2015-01-10 00:46:32.917 11534 TRACE glance Traceback (most recent call last):
2015-01-10 00:46:32.917 11534 TRACE glance   File "/usr/bin/glance-registry", line 10, in <module>
2015-01-10 00:46:32.917 11534 TRACE glance     sys.exit(main())
2015-01-10 00:46:32.917 11534 TRACE glance   File "/usr/lib/python2.7/dist-packages/glance/cmd/registry.py", line 74, in main
2015-01-10 00:46:32.917 11534 TRACE glance     sys.exit("ERROR: %s" % e)
2015-01-10 00:46:32.917 11534 TRACE glance   File "/usr/local/lib/python2.7/dist-packages/oslo/i18n/_message.py", line 167, in __str__
2015-01-10 00:46:32.917 11534 TRACE glance     raise UnicodeError(msg)
2015-01-10 00:46:32.917 11534 TRACE glance UnicodeError: Message objects do not support str() because they may contain non-ascii characters. Please use unicode() or translate() instead.
2015-01-10 00:46:32.917 11534 TRACE glance
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by darren-wang
close date 2015-01-11 22:40:36.582454

2 answers

Sort by ยป oldest newest most voted
1

answered 2015-01-09 19:01:14 -0500

smaffulli gravatar image

This could be a bug, http://lists.openstack.org/pipermail/...

Can you edit your question and specify how you are trying to install glance?

edit flag offensive delete link more

Comments

thx, @smaffulli, seems you are right, since I patched line 74 of glance/cmd/registry.py, this problem has been fixed. But my glance still doesn't work. I installed glance according to the official "installation guide for ubuntu 14.04"

darren-wang gravatar imagedarren-wang ( 2015-01-11 22:38:01 -0500 )edit

Hi, @smaffulli, I updated my question in here,could you have a look at it? Thanks a lot!

darren-wang gravatar imagedarren-wang ( 2015-01-11 23:46:18 -0500 )edit
0

answered 2015-01-09 23:50:54 -0500

Glance tables in icehouse and beyond need to be converted to utf8.

Before upgrading the Image Service database, you must convert the character set for each table to UTF-8.

Use the MySQL client to execute the following commands:

# mysql -u root -p
mysql> SET foreign_key_checks = 0;
mysql> ALTER TABLE glance.image_locations CONVERT TO CHARACTER SET 'utf8';
mysql> ALTER TABLE glance.image_members CONVERT TO CHARACTER SET 'utf8';
mysql> ALTER TABLE glance.image_properties CONVERT TO CHARACTER SET 'utf8';
mysql> ALTER TABLE glance.image_tags CONVERT TO CHARACTER SET 'utf8';
mysql> ALTER TABLE glance.images CONVERT TO CHARACTER SET 'utf8';
mysql> ALTER TABLE glance.migrate_version CONVERT TO CHARACTER SET 'utf8';
mysql> SET foreign_key_checks = 1;
mysql> exit
edit flag offensive delete link more

Comments

Thx @sfcloudman, I tried your recommendation, but it didn't work, seems @smaffulli gave the appropriate fixation, hope it helps!

darren-wang gravatar imagedarren-wang ( 2015-01-11 22:40:22 -0500 )edit

Hi, @sfcloudman, I updated my question in here, could you have a look at it? Thanks a lot!

darren-wang gravatar imagedarren-wang ( 2015-01-11 23:47:38 -0500 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2015-01-09 10:54:57 -0500

Seen: 804 times

Last updated: Jan 09 '15