notification KeyError when assign role to user in keystone

Bug #1457785 reported by Lan Qi song
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
High
Rohit Jaiswal
Kilo
Fix Released
Undecided
Unassigned

Bug Description

When execute "keystone user-role-add --user test --tenant admin --role admin" there always a KeyError in notification agent log:

2015-05-21 10:13:23.573 23807 ERROR oslo_messaging.notify.dispatcher [-] Exception during message handling
2015-05-21 10:13:23.573 23807 TRACE oslo_messaging.notify.dispatcher Traceback (most recent call last):
2015-05-21 10:13:23.573 23807 TRACE oslo_messaging.notify.dispatcher File "/usr/lib/python2.7/site-packages/oslo_messaging/notify/dispatcher.py", line 91, in _disp
atch_and_handle_error
2015-05-21 10:13:23.573 23807 TRACE oslo_messaging.notify.dispatcher executor_callback)
2015-05-21 10:13:23.573 23807 TRACE oslo_messaging.notify.dispatcher File "/usr/lib/python2.7/site-packages/oslo_messaging/notify/dispatcher.py", line 134, in _dispatch
2015-05-21 10:13:23.573 23807 TRACE oslo_messaging.notify.dispatcher metadata)
2015-05-21 10:13:23.573 23807 TRACE oslo_messaging.notify.dispatcher File "/usr/lib/python2.7/site-packages/ceilometer/agent/plugin_base.py", line 153, in info
2015-05-21 10:13:23.573 23807 TRACE oslo_messaging.notify.dispatcher self.to_samples_and_publish(context.get_admin_context(), notification)
2015-05-21 10:13:23.573 23807 TRACE oslo_messaging.notify.dispatcher File "/usr/lib/python2.7/site-packages/ceilometer/agent/plugin_base.py", line 174, in to_samples_and_publish
2015-05-21 10:13:23.573 23807 TRACE oslo_messaging.notify.dispatcher p(list(self.process_notification(notification)))
2015-05-21 10:13:23.573 23807 TRACE oslo_messaging.notify.dispatcher File "/usr/lib/python2.7/site-packages/ceilometer/identity/notifications.py", line 59, in process_notification
2015-05-21 10:13:23.573 23807 TRACE oslo_messaging.notify.dispatcher resource_id=message['payload']['resource_info'],
2015-05-21 10:13:23.573 23807 TRACE oslo_messaging.notify.dispatcher KeyError: 'resource_info'

Seems "identity.role_assignment.created" event would be handled by both "Role(IdentityCRUD)" and "RoleAssignment(_Base)".

Changed in ceilometer:
assignee: nobody → Rohit Jaiswal (rohit-jaiswal-3)
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/185146

Changed in ceilometer:
status: New → In Progress
Eoghan Glynn (eglynn)
Changed in ceilometer:
milestone: none → liberty-1
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/185146
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=02bab799bab051cc22f4fdf9d19d7a17939cdde7
Submitter: Jenkins
Branch: master

commit 02bab799bab051cc22f4fdf9d19d7a17939cdde7
Author: Rohit Jaiswal <email address hidden>
Date: Fri May 22 21:04:50 2015 +0000

    Fixing event types pattern for Role Noti. handler

    Identity(Keystone) notifications have a handler
    for Role that has event type as identity.role.*
    Another for RoleAssignment which accepts
    identity.role_assignment.* events.

    Since event types are regular expressions,
    an event like identity.role_assignment.created
    is matched with identity.role.* and gets incorrectly
    routed to the Role Handler.

    This fix restricts the event type regex for Role
    handler to just identity.role.* events and excludes
    identity.role_* events.

    Change-Id: I526467ef2f8204e8093f7470b86949e3e0e69990
    Closes-Bug: #1457785

Changed in ceilometer:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (stable/kilo)

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/185542

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

Reviewed: https://review.openstack.org/185542
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=77b1fb5a9f343babd5fb1b12bbb39c70ff180006
Submitter: Jenkins
Branch: stable/kilo

commit 77b1fb5a9f343babd5fb1b12bbb39c70ff180006
Author: Rohit Jaiswal <email address hidden>
Date: Fri May 22 21:04:50 2015 +0000

    Fixing event types pattern for Role Noti. handler

    Identity(Keystone) notifications have a handler
    for Role that has event type as identity.role.*
    Another for RoleAssignment which accepts
    identity.role_assignment.* events.

    Since event types are regular expressions,
    an event like identity.role_assignment.created
    is matched with identity.role.* and gets incorrectly
    routed to the Role Handler.

    This fix restricts the event type regex for Role
    handler to just identity.role.* events and excludes
    identity.role_* events.

    Change-Id: I526467ef2f8204e8093f7470b86949e3e0e69990
    Closes-Bug: #1457785
    (cherry picked from commit 02bab799bab051cc22f4fdf9d19d7a17939cdde7)

tags: added: in-stable-kilo
Thierry Carrez (ttx)
Changed in ceilometer:
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.