neutron notifications throwing keyerror

Bug #1276761 reported by gordon chung
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Undecided
Harri Hämäläinen

Bug Description

it appears the payload of neutron has changed.

when receiving *.start events, it does not include a tenant_id value in payload causing keyerror

2014-02-05 14:15:45.837 12233 ERROR stevedore.extension [-] error calling 'network': 'tenant_id'
2014-02-05 14:15:45.837 12233 ERROR stevedore.extension [-] 'tenant_id'
2014-02-05 14:15:45.837 12233 TRACE stevedore.extension Traceback (most recent call last):
2014-02-05 14:15:45.837 12233 TRACE stevedore.extension File "/usr/local/lib/python2.7/dist-packages/stevedore/extension.py", line 247, in _invoke_one_plugin
2014-02-05 14:15:45.837 12233 TRACE stevedore.extension response_callback(func(e, *args, **kwds))
2014-02-05 14:15:45.837 12233 TRACE stevedore.extension File "/opt/stack/ceilometer/ceilometer/notification.py", line 170, in _process_notification_for_ext
2014-02-05 14:15:45.837 12233 TRACE stevedore.extension p(list(ext.obj.to_samples(notification)))
2014-02-05 14:15:45.837 12233 TRACE stevedore.extension File "/opt/stack/ceilometer/ceilometer/network/notifications.py", line 80, in process_notification
2014-02-05 14:15:45.837 12233 TRACE stevedore.extension message['payload'] = message['payload'][self.resource_name]
2014-02-05 14:15:45.837 12233 TRACE stevedore.extension KeyError: 'tenant_id'
2014-02-05 14:15:45.837 12233 TRACE stevedore.extension

notification:

*.update.start notifications:
message = {u'_context_roles': [u'Member', u'anotherrole'], u'_context_request_id': u'req-bec4193e-2ca8-4577-992b-01da47f9c450', u'_context_read_deleted': u'no', u'event_type': u'network.update.start', u'_context_user_name': u'demo', u'_context_project_name': u'demo', u'timestamp': u'2014-02-05 19:12:01.082159', u'_context_tenant_name': u'demo', u'_context_tenant': u'ea0024e1211e4b4aa81928d26401f221', u'message_id': u'bfe88e03-9aec-42db-9473-f30a8026815e', u'_unique_id': u'dc70b78c0d934313a4e1533c918d02b4', u'_context_is_admin': False, u'_context_timestamp': u'2014-02-05 19:12:01.080827', u'_context_project_id': u'ea0024e1211e4b4aa81928d26401f221', u'_context_tenant_id': u'ea0024e1211e4b4aa81928d26401f221', u'_context_user': u'799cfa46997649518d31becdf744d269', u'_context_user_id': u'799cfa46997649518d31becdf744d269', u'publisher_id': u'network.plwdevstack', u'payload': {u'network': {u'name': u'private', u'admin_state_up': True}, u'id': u'1ad468bf-282e-4e96-b65b-a98c5161a3dd'}, u'priority': u'INFO'}

*.update.end notifications:
self = <ceilometer.network.notifications.Network object at 0x40cc610>
message = {u'_context_roles': [u'Member', u'anotherrole'], u'_context_request_id': u'req-bec4193e-2ca8-4577-992b-01da47f9c450', u'_context_read_deleted': u'no', u'event_type': u'network.update.end', u'_context_user_name': u'demo', u'_context_project_name': u'demo', u'timestamp': u'2014-02-05 19:12:01.125984', u'_context_tenant_name': u'demo', u'_context_tenant': u'ea0024e1211e4b4aa81928d26401f221', u'message_id': u'd22648eb-64da-46e0-aa2e-70f73895b3a1', u'_unique_id': u'88475e8a76bb4f0990a22fbc9f8aa1c9', u'_context_is_admin': False, u'_context_timestamp': u'2014-02-05 19:12:01.080827', u'_context_project_id': u'ea0024e1211e4b4aa81928d26401f221', u'_context_tenant_id': u'ea0024e1211e4b4aa81928d26401f221', u'_context_user': u'799cfa46997649518d31becdf744d269', u'_context_user_id': u'799cfa46997649518d31becdf744d269', u'publisher_id': u'network.plwdevstack', u'payload': {u'network': {u'status': u'ACTIVE', u'subnets': [u'7e9adca0-0613-4c80-b340-7c8354203f35'], u'name': u'private', u'router:external': False, u'tenant_id': u'ea0024e1211e4b4aa81928d26401f221', u'admin_state_up': True, u'shared': False, u'id': u'1ad468bf-282e-4e96-b65b-a98c5161a3dd'}}, u'priority': u'INFO'}

Changed in ceilometer:
assignee: nobody → Harri Hämäläinen (hhamalai)
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/71875

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

Reviewed: https://review.openstack.org/71875
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=0365edfa5fcdae079a7569df96d625b05f468337
Submitter: Jenkins
Branch: master

commit 0365edfa5fcdae079a7569df96d625b05f468337
Author: Harri Hämäläinen <email address hidden>
Date: Fri Feb 7 13:53:42 2014 +0200

    Fixes invalid key in Neutron notifications

    The tenant id in notifications is read from variable _context_tenant_id rather
    than tenant_id. This caused KeyErrors when updating floating IPs.

    Change-Id: I883e049f28cd8de6d46a622572832bdbf382de24
    Closes-Bug: 1276761

Changed in ceilometer:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: none → icehouse-3
status: Fix Committed → Fix Released
Revision history for this message
Malleshi C N (malleshicn) wrote :

Hi Team ,

Below error is also related to above bug ..?

==> ceilometer-collector.log <==
2014-03-25 05:40:56.308 1047 ERROR stevedore.extension [-] error calling 'port': 'tenant_id'
2014-03-25 05:40:56.308 1047 ERROR stevedore.extension [-] 'tenant_id'
2014-03-25 05:40:56.308 1047 TRACE stevedore.extension Traceback (most recent call last):
2014-03-25 05:40:56.308 1047 TRACE stevedore.extension File "/usr/lib/python2.7/dist-packages/stevedore/extension.py", line 145, in _invoke_one_plugin
2014-03-25 05:40:56.308 1047 TRACE stevedore.extension response_callback(func(e, *args, **kwds))
2014-03-25 05:40:56.308 1047 TRACE stevedore.extension File "/usr/lib/python2.7/dist-packages/ceilometer/collector/service.py", line 293, in _process_notification_for_ext
2014-03-25 05:40:56.308 1047 TRACE stevedore.extension p(list(ext.obj.to_samples(notification)))
2014-03-25 05:40:56.308 1047 TRACE stevedore.extension File "/usr/lib/python2.7/dist-packages/ceilometer/network/notifications.py", line 89, in process_notification
2014-03-25 05:40:56.308 1047 TRACE stevedore.extension project_id=message['payload']['tenant_id'],
2014-03-25 05:40:56.308 1047 TRACE stevedore.extension KeyError: 'tenant_id'
2014-03-25 05:40:56.308 1047 TRACE stevedore.extension

Thierry Carrez (ttx)
Changed in ceilometer:
milestone: icehouse-3 → 2014.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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