OS: CentOS9 stream
OpenstackVersion: Anterope
placement-apiのエンドポイントが500で返ってくる。
curl http://localhost:8778 --insecure <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>500 Internal Server Error</title> </head><body> <h1>Internal Server Error</h1> <p>The server encountered an internal error or misconfiguration and was unable to complete your request.</p> <p>Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.</p> <p>More information about this error may be available in the server error log.</p> </body></html>
また、placement-apiのログを見てみると、次のようなエラーが出ている。
mod_wsgi (pid=1894): Failed to exec Python script file '/usr/bin/placement-api'.
mod_wsgi (pid=1894): Exception occurred processing WSGI script '/usr/bin/placement-api'.
Traceback (most recent call last):
File "/usr/bin/placement-api", line 52, in <module>
application = init_application()
File "/usr/lib/python3.9/site-packages/placement/wsgi.py", line 131, in init_application
_parse_args(config, [], default_config_files=conffiles)
File "/usr/lib/python3.9/site-packages/placement/wsgi.py", line 81, in _parse_args
config(argv[1:], project='placement',
File "/usr/lib/python3.9/site-packages/oslo_config/cfg.py", line 2153, in __call__
self._namespace = self._parse_cli_opts(args if args is not None
File "/usr/lib/python3.9/site-packages/oslo_config/cfg.py", line 2924, in _parse_cli_opts
return self._parse_config_files()
File "/usr/lib/python3.9/site-packages/oslo_config/cfg.py", line 2941, in _parse_config_files
ConfigParser._parse_file(config_file, namespace)
File "/usr/lib/python3.9/site-packages/oslo_config/cfg.py", line 1626, in _parse_file
parser.parse()
File "/usr/lib/python3.9/site-packages/oslo_config/cfg.py", line 1581, in parse
return super(ConfigParser, self).parse(f.readlines())
File "/usr/lib64/python3.9/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe8 in position 374: ordinal not in range(128)
/etc/placement/placement.confは次のように書いていたが、#のコメントアウト文が悪さをしていた模様。
上記エラーを見てみると、pythonで引数を取ろうとした時に、ASCII文字が含まれていてdecodeできない。みたいなのが出ていた。
[DEFAULT] debug = false [api] auth_strategy = keystone [keystone_authtoken] www_authenticate_uri = https://vamdemic.world:5000 auth_url = https://vamdemic.world:5000 memcached_servers = vamdemic.world:11211 auth_type = password project_domain_name = default user_domain_name = default project_name = service username = placement password = servicepassword insecure = true # 自己証明書はtrue [placement_database] connection = mysql+pymysql://placement:password@vamdemic.world/placement
結論、コメントアウト文を消すか、英語でコメント文を書けばOK。
[DEFAULT] debug = false [api] auth_strategy = keystone [keystone_authtoken] www_authenticate_uri = https://vamdemic.world:5000 auth_url = https://vamdemic.world:5000 memcached_servers = vamdemic.world:11211 auth_type = password project_domain_name = default user_domain_name = default project_name = service username = placement password = servicepassword insecure = true [placement_database] connection = mysql+pymysql://placement:password@vamdemic.world/placement
参考手順は、こちら
https://www.server-world.info/query?os=CentOS_Stream_9&p=openstack_antelope&f=8
