← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 2051126] [NEW] stores-info fails if unrecognised backend specified

 

Public bug reported:

If deployer specifies invalid backend for glance using
'enabled_backends' in glance-api.conf file then glance stores-info
command fails with HTTP 500 error with below stacktrace;

Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi [None req-71e90940-8b19-4711-b2fa-910c145c1960 admin admin] Caught error: no such option foo in group [DEFAULT]: oslo_config.cfg.NoSuchOptError: no such option foo in group [DEFAULT]
Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi Traceback (most recent call last):
Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi   File "/opt/stack/data/venv/lib/python3.10/site-packages/oslo_config/cfg.py", line 2219, in __getattr__
Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi     return self._get(name)
Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi   File "/opt/stack/data/venv/lib/python3.10/site-packages/oslo_config/cfg.py", line 2653, in _get
Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi     value, loc = self._do_get(name, group, namespace)
Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi   File "/opt/stack/data/venv/lib/python3.10/site-packages/oslo_config/cfg.py", line 2671, in _do_get
Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi     info = self._get_opt_info(name, group)
Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi   File "/opt/stack/data/venv/lib/python3.10/site-packages/oslo_config/cfg.py", line 2876, in _get_opt_info
Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi     raise NoSuchOptError(opt_name, group)
Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi oslo_config.cfg.NoSuchOptError: no such option foo in group [DEFAULT]
Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi 
Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi During handling of the above exception, another exception occurred:
Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi 
Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi Traceback (most recent call last):
Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi   File "/opt/stack/glance/glance/common/wsgi.py", line 1297, in __call__
Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi     action_result = self.dispatch(self.controller, action,
Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi   File "/opt/stack/glance/glance/common/wsgi.py", line 1340, in dispatch
Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi     return method(*args, **kwargs)
Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi   File "/opt/stack/glance/glance/api/v2/discovery.py", line 68, in get_stores
Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi     description = getattr(CONF, backend).store_description
Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi   File "/opt/stack/data/venv/lib/python3.10/site-packages/oslo_config/cfg.py", line 2223, in __getattr__
Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi     raise NoSuchOptError(name)
Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi oslo_config.cfg.NoSuchOptError: no such option foo in group [DEFAULT]
Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi 
Jan 24 14:25:08 devstack-caracal glance-api[1906424]: INFO eventlet.wsgi.server [None req-71e90940-8b19-4711-b2fa-910c145c1960 admin admin] 10.0.109.128,10.0.109.128 - - [24/Jan/2024 14:25:08] "GET /v2/info/stores HTTP/1.1" 500 454 0.075514


How to reproduce:

1. Define enabled_backends as shown below in glance-api.conf
[DEFAULT]
enabled_backends = fast:file,foo:bar

[glance_store]
default_backend = fast

[fast]
filesystem_store_datadir = /opt/stack/data/glance/images/

[foo]
foo = bar

2. Restart g-api service
3. Run glance stores-info command

** Affects: glance
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/2051126

Title:
  stores-info fails if unrecognised backend specified

Status in Glance:
  New

Bug description:
  If deployer specifies invalid backend for glance using
  'enabled_backends' in glance-api.conf file then glance stores-info
  command fails with HTTP 500 error with below stacktrace;

  Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi [None req-71e90940-8b19-4711-b2fa-910c145c1960 admin admin] Caught error: no such option foo in group [DEFAULT]: oslo_config.cfg.NoSuchOptError: no such option foo in group [DEFAULT]
  Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi Traceback (most recent call last):
  Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi   File "/opt/stack/data/venv/lib/python3.10/site-packages/oslo_config/cfg.py", line 2219, in __getattr__
  Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi     return self._get(name)
  Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi   File "/opt/stack/data/venv/lib/python3.10/site-packages/oslo_config/cfg.py", line 2653, in _get
  Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi     value, loc = self._do_get(name, group, namespace)
  Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi   File "/opt/stack/data/venv/lib/python3.10/site-packages/oslo_config/cfg.py", line 2671, in _do_get
  Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi     info = self._get_opt_info(name, group)
  Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi   File "/opt/stack/data/venv/lib/python3.10/site-packages/oslo_config/cfg.py", line 2876, in _get_opt_info
  Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi     raise NoSuchOptError(opt_name, group)
  Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi oslo_config.cfg.NoSuchOptError: no such option foo in group [DEFAULT]
  Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi 
  Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi During handling of the above exception, another exception occurred:
  Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi 
  Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi Traceback (most recent call last):
  Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi   File "/opt/stack/glance/glance/common/wsgi.py", line 1297, in __call__
  Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi     action_result = self.dispatch(self.controller, action,
  Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi   File "/opt/stack/glance/glance/common/wsgi.py", line 1340, in dispatch
  Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi     return method(*args, **kwargs)
  Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi   File "/opt/stack/glance/glance/api/v2/discovery.py", line 68, in get_stores
  Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi     description = getattr(CONF, backend).store_description
  Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi   File "/opt/stack/data/venv/lib/python3.10/site-packages/oslo_config/cfg.py", line 2223, in __getattr__
  Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi     raise NoSuchOptError(name)
  Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi oslo_config.cfg.NoSuchOptError: no such option foo in group [DEFAULT]
  Jan 24 14:25:08 devstack-caracal glance-api[1906424]: ERROR glance.common.wsgi 
  Jan 24 14:25:08 devstack-caracal glance-api[1906424]: INFO eventlet.wsgi.server [None req-71e90940-8b19-4711-b2fa-910c145c1960 admin admin] 10.0.109.128,10.0.109.128 - - [24/Jan/2024 14:25:08] "GET /v2/info/stores HTTP/1.1" 500 454 0.075514

  
  How to reproduce:

  1. Define enabled_backends as shown below in glance-api.conf
  [DEFAULT]
  enabled_backends = fast:file,foo:bar

  [glance_store]
  default_backend = fast

  [fast]
  filesystem_store_datadir = /opt/stack/data/glance/images/

  [foo]
  foo = bar

  2. Restart g-api service
  3. Run glance stores-info command

To manage notifications about this bug go to:
https://bugs.launchpad.net/glance/+bug/2051126/+subscriptions