Ceilometer Agent Notification: process_notification jsonpath error in the logs in

Bug #1824349 reported by Ashwin Agate
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
New
Undecided
Unassigned

Bug Description

In Ceilometer Agent Notification Logs see this exception (stable/rocky)

(ceilometer.pipeline.sample): 2019-04-10 22:52:54,463 ERROR sample process_notifications Fail to process notification
Traceback (most recent call last):
 File "/usr/lib//lib/python2.7/site-packages/ceilometer/pipeline/sample.py", line 46, in process_notifications
 p(list(self.build_sample(message)))
 File "/usr/lib//lib/python2.7/site-packages/ceilometer/meter/notifications.py", line 230, in build_sample
 for s in d.to_samples(notification):
 File "/usr/lib//lib/python2.7/site-packages/ceilometer/meter/notifications.py", line 124, in to_samples
 value = parser.parse(message)
 File "/usr/lib//lib/python2.7/site-packages/ceilometer/declarative.py", line 116, in parse
 values = self.getter(obj)
 File "/usr/lib//lib/python2.7/site-packages/jsonpath_rw/jsonpath.py", line 226, in find
 for subdata in self.left.find(datum)
 File "/usr/lib//lib/python2.7/site-packages/jsonpath_rw/jsonpath.py", line 228, in find
 for submatch in self.right.find(subdata)]
 File "/usr/lib//lib/python2.7/site-packages/jsonpath_rw/jsonpath.py", line 444, in find
 return [DatumInContext(datum.value[self.index], path=self, context=datum)]
KeyError: 0

It appears due to a mismatch in the notification payload and jsonpath expression specified to pull the data from raw notificaion that is specified in ceilometer/ceilometer/data/meters.d/meters.yaml for some notifications.

summary: - Ceilometer Agent Notifcation: jsonpath error in the logs in
- process_notification
+ Ceilometer Agent Notification: process_notification jsonpath error in
+ the logs in
Revision history for this message
jianyu li (easyljy) wrote :

I encountered the same issue. In some conditions, the type of datum.value is dict instead of list.
I have below temporary fix in my environment, but not sure if it will break something.

444c444,447
< return [DatumInContext(datum.value[self.index], path=self, context=datum)]
---
> if type(datum.value) == list:
> return [DatumInContext(datum.value[self.index], path=self, context=datum)]
> else:
> return [DatumInContext(datum.value, path=self, context=datum)]

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.