360SDN.COM

openstack keystone安装错误总结:http:409,http:500

来源:  2019-04-12 14:40:51    评论:0点击:

我们经常遇到的
http 409的原因是什么?
http http 500原因是什么?


错误1:http 409
Unable to communicate with identity service: {"error": {"message": "Conflict occurred attempting to store project. (1062, \"Duplicate entry 'default-admin' for key 'domain_id'\")", "code": 409, "title": "Conflict"}}. (HTTP 409)
Unable to communicate with identity service: {"error": {"message": "Conflict occurred attempting to store project. (1062, \"Duplicate entry 'default-service' for key 'domain_id'\")", "code": 409, "title": "Conflict"}}. (HTTP 409)
Unable to communicate with identity service: {"error": {"message": "Conflict occurred attempting to store project. (1062, \"Duplicate entry 'default-demo' for key 'domain_id'\")", "code": 409, "title": "Conflict"}}. (HTTP 409)
Unable to communicate with identity service: {"error": {"message": "Conflict occurred attempting to store project. (1062, \"Duplicate entry 'default-invisible_to_admin' for key 'domain_id'\")", "code": 409, "title": "Conflict"}}. (HTTP 409)
Unable to communicate with identity service: {"error": {"message": "Conflict occurred attempting to store user. (1062, \"Duplicate entry 'default-admin' for key 'domain_id'\")", "code": 409, "title": "Conflict"}}. (HTTP 409)
Unable to communicate with identity service: {"error": {"message": "Conflict occurred attempting to store user. (1062, \"Duplicate entry 'default-demo' for key 'domain_id'\")", "code": 409, "title": "Conflict"}}. (HTTP 409)
Unable to communicate with identity service: {"error": {"message": "Conflict occurred attempting to store role. (1062, \"Duplicate entry 'admin' for key 'name'\")", "code": 409, "title": "Conflict"}}. (HTTP 409)
Unable to communicate with identity service: {"error": {"message": "Conflict occurred attempting to store role. (1062, \"Duplicate entry 'KeystoneAdmin' for key 'name'\")", "code": 409, "title": "Conflict"}}. (HTTP 409)
Unable to communicate with identity service: {"error": {"message": "Conflict occurred attempting to store role. (1062, \"Duplicate entry 'KeystoneServiceAdmin' for key 'name'\")", "code": 409, "title": "Conflict"}}. (HTTP 409)
 

解决办法:
mysql> drop database keystone;
mysql> create database keystone;
 


分析:

上面的命令是首先删除数据库keystone,然后创建数据库,但是有一个问题我们忽略了,就是创建数据库,不等于创建表,所以我们还需要同步数据库
keystone-manage db_sync;同步数据的作用:是在数据库中创建表(tablle)。如果不创建表会有什么错误那,下面便是其中一种。

错误2:http 500

