← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1761185] [NEW] Value errors when configuring 'enabled_import_methods' option

 

Public bug reported:

Hello!

I've encountered the bug when configuring glance-api on controller node:

...
2018-04-04 15:51:07.773 21186 CRITICAL glance [-] Unhandled error: ValueError: tuple.index(x): x not in tuple
2018-04-04 15:51:07.773 21186 ERROR glance Traceback (most recent call last):
2018-04-04 15:51:07.773 21186 ERROR glance   File "/usr/bin/glance-api", line 10, in <module>
2018-04-04 15:51:07.773 21186 ERROR glance     sys.exit(main())
2018-04-04 15:51:07.773 21186 ERROR glance   File "/usr/lib/python2.7/dist-packages/glance/cmd/api.py", line 97, in main
2018-04-04 15:51:07.773 21186 ERROR glance     fail(e)
2018-04-04 15:51:07.773 21186 ERROR glance   File "/usr/lib/python2.7/dist-packages/glance/cmd/api.py", line 71, in fail
2018-04-04 15:51:07.773 21186 ERROR glance     return_code = KNOWN_EXCEPTIONS.index(type(e)) + 1
2018-04-04 15:51:07.773 21186 ERROR glance ValueError: tuple.index(x): x not in tuple
...

Imagine, I don't need to enable web-download method by default, so I've
try to configure 'enabled_import_methods' option in [DEFAULT] section.

Steps to reproduce
------------------
1. Install glance-api on controller node
2. Configure glance-api:
   [DEFAULT]
   enabled_import_methods = glance-direct
3. Restart glance-api service

Expected result
------------------
Glance-api service started and running without errors

Actual result
------------------
Glance-api service failed with 'Unhandled error: ValueError'

Workaround
------------------
1. Patching glance/cmd/api.py as described here: https://review.openstack.org/#/c/514114/1/glance/cmd/api.py
2. Restart glance-api, check service status:
...
glance-api[26538]: ERROR: Value for option enabled_import_methods is not valid: Value should start with "["
systemd[1]: glance-api.service: Main process exited, code=exited, status=4/NOPERMISSION
systemd[1]: glance-api.service: Unit entered failed state.
systemd[1]: glance-api.service: Failed with result 'exit-code'.
...
3. Configure glance-api as follows:
   [DEFAULT]
   enabled_import_methods = [glance-direct]
4. Restart glance-api again. It's finally working
   
My Environment
------------------
Ubuntu 16.04.4 LTS, 4.4.0-116-generic
Openstack Queens Release
Glance 16.0.0-0ubuntu1

** 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/1761185

Title:
  Value errors when configuring 'enabled_import_methods' option

Status in Glance:
  New

Bug description:
  Hello!

  I've encountered the bug when configuring glance-api on controller
  node:

  ...
  2018-04-04 15:51:07.773 21186 CRITICAL glance [-] Unhandled error: ValueError: tuple.index(x): x not in tuple
  2018-04-04 15:51:07.773 21186 ERROR glance Traceback (most recent call last):
  2018-04-04 15:51:07.773 21186 ERROR glance   File "/usr/bin/glance-api", line 10, in <module>
  2018-04-04 15:51:07.773 21186 ERROR glance     sys.exit(main())
  2018-04-04 15:51:07.773 21186 ERROR glance   File "/usr/lib/python2.7/dist-packages/glance/cmd/api.py", line 97, in main
  2018-04-04 15:51:07.773 21186 ERROR glance     fail(e)
  2018-04-04 15:51:07.773 21186 ERROR glance   File "/usr/lib/python2.7/dist-packages/glance/cmd/api.py", line 71, in fail
  2018-04-04 15:51:07.773 21186 ERROR glance     return_code = KNOWN_EXCEPTIONS.index(type(e)) + 1
  2018-04-04 15:51:07.773 21186 ERROR glance ValueError: tuple.index(x): x not in tuple
  ...

  Imagine, I don't need to enable web-download method by default, so
  I've try to configure 'enabled_import_methods' option in [DEFAULT]
  section.

  Steps to reproduce
  ------------------
  1. Install glance-api on controller node
  2. Configure glance-api:
     [DEFAULT]
     enabled_import_methods = glance-direct
  3. Restart glance-api service

  Expected result
  ------------------
  Glance-api service started and running without errors

  Actual result
  ------------------
  Glance-api service failed with 'Unhandled error: ValueError'

  Workaround
  ------------------
  1. Patching glance/cmd/api.py as described here: https://review.openstack.org/#/c/514114/1/glance/cmd/api.py
  2. Restart glance-api, check service status:
  ...
  glance-api[26538]: ERROR: Value for option enabled_import_methods is not valid: Value should start with "["
  systemd[1]: glance-api.service: Main process exited, code=exited, status=4/NOPERMISSION
  systemd[1]: glance-api.service: Unit entered failed state.
  systemd[1]: glance-api.service: Failed with result 'exit-code'.
  ...
  3. Configure glance-api as follows:
     [DEFAULT]
     enabled_import_methods = [glance-direct]
  4. Restart glance-api again. It's finally working
     
  My Environment
  ------------------
  Ubuntu 16.04.4 LTS, 4.4.0-116-generic
  Openstack Queens Release
  Glance 16.0.0-0ubuntu1

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