Bug 1304978

Summary: Handling malformed definitions in gnocchi_resources.yaml like with meters.yaml
Product: Red Hat OpenStack Reporter: Yurii Prokulevych <yprokule>
Component: openstack-ceilometerAssignee: Mehdi ABAAKOUK <mabaakou>
Status: CLOSED ERRATA QA Contact: Yurii Prokulevych <yprokule>
Severity: high Docs Contact:
Priority: unspecified    
Version: 8.0 (Liberty)CC: jdanjou, jruzicka, mabaakou, srevivo
Target Milestone: ---Keywords: Triaged, ZStream
Target Release: 8.0 (Liberty)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-ceilometer-5.0.4-1.el7ost Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1353925 (view as bug list) Environment:
Last Closed: 2016-11-14 19:56:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Yurii Prokulevych 2016-02-05 07:48:40 UTC
Clone of upstream bug.
If gnocchi_resources.yaml has malformed definition than all definitions are ignored.

Excerpt from collector.log:
2016-02-05 07:31:12.139 30011 DEBUG ceilometer.dispatcher [-] loading dispatchers from ceilometer.dispatcher load_dispatcher_manager /usr/lib/python2.7/site-packages/ceilometer/dispatcher/__init__.py:41
2016-02-05 07:31:14.867 30011 ERROR stevedore.extension [-] Could not load 'gnocchi': ResourcesDefinitionException {'metrics': ['CustomMetric', 'CustomMetric1', 'CustomMetricRule1'], 'attributes': {'some_attribu
te': 'resource_metadata.some_attribute'}}: Required field resource_type not specified
2016-02-05 07:31:14.874 30011 ERROR stevedore.extension [-] ResourcesDefinitionException {'metrics': ['CustomMetric', 'CustomMetric1', 'CustomMetricRule1'], 'attributes': {'some_attribute': 'resource_metadata.so
me_attribute'}}: Required field resource_type not specified
2016-02-05 07:31:14.874 30011 ERROR stevedore.extension Traceback (most recent call last):
2016-02-05 07:31:14.874 30011 ERROR stevedore.extension File "/usr/lib/python2.7/site-packages/stevedore/extension.py", line 162, in _load_plugins
2016-02-05 07:31:14.874 30011 ERROR stevedore.extension verify_requirements,
2016-02-05 07:31:14.874 30011 ERROR stevedore.extension File "/usr/lib/python2.7/site-packages/stevedore/named.py", line 123, in _load_one_plugin
2016-02-05 07:31:14.874 30011 ERROR stevedore.extension verify_requirements,
2016-02-05 07:31:14.874 30011 ERROR stevedore.extension File "/usr/lib/python2.7/site-packages/stevedore/extension.py", line 187, in _load_one_plugin
2016-02-05 07:31:14.874 30011 ERROR stevedore.extension obj = plugin(*invoke_args, **invoke_kwds)
2016-02-05 07:31:14.874 30011 ERROR stevedore.extension File "/usr/lib/python2.7/site-packages/ceilometer/dispatcher/gnocchi.py", line 182, in __init__
2016-02-05 07:31:14.874 30011 ERROR stevedore.extension self.resources_definition = self._load_resources_definitions(conf)
2016-02-05 07:31:14.874 30011 ERROR stevedore.extension File "/usr/lib/python2.7/site-packages/ceilometer/dispatcher/gnocchi.py", line 213, in _load_resources_definitions
2016-02-05 07:31:14.874 30011 ERROR stevedore.extension for r in data.get('resources', [])]
2016-02-05 07:31:14.874 30011 ERROR stevedore.extension File "/usr/lib/python2.7/site-packages/ceilometer/dispatcher/gnocchi.py", line 118, in __init__
2016-02-05 07:31:14.874 30011 ERROR stevedore.extension _LE("Required field %s not specified") % field, self.cfg)
2016-02-05 07:31:14.874 30011 ERROR stevedore.extension ResourcesDefinitionException: ResourcesDefinitionException {'metrics': ['CustomMetric', 'CustomMetric1', 'CustomMetricRule1'], 'attributes': {'some_attribu
te': 'resource_metadata.some_attribute'}}: Required field resource_type not specified
2016-02-05 07:31:14.874 30011 ERROR stevedore.extension

For consistency it would be great to have the same error handling like with meters.yaml

Packages:
ceilometer*-5.0.1-1.el7ost.noarch

Regards,
Yurii

Comment 2 Mehdi ABAAKOUK 2016-04-29 09:02:05 UTC
Next upstream Liberty release (5.0.3) will have the fix.

Comment 3 Mehdi ABAAKOUK 2016-05-12 16:22:02 UTC
Release asked: https://review.openstack.org/#/c/315659/

Comment 5 Julien Danjou 2016-06-03 13:32:19 UTC
Unlikely to be encountered in OSP 8, so targeting OSP 9.

Comment 6 Mehdi ABAAKOUK 2016-07-08 12:32:43 UTC
*** Bug 1353925 has been marked as a duplicate of this bug. ***

Comment 7 Mehdi ABAAKOUK 2016-07-08 12:36:36 UTC
I have switched it back to OSP8, since this have been backported in upstream liberty 5.0.4.

Comment 11 errata-xmlrpc 2016-11-14 19:56:08 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2714.html