Neutron notification handler throws a None Type Error when the payload is empty

Bug #1447686 reported by Pradeep Kilambi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Undecided
Pradeep Kilambi

Bug Description

When the payload doesnt have enough data, process_notification in neutron/notifications.py throws

2015-04-22 18:44:41.348 88824 INFO ceilometer.network.notifications [-] network notification {u'_context_roles': [u'admin'], u'_context_request_id': u'req-23d54d6e-c8ce-4eea-bda0-2626531b16b6', u'_context_read_d
eleted': u'no', 'event_type': u'health_monitor.create.end', u'_context_user_name': u'admin', u'_context_project_name': u'admin', 'timestamp': u'2015-04-22 16:44:41.317655', u'_context_tenant_name': u'admin', u'_
context_tenant': u'5f30727828ed4eb49a719b91f43318d6', 'message_id': u'98c2050e-cb0e-4664-a5ca-de05b9ff3fa2', u'_context_auth_token': u'f60e56330ee245d39e12e4e30c26a6e9', u'_context_is_admin': True, u'_context_ti
mestamp': u'2015-04-22 16:44:41.258927', u'_context_project_id': u'5f30727828ed4eb49a719b91f43318d6', u'_context_tenant_id': u'5f30727828ed4eb49a719b91f43318d6', u'_context_user': u'827b9e3389d1448ea849c9201333a
cbd', u'_context_user_id': u'827b9e3389d1448ea849c9201333acbd', 'publisher_id': u'network.dell-c6220-12.lab.eng.brq.redhat.com', 'payload': {u'health_monitor': {}}, 'priority': 'info'}
2015-04-22 18:44:41.349 88824 ERROR oslo.messaging.notify.dispatcher [-] Exception during message handling
2015-04-22 18:44:41.349 88824 TRACE oslo.messaging.notify.dispatcher Traceback (most recent call last):
2015-04-22 18:44:41.349 88824 TRACE oslo.messaging.notify.dispatcher File "/usr/lib/python2.7/site-packages/oslo/messaging/notify/dispatcher.py", line 85, in _dispatch_and_handle_error
2015-04-22 18:44:41.349 88824 TRACE oslo.messaging.notify.dispatcher return self._dispatch(incoming.ctxt, incoming.message)
2015-04-22 18:44:41.349 88824 TRACE oslo.messaging.notify.dispatcher File "/usr/lib/python2.7/site-packages/oslo/messaging/notify/dispatcher.py", line 121, in _dispatch
2015-04-22 18:44:41.349 88824 TRACE oslo.messaging.notify.dispatcher metadata)
2015-04-22 18:44:41.349 88824 TRACE oslo.messaging.notify.dispatcher File "/usr/lib/python2.7/site-packages/ceilometer/plugin.py", line 107, in info
2015-04-22 18:44:41.349 88824 TRACE oslo.messaging.notify.dispatcher self.to_samples_and_publish(context.get_admin_context(), notification)
2015-04-22 18:44:41.349 88824 TRACE oslo.messaging.notify.dispatcher File "/usr/lib/python2.7/site-packages/ceilometer/plugin.py", line 124, in to_samples_and_publish
2015-04-22 18:44:41.349 88824 TRACE oslo.messaging.notify.dispatcher p(list(self.process_notification(notification)))
2015-04-22 18:44:41.349 88824 TRACE oslo.messaging.notify.dispatcher File "/usr/lib/python2.7/site-packages/ceilometer/network/notifications.py", line 92, in process_notification
2015-04-22 18:44:41.349 88824 TRACE oslo.messaging.notify.dispatcher for resource in resources:
2015-04-22 18:44:41.349 88824 TRACE oslo.messaging.notify.dispatcher TypeError: 'NoneType' object is not iterable

Changed in ceilometer:
assignee: nobody → Pradeep Kilambi (pkilambi)
status: New → In Progress
summary: - Neutron notification handler throws a None Error
+ Neutron notification handler sometimes throws a None Error
summary: - Neutron notification handler sometimes throws a None Error
+ Neutron notification handler sometimes throws a None Type Error
summary: - Neutron notification handler sometimes throws a None Type Error
+ Neutron notification handler throws a None Type Error when the payload
+ is empty
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (master)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/176885
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=08ab5d45e526f36bf7b8788128a9cc565de275b4
Submitter: Jenkins
Branch: master

commit 08ab5d45e526f36bf7b8788128a9cc565de275b4
Author: Pradeep Kilambi <email address hidden>
Date: Thu Apr 23 12:11:57 2015 -0400

    Fix None TypeError in neutron process notifications

    Occasionally there is not enough info in event payload to
    look up the resource info. Which leads to resources being
    empty. Default to the right type instead of passing on the
    None.

    Change-Id: I0d87913146b804d555a2e2b4a0d6d4e904175d06
    Closes-Bug: #1447686

Changed in ceilometer:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: none → liberty-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: liberty-1 → 5.0.0
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.