DuplicateOptError: duplicate option: barbican

Bug #1817154 reported by wes hayutin on 2019-02-21
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
tripleo
Critical
Arx Cruz

Bug Description

https://logs.rdoproject.org/openstack-periodic/git.openstack.org/openstack-infra/tripleo-ci/master/periodic-tripleo-ci-centos-7-multinode-1ctlr-featureset010-master/a11600c/logs/undercloud/home/zuul/tempest.log.txt.gz

https://logs.rdoproject.org/openstack-periodic/git.openstack.org/openstack-infra/tripleo-ci/master/periodic-tripleo-ci-centos-7-ovb-3ctlr_1comp-featureset001-master/9cd3b22/logs/undercloud/home/zuul/tempest.log.txt.gz

2019-02-21 12:11:08 | /var/lib/tempest/tempest /
2019-02-21 12:11:10 | 2019-02-21 12:11:10.770 13 INFO tempest [-] Using tempest config file /etc/tempest/tempest.conf
2019-02-21 12:11:10 | 2019-02-21 12:11:10.871 13 ERROR tempest.test_discover.plugins [-] Plugin barbican_tests raised an exception trying to run register_opts: DuplicateOptError: duplicate option: barbican
2019-02-21 12:11:10 | 2019-02-21 12:11:10.871 13 ERROR tempest.test_discover.plugins Traceback (most recent call last):
2019-02-21 12:11:10 | 2019-02-21 12:11:10.871 13 ERROR tempest.test_discover.plugins File "/usr/lib/python2.7/site-packages/tempest/test_discover/plugins.py", line 202, in register_plugin_opts
2019-02-21 12:11:10 | 2019-02-21 12:11:10.871 13 ERROR tempest.test_discover.plugins plug.obj.register_opts(conf)
2019-02-21 12:11:10 | 2019-02-21 12:11:10.871 13 ERROR tempest.test_discover.plugins File "/usr/lib/python2.7/site-packages/barbican_tempest_plugin/plugin.py", line 34, in register_opts
2019-02-21 12:11:10 | 2019-02-21 12:11:10.871 13 ERROR tempest.test_discover.plugins group='service_available')
2019-02-21 12:11:10 | 2019-02-21 12:11:10.871 13 ERROR tempest.test_discover.plugins File "/usr/lib/python2.7/site-packages/oslo_config/cfg.py", line 2045, in __inner
2019-02-21 12:11:10 | 2019-02-21 12:11:10.871 13 ERROR tempest.test_discover.plugins result = f(self, *args, **kwargs)
2019-02-21 12:11:10 | 2019-02-21 12:11:10.871 13 ERROR tempest.test_discover.plugins File "/usr/lib/python2.7/site-packages/oslo_config/cfg.py", line 2283, in register_opt
2019-02-21 12:11:10 | 2019-02-21 12:11:10.871 13 ERROR tempest.test_discover.plugins return group._register_opt(opt, cli)
2019-02-21 12:11:10 | 2019-02-21 12:11:10.871 13 ERROR tempest.test_discover.plugins File "/usr/lib/python2.7/site-packages/oslo_config/cfg.py", line 1489, in _register_opt
2019-02-21 12:11:10 | 2019-02-21 12:11:10.871 13 ERROR tempest.test_discover.plugins if _is_opt_registered(self._opts, opt):
2019-02-21 12:11:10 | 2019-02-21 12:11:10.871 13 ERROR tempest.test_discover.plugins File "/usr/lib/python2.7/site-packages/oslo_config/cfg.py", line 360, in _is_opt_registered
2019-02-21 12:11:10 | 2019-02-21 12:11:10.871 13 ERROR tempest.test_discover.plugins raise DuplicateOptError(opt.name)
2019-02-21 12:11:10 | 2019-02-21 12:11:10.871 13 ERROR tempest.test_discover.plugins DuplicateOptError: duplicate option: barbican
2019-02-21 12:11:10 | 2019-02-21 12:11:10.871 13 ERROR tempest.test_discover.plugins 
2019-02-21 12:11:10 | 2019-02-21 12:11:10.919 13 ERROR tempest [-] 'list' object has no attribute 'dest'

