Encryption key migration fails with DuplicateOptError

Bug #1747021 reported by Alan Bishop
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Undecided
Alan Bishop

Bug Description

The code that migrates ConfKeyManager encryption keys to Barbican hits DuplicateOptError when it tries to load the fixed_key config option.

Feb 01 18:54:56 devstack.localdomain cinder-volume[1583]: Traceback (most recent call last):
Feb 01 18:54:56 devstack.localdomain cinder-volume[1583]: File "/usr/lib/python2.7/site-packages/eventlet/greenpool.py", line 82, in _spawn_n_impl
Feb 01 18:54:56 devstack.localdomain cinder-volume[1583]: func(*args, **kwargs)
Feb 01 18:54:56 devstack.localdomain cinder-volume[1583]: File "/opt/stack/cinder/cinder/keymgr/migration.py", line 162, in migrate_fixed_key
Feb 01 18:54:56 devstack.localdomain cinder-volume[1583]: KeyMigrator(conf).handle_key_migration(volumes)
Feb 01 18:54:56 devstack.localdomain cinder-volume[1583]: File "/opt/stack/cinder/cinder/keymgr/migration.py", line 49, in handle_key_migration
Feb 01 18:54:56 devstack.localdomain cinder-volume[1583]: group='key_manager')
Feb 01 18:54:56 devstack.localdomain cinder-volume[1583]: File "/usr/lib/python2.7/site-packages/oslo_config/cfg.py", line 2721, in import_opt
Feb 01 18:54:56 devstack.localdomain cinder-volume[1583]: __import__(module_str)
Feb 01 18:54:56 devstack.localdomain cinder-volume[1583]: File "/opt/stack/cinder/cinder/keymgr/conf_key_mgr.py", line 52, in <module>
Feb 01 18:54:56 devstack.localdomain cinder-volume[1583]: CONF.register_opts(key_mgr_opts, group='key_manager')
Feb 01 18:54:56 devstack.localdomain cinder-volume[1583]: File "/usr/lib/python2.7/site-packages/oslo_config/cfg.py", line 2436, in __inner
Feb 01 18:54:56 devstack.localdomain cinder-volume[1583]: result = f(self, *args, **kwargs)
Feb 01 18:54:56 devstack.localdomain cinder-volume[1583]: File "/usr/lib/python2.7/site-packages/oslo_config/cfg.py", line 2634, in register_opts
Feb 01 18:54:56 devstack.localdomain cinder-volume[1583]: self.register_opt(opt, group, clear_cache=False)
Feb 01 18:54:56 devstack.localdomain cinder-volume[1583]: File "/usr/lib/python2.7/site-packages/oslo_config/cfg.py", line 2440, in __inner
Feb 01 18:54:56 devstack.localdomain cinder-volume[1583]: return f(self, *args, **kwargs)
Feb 01 18:54:56 devstack.localdomain cinder-volume[1583]: File "/usr/lib/python2.7/site-packages/oslo_config/cfg.py", line 2610, in register_opt
Feb 01 18:54:56 devstack.localdomain cinder-volume[1583]: return group._register_opt(opt, cli)
Feb 01 18:54:56 devstack.localdomain cinder-volume[1583]: File "/usr/lib/python2.7/site-packages/oslo_config/cfg.py", line 1837, in _register_opt
Feb 01 18:54:56 devstack.localdomain cinder-volume[1583]: if _is_opt_registered(self._opts, opt):
Feb 01 18:54:56 devstack.localdomain cinder-volume[1583]: File "/usr/lib/python2.7/site-packages/oslo_config/cfg.py", line 786, in _is_opt_registered
Feb 01 18:54:56 devstack.localdomain cinder-volume[1583]: raise DuplicateOptError(opt.name)
Feb 01 18:54:56 devstack.localdomain cinder-volume[1583]: DuplicateOptError: duplicate option: fixed_key

I previously thought olso_config.cfg.import_opt() would not do that, but apparently it can.

Changed in cinder:
assignee: nobody → Alan Bishop (alan-bishop)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/540427

Changed in cinder:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/540427
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=167dc4e1bd05f4c18828b9fa76dd5e86838d0940
Submitter: Zuul
Branch: master

commit 167dc4e1bd05f4c18828b9fa76dd5e86838d0940
Author: Alan Bishop <email address hidden>
Date: Fri Feb 2 15:37:49 2018 +0000

    Fix DuplicateOptError in fixed_key migration code

    Fix how the key migration code loads the fixed_key config option so that
    it handles DuplicateOptError.

    Closes-Bug: #1747021
    Change-Id: I119a12c8e80ad991f5a2916fec2ef4421039b9e9

Changed in cinder:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 12.0.0.0rc1

This issue was fixed in the openstack/cinder 12.0.0.0rc1 release candidate.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers