2023-01-12 06:22:56.877 207474 CRITICAL placement [-] Unhandled error: oslo_config.cfg.ConfigFileValueError: Value for option auth_strategy from LocationInfo(location=<Locations.user: (4, True)>, detail='/etc/placement/placement.conf') is not valid: Valid values are [keystone, noauth2], but found 'keystone # use noauth2 if not using keystone'
2023-01-12 06:22:56.877 207474 ERROR placement Traceback (most recent call last):
2023-01-12 06:22:56.877 207474 ERROR placement File "/usr/lib/python3/dist-packages/oslo_config/cfg.py", line 2716, in _do_get
2023-01-12 06:22:56.877 207474 ERROR placement return (convert(val), alt_loc)
2023-01-12 06:22:56.877 207474 ERROR placement File "/usr/lib/python3/dist-packages/oslo_config/cfg.py", line 2685, in convert
2023-01-12 06:22:56.877 207474 ERROR placement return self._convert_value(
2023-01-12 06:22:56.877 207474 ERROR placement File "/usr/lib/python3/dist-packages/oslo_config/cfg.py", line 2813, in _convert_value
2023-01-12 06:22:56.877 207474 ERROR placement return opt.type(value)
2023-01-12 06:22:56.877 207474 ERROR placement File "/usr/lib/python3/dist-packages/oslo_config/types.py", line 167, in __call__
2023-01-12 06:22:56.877 207474 ERROR placement raise ValueError(
2023-01-12 06:22:56.877 207474 ERROR placement ValueError: Valid values are [keystone, noauth2], but found 'keystone # use noauth2 if not using keystone'
2023-01-12 06:22:56.877 207474 ERROR placement
2023-01-12 06:22:56.877 207474 ERROR placement During handling of the above exception, another exception occurred:
2023-01-12 06:22:56.877 207474 ERROR placement
2023-01-12 06:22:56.877 207474 ERROR placement Traceback (most recent call last):
2023-01-12 06:22:56.877 207474 ERROR placement File "/usr/local/bin/placement-api", line 52, in <module>
2023-01-12 06:22:56.877 207474 ERROR placement application = init_application()
2023-01-12 06:22:56.877 207474 ERROR placement File "/usr/local/lib/python3.10/dist-packages/placement/wsgi.py", line 140, in init_application
2023-01-12 06:22:56.877 207474 ERROR placement config.log_opt_values(
2023-01-12 06:22:56.877 207474 ERROR placement File "/usr/lib/python3/dist-packages/oslo_config/cfg.py", line 2611, in log_opt_values
2023-01-12 06:22:56.877 207474 ERROR placement _sanitize(opt, getattr(group_attr, opt_name)))
2023-01-12 06:22:56.877 207474 ERROR placement File "/usr/lib/python3/dist-packages/oslo_config/cfg.py", line 3161, in __getattr__
2023-01-12 06:22:56.877 207474 ERROR placement return self._conf._get(name, self._group)
2023-01-12 06:22:56.877 207474 ERROR placement File "/usr/lib/python3/dist-packages/oslo_config/cfg.py", line 2653, in _get
2023-01-12 06:22:56.877 207474 ERROR placement value, loc = self._do_get(name, group, namespace)
2023-01-12 06:22:56.877 207474 ERROR placement File "/usr/lib/python3/dist-packages/oslo_config/cfg.py", line 2732, in _do_get
2023-01-12 06:22:56.877 207474 ERROR placement raise ConfigFileValueError(message)
2023-01-12 06:22:56.877 207474 ERROR placement oslo_config.cfg.ConfigFileValueError: Value for option auth_strategy from LocationInfo(location=<Locations.user: (4, True)>, detail='/etc/placement/placement.conf') is not valid: Valid values are [keystone, noauth2], but found 'keystone # use noauth2 if not using keystone'
2023-01-12 06:22:56.877 207474 ERROR placement
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***

 

 

修改 /usr/lib/python3/dist-packages/oslo_config/cfg.py

LocationInfo = collections.namedtuple('LocationInfo', ['location', 'detail'])
改为
LocationInfo = collections.namedtuple('LocationInfo', ['controller', 'detail'])

 

修改后还是报错:
*** Operational MODE: preforking+threaded ***
Traceback (most recent call last):
File "/usr/local/bin/placement-api", line 52, in <module>
application = init_application()
File "/usr/local/lib/python3.10/dist-packages/placement/wsgi.py", line 131, in init_application
_parse_args(config, [], default_config_files=conffiles)
File "/usr/local/lib/python3.10/dist-packages/placement/wsgi.py", line 81, in _parse_args
config(argv[1:], project='placement',
File "/usr/lib/python3/dist-packages/oslo_config/cfg.py", line 2163, in __call__
self._check_required_opts()
File "/usr/lib/python3/dist-packages/oslo_config/cfg.py", line 2905, in _check_required_opts
if self._get(opt.dest, group, namespace) is None:
File "/usr/lib/python3/dist-packages/oslo_config/cfg.py", line 2653, in _get
value, loc = self._do_get(name, group, namespace)
File "/usr/lib/python3/dist-packages/oslo_config/cfg.py", line 2709, in _do_get
and alt_loc.location == Locations.command_line):
AttributeError: 'LocationInfo' object has no attribute 'location'

 

再修改 /usr/lib/python3/dist-packages/oslo_config/cfg.py

# Try command line first
if (val != sources._NoValue
and alt_loc.controller == Locations.command_line):
return (convert(val), alt_loc)
# Environment source second
改为
# Try command line first
if (val != sources._NoValue
and alt_loc.location == Locations.command_line):
return (convert(val), alt_loc)
# Environment source second

 

发表评论

邮箱地址不会被公开。 必填项已用*标注