Changed in tripleo:
assignee: nobody → Rafael Folco (rafaelfolco)
Changed in tripleo:
assignee: Rafael Folco (rafaelfolco) → nobody
assignee: nobody → Arx Cruz (arxcruz)
Rafael Folco (rafaelfolco) wrote :

I also could not find tempest.conf in the log files... please make sure this is being uploaded by collect-logs role.

wes hayutin (weshayutin) wrote :

Yatin has pointed out this possible root cause
https://review.openstack.org/#/c/627016/15

Arx Cruz (arxcruz) wrote :

The problem is with octavia tempest plugin package. I wasn't able to find exactly the root cause, but octavia is using barbican config options, and so, when you execute tempest init, oslo complains that there are a duplicate option for barbican.
I did some tests, removing the octavia-tempest-tests rpm and executing the tempest init you see no error.
Since this is a blocker, I propose a emergencial patch to send the output of tempest init to /dev/null avoiding so the error while I investigate the root cause.

Also, the review pointed by Yatin is not the root cause.

yatin (yatinkarel) wrote :

<<< Also, the review pointed by Yatin is not the root cause.

Yes i Agree the review(https://review.openstack.org/#/c/627016) i pointed is not the root cause of "DuplicateOptError: duplicate option: barbican" Error, This Error is there even in SUCCESS jobs, so the bug is misleading. That Error needs to be solved(also need to find why Job used to SUCCESS(tempest init returs 0) even with that Error and a way to avoid this) but it's not a promotion-blocker, so don't need a dirty hack and can be solved once root cause is found for it.

The actual Error which I think is currently breaking Tempest in TripleO jobs and is blocking promotions is: ERROR tempest [-] 'list' object has no attribute 'dest'. This Error is caused by the review i pointed https://review.openstack.org/#/c/627016.
you can simply reproduce this by installing vitrage_tempest_plugin in a venv(or downloading and running 'tempest init' command in container trunk.registry.rdoproject.org/tripleomaster/centos-binary-tempest:tripleo-ci-testing).

^^ needs to be solved in both vitrage_tempest_plugin(should have jobs which catch such issues and block merging wrong patches) and TripleO(afaik TripleO don't test vitrage so should not be breaked by such changes in plugins we don't test). For now to test and move ahead, as a quick and dirty measure i have added a Temporary patch in RDO:- https://review.rdoproject.org/r/#/c/18967/. Let me know if i got something wrong, I can look and clarify that.

Ghanshyam Mann (ghanshyammann) wrote :

I agree with tosky. none of the repo/plugins should register the duplicate config option.

There are many tempest-plugin like congress etc which need to check some other plugin service_availability. So they check the service presence in their devstack plugin and then set the service_availability of that service in tempest.conf. Note, they only set the value of that config option but do not register. registry of config options has to be done in own plugin only.

What Octavia can do here is, check the presence of CONF.service_available.barbican and if that config option is not registered/available then, consider that Barbican is not available and skip the test/operation. For example[1].

Setting of value can be handled via devstack plugin as service_available.barbican is default to false in barbican-tempest-plugin [2]

[1] https://github.com/openstack/congress-tempest-plugin/blob/4390716a373b67a85fadc743495494bd18679b63/congress_tempest_plugin/tests/scenario/congress_datasources/test_mistral.py#L31

[2] https://github.com/openstack/barbican-tempest-plugin/blob/123dd7d4162c39a1cb4b4c1b09a5dceaee127eb6/barbican_tempest_plugin/config.py#L19

Change abandoned by Arx Cruz (<email address hidden>) on branch: master
Review: https://review.openstack.org/638740
Reason: in favor of review.openstack.org/#/c/639049

wes hayutin (weshayutin) wrote :

Patch to review and merge is https://review.openstack.org/#/c/639083

wes hayutin (weshayutin) on 2019-02-27
Changed in tripleo:
status: Triaged → Fix Released

This issue was fixed in the openstack/octavia-tempest-plugin 1.0.0 release.

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

Duplicates of this bug

Other bug subscribers