oslo doesn't react correctly to missing/non-accessible config files

Bug #2056532 reported by Nicolas Formichella
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.config
New
Undecided
Unassigned
placement
Opinion
Undecided
Unassigned

Bug Description

Installing `placement` fails

- Entered the correct database URL
- sudo -u placement placement-manage db sync succeeds
- `placement-status --debug upgrade check` fails with :

Traceback (most recent call last):
  File "/usr/bin/placement-status", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python3/dist-packages/placement/cmd/status.py", line 140, in main
    config(args=sys.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 2906, in _check_required_opts
    raise RequiredOptError(opt.name, group)
oslo_config.cfg.RequiredOptError: value required for option connection in group [placement_database]

----

OS : Ubuntu 22.04
Openstack Release : Bobcat

Revision history for this message
Nicolas Formichella (signed) wrote :
no longer affects: placement (Ubuntu)
Changed in placement:
status: New → Invalid
Changed in placement:
status: Invalid → Opinion
Revision history for this message
Nicolas Formichella (signed) wrote :

The issue seems to actually lie in oslo.config

The stock (before the groupadd of the above link) config is not accessible by non-root

```
-rw-r----- 1 root placement 26376 Mar 12 09:46 placement.conf
```

The config doesn't exist for oslo.config

```
--- a/oslo_config/cfg.py
+++ b/oslo_config/cfg.py
@@ -2028,7 +2028,7 @@ class ConfigOpts(abc.Mapping):
                                               '--version',
                                               action='version',
                                               version=version)
-
+ print(locals())
         return prog, default_config_files, default_config_dirs
```

```
{'self': <oslo_config.cfg.ConfigOpts object at 0x7f813ec76da0>, 'project': 'placement', 'prog': 'placement-status', 'version': None, 'usage': None, 'description': None, 'epilog': None, 'default_config_files': [], 'default_config_dirs': []}
```

```
--- a/oslo_config/cfg.py
+++ b/oslo_config/cfg.py
@@ -2163,6 +2163,7 @@ class ConfigOpts(abc.Mapping):

         self._namespace = self._parse_cli_opts(args if args is not None
                                                else sys.argv[1:])
+ print(vars(self._namespace))
         if self._namespace._files_not_found:
             raise ConfigFilesNotFoundError(self._namespace._files_not_found)
         if self._namespace._files_permission_denied:
```

{'_conf': <oslo_config.cfg.ConfigOpts object at 0x7ff59557eda0>, '_parsed': [], '_normalized': [], '_emitted_deprecations': set(), '_files_not_found': [], '_files_permission_denied': [], '_config_dirs': [], '_sections_to_file': {}, 'command': 'upgrade', 'config_dir': None, 'config_file': None, 'debug': None, 'log_config_append': None, 'log_date_format': None, 'log_dir': None, 'log_file': None, 'use_journal': None, 'use_json': None, 'use_syslog': None, 'watch_log_file': None, 'syslog_log_facility': None, 'check': 'check', 'json': False, 'action_fn': <bound method UpgradeCommands.check of <placement.cmd.status.Checks object at 0x7ff592ecaf50>>}

It fills neither `_files_not_found` nor `_files_permission_denied`

summary: - value required for option connection
+ oslo doesn't react correctly to missing/non-accessible config files
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.