无论在控制台还是Dashboard都无法创建或显示安全组,也无法创建网络
比如,执行openstack security group create a命令,得到的错误
Error while executing command: HttpException: Unknown error, {"NeutronError": {"message": "\u8bf7\u6c42\u5931\u8d25\uff1a\u5728\u5904\u7406\u8bf7\u6c42\u65f6\uff0c\u53d1\u751f\u5185\u90e8\u670d\u52a1\u5668\u9519\u8bef\u3002", "type": "HTTPInternalServerError", "detail": ""}}
我们知道\u表示unicdoe编码,那一串unicode编码的意思是“请求失败:在处理请求时,发生内部服务器错误”,显然无法指引我们解决问题,查看Neutron日志/var/log/neutron/server.log,发现这样的错误
2018-07-25 11:24:13.762 3691 ERROR neutron.api.v2.resource [req-183ea509-0b1d-4387-b5e5-995a8d75d079 8d
561f1322ec4e1392b6154fcd082129 a7d9d874f8aa403cb5a67dbb45a68b77 - default default] create failed: No de
tails.: DBDataError: (pymysql.err.InternalError) (1366, u"Incorrect string value: '\\xE7\\xBC\\xBA\\xE7
\\x9C\\x81...' for column 'description' at row 1") [SQL: u'INSERT INTO standardattributes (resource_typ
e, description, created_at, updated_at) VALUES (%(resource_type)s, %(description)s, %(created_at)s, %(u
pdated_at)s)'] [parameters: {'created_at': datetime.datetime(2018, 7, 25, 3, 24, 13), 'description': u'
\u7f3a\u7701\u5b89\u5168\u7ec4', 'resource_type': 'securitygroups', 'updated_at': datetime.datetime(201
8, 7, 25, 3, 24, 13)}] (Background on this error at: http://sqlalche.me/e/2j85)
其实基本也看不出什么,但是create failed: No de
tails.: DBDataError: (pymysql.err.InternalError) (1366, u"Incorrect string value: '\\xE7\\xBC\\xBA\\xE7
\\x9C\\x81...' for column 'description' at row 1") [SQL: u'INSERT INTO standardattributes,看起来是插入的值不对,\\xE7\\xBC\\xBA\\xE7\\x9C\\x81应该是ASCII编码,因此问题出在这。
到现在明白了,可能插入的值需要unicode编码。修改数据库即可解决此问题(做的时候忘了做这一步了?!!)
nano /etc/my.cnf.d/openstack.cnf
[mysqld]
bind-address = 192.168.10.17
default-storage-engine = innodb
innodb_file_per_table = on
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8
附注mysql修改编码:https://www.cnblogs.com/eRrsr/p/6044227.html