./keystone_basic.sh
Unable to communicate with identity service: {"error": {"message": "An unexpected error prevented the server from fulfilling your request. (ProgrammingError) (1146, \"Table 'keystone.project' doesn't exist\") 'INSERT INTO project (id, name, domain_id, description, enabled, extra) VALUES (%s, %s, %s, %s, %s, %s)' ('a1029ea8dafb4b97bcd590bd8539f3ec', 'admin', 'default', None, 1, '{}')", "code": 500, "title": "Internal Server Error"}}. (HTTP 500)
Unable to communicate with identity service: {"error": {"message": "An unexpected error prevented the server from fulfilling your request. (ProgrammingError) (1146, \"Table 'keystone.project' doesn't exist\") 'INSERT INTO project (id, name, domain_id, description, enabled, extra) VALUES (%s, %s, %s, %s, %s, %s)' ('30493fd3002b4835a5319020cfe960b5', 'service', 'default', None, 1, '{}')", "code": 500, "title": "Internal Server Error"}}. (HTTP 500)
Unable to communicate with identity service: {"error": {"message": "An unexpected error prevented the server from fulfilling your request. (ProgrammingError) (1146, \"Table 'keystone.user' doesn't exist\") 'INSERT INTO user (id, name, domain_id, password, enabled, extra) VALUES (%s, %s, %s, %s, %s, %s)' ('edd21db1020f4a7ca34706f74f390877', 'admin', 'default', '$6$rounds=40000$YTx1zfCLelYEqfpZ$RkB57QIlFWJn/PIL8xL8YBCY6cEOmovfQIKQk3H9MtsFTyvYAz2Q.72i11YQHS1yukFGyqAQaqPgIX9B3rkjI1', 1, '{\"email\": \"admin@domain.com\", \"tenantId\": null}')", "code": 500, "title": "Internal Server Error"}}. (HTTP 500)
Unable to communicate with identity service: {"error": {"message": "An unexpected error prevented the server from fulfilling your request. (ProgrammingError) (1146, \"Table 'keystone.role' doesn't exist\") 'INSERT INTO role (id, name, extra) VALUES (%s, %s, %s)' ('44f7cd8925d14388aa44197db9c1f076', 'admin', '{}')", "code": 500, "title": "Internal Server Error"}}. (HTTP 500)
Unable to communicate with identity service: {"error": {"message": "An unexpected error prevented the server from fulfilling your request. (ProgrammingError) (1146, \"Table 'keystone.role' doesn't exist\") 'INSERT INTO role (id, name, extra) VALUES (%s, %s, %s)' ('398c0e9413364d8f81e8756e12206bfd', 'KeystoneAdmin', '{}')", "code": 500, "title": "Internal Server Error"}}. (HTTP 500)
Unable to communicate with identity service: {"error": {"message": "An unexpected error prevented the server from fulfilling your request. (ProgrammingError) (1146, \"Table 'keystone.role' doesn't exist\") 'INSERT INTO role (id, name, extra) VALUES (%s, %s, %s)' ('2a333360894d4a989b84611596c81424', 'KeystoneServiceAdmin', '{}')", "code": 500, "title": "Internal Server Error"}}. (HTTP 500)
usage: keystone user-role-add --user <user> --role <role> [--tenant <tenant>]
keystone user-role-add: error: argument --user/--user-id/--user_id: expected one argument
usage: keystone user-role-add --user <user> --role <role> [--tenant <tenant>]
keystone user-role-add: error: argument --user/--user-id/--user_id: expected one argument
usage: keystone user-role-add --user <user> --role <role> [--tenant <tenant>]
keystone user-role-add: error: argument --user/--user-id/--user_id: expected one argument
Unable to communicate with identity service: {"error": {"message": "An unexpected error prevented the server from fulfilling your request. (ProgrammingError) (1146, \"Table 'keystone.role' doesn't exist\") 'INSERT INTO role (id, name, extra) VALUES (%s, %s, %s)' ('01144c4378324e9fafe5029c8ffe5786', 'Member', '{}')", "code": 500, "title": "Internal Server Error"}}. (HTTP 500)
usage: keystone user-create --name <user-name> [--tenant-id <tenant-id>]
                            [--pass <pass>] [--email <email>]
                            [--enabled <true|false>]
keystone user-create: error: argument --tenant-id: expected one argument
usage: keystone user-role-add --user <user> --role <role> [--tenant <tenant>]
keystone user-role-add: error: argument --tenant/--tenant-id: expected one argument
usage: keystone user-create --name <user-name> [--tenant-id <tenant-id>]
                            [--pass <pass>] [--email <email>]
                            [--enabled <true|false>]
keystone user-create: error: argument --tenant-id: expected one argument
usage: keystone user-role-add --user <user> --role <role> [--tenant <tenant>]
keystone user-role-add: error: argument --tenant/--tenant-id: expected one argument
usage: keystone user-create --name <user-name> [--tenant-id <tenant-id>]
                            [--pass <pass>] [--email <email>]
                            [--enabled <true|false>]
keystone user-create: error: argument --tenant-id: expected one argument
usage: keystone user-role-add --user <user> --role <role> [--tenant <tenant>]
keystone user-role-add: error: argument --tenant/--tenant-id: expected one argument
usage: keystone user-create --name <user-name> [--tenant-id <tenant-id>]
                            [--pass <pass>] [--email <email>]
                            [--enabled <true|false>]
keystone user-create: error: argument --tenant-id: expected one argument
usage: keystone user-role-add --user <user> --role <role> [--tenant <tenant>]
keystone user-role-add: error: argument --tenant/--tenant-id: expected one argument
 
解决办法:
mysql> keystone-manage db_sync;
 
分析:
./keystone_basic.sh
当我们执行脚本的时候,Table 'keystone.project' doesn't exist,这表明我们没有创建表,如同我们执行sql语句,insert table (col)values('s'),我们还没有table,所以会产生错误。


 
也有可能是环境变量的问题:
export OS_SERVICE_ENDPOINT=http://127.0.0.1:35357/v2.0
export SERVICE_TOKEN=openstak
为您推荐

友情链接 |九搜汽车网 |手机ok生活信息网|ok生活信息网|ok微生活
 Powered by www.360SDN.COM   京ICP备11022651号-4 © 2012-2016 版权