首页 > 解决方案 > ubuntu openstack ocata - 从身份服务发现版本失败

问题描述

命令:

openstack --os-auth-url http://controller:5000/v3 \
--os-project-domain-name default --os-user-domain-name default \
--os-project-name demo --os-username demo token issue

错误:

创建密码插件时,从身份服务发现版本失败。试图从 URL 确定版本。内部服务器错误 (HTTP 500)

keystone.log 中出现错误:

 2018-06-12 10:40:05.888577 mod_wsgi (pid=16170): Target WSGI script '/usr/bin/keystone-wsgi-admin' cannot be loaded as Python module.
2018-06-12 10:40:05.888611 mod_wsgi (pid=16170): Exception occurred processing WSGI script '/usr/bin/keystone-wsgi-admin'.
2018-06-12 10:40:05.888634 Traceback (most recent call last):
2018-06-12 10:40:05.888656   File "/usr/bin/keystone-wsgi-admin", line 51, in <module>
2018-06-12 10:40:05.888688     application = initialize_admin_application()
2018-06-12 10:40:05.888702   File "/usr/lib/python2.7/dist-packages/keystone/server/wsgi.py", line 129, in initialize_admin_application
2018-06-12 10:40:05.888726     config_files=_get_config_files())
2018-06-12 10:40:05.888739   File "/usr/lib/python2.7/dist-packages/keystone/server/wsgi.py", line 53, in initialize_application
2018-06-12 10:40:05.888759     common.configure(config_files=config_files)
2018-06-12 10:40:05.888772   File "/usr/lib/python2.7/dist-packages/keystone/server/common.py", line 30, in configure
2018-06-12 10:40:05.888792     keystone.conf.configure()
2018-06-12 10:40:05.888805   File "/usr/lib/python2.7/dist-packages/keystone/conf/__init__.py", line 126, in configure
2018-06-12 10:40:05.888826     help='Do not monkey-patch threading system modules.'))
2018-06-12 10:40:05.888839   File "/usr/lib/python2.7/dist-packages/oslo_config/cfg.py", line 2288, in __inner
2018-06-12 10:40:05.888860     result = f(self, *args, **kwargs)
2018-06-12 10:40:05.888872   File "/usr/lib/python2.7/dist-packages/oslo_config/cfg.py", line 2478, in register_cli_opt
2018-06-12 10:40:05.888892     raise ArgsAlreadyParsedError("cannot register CLI option")
2018-06-12 10:40:05.888915 ArgsAlreadyParsedError: arguments already parsed: cannot register CLI option

错误日志:

[Tue Jun 12 10:12:18.510745 2018] [mpm_event:notice] [pid 29892:tid 139804806121344] AH00491: caught SIGTERM, shutting down
[Tue Jun 12 10:12:29.674244 2018] [wsgi:warn] [pid 16158:tid 139690338350976] mod_wsgi: Compiled for Python/2.7.11.
[Tue Jun 12 10:12:29.674304 2018] [wsgi:warn] [pid 16158:tid 139690338350976] mod_wsgi: Runtime using Python/2.7.12.
[Tue Jun 12 10:12:29.676957 2018] [mpm_event:notice] [pid 16158:tid 139690338350976] AH00489: Apache/2.4.18 (Ubuntu) mod_wsgi/4.3.0 Python/2.7.12 configured -- resuming normal operations
[Tue Jun 12 10:12:29.676985 2018] [core:notice] [pid 16158:tid 139690338350976] AH00094: Command line: '/usr/sbin/apache2'

请有人帮我解决这个问题。

标签: ubuntu-16.04openstack

解决方案


问题解决了。

根据日志,错误出现在 mod_wsgi 中。身份服务的 Web 服务网关接口 (WSGI) 中间件管道在 keystone-paste.ini 文件中配置,因此使用互联网上可用的 openstack docs keystone-paste.ini 文件验证了我的文件,从而更改了管道配置并解决了问题。

我已经编辑了/etc/keystone/keystone-paste.ini文件

  1. 在 [管道:public_api]

    管道 = healthcheck cors sizelimit http_proxy_to_wsgi osprofiler url_normalize request_id

将上面的行更改为:

pipeline = healthcheck cors sizelimit http_proxy_to_wsgi osprofiler url_normalize request_id build_auth_context token_auth json_body ec2_extension public_service 
  1. 同样的方式编辑[管道:admin_api]

    管道 = healthcheck cors sizelimit http_proxy_to_wsgi osprofiler url_normalize request_id

将管道更改为:

pipeline = healthcheck cors sizelimit http_proxy_to_wsgi osprofiler url_normalize request_id build_auth_context token_auth json_body ec2_extension s3_extension admin_service 
  1. 还对 [pipeline:api_v3] 进行了更改

    管道 = healthcheck cors sizelimit http_proxy_to_wsgi osprofiler url_normalize request_id

将上面的行更改为:

pipeline = healthcheck cors sizelimit http_proxy_to_wsgi osprofiler url_normalize request_id build_auth_context token_auth json_body ec2_extension_v3 s3_extension service_v3 

通过进行以下更改问题得到解决。


推荐阅读