Attempt to delete role of user with invalid parameters sent is returning 500 error code

Bug #1006287 reported by Rajalakshmi Ganesan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Low
Dolph Mathews

Bug Description

Attempt to delete role of user with invalid parameters such as UserID, Tenant ID, Role ID in request is returning 500 error code.

Expected result:
Not found exception should be raised with code 404

Actual Result:
Error code 500

LOG:
------------

======================================================================
ERROR: Should not be able to DELETE role from nonexistant user on tenant
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/muralik/tempest_30may/tempest/tempest/tests/identity/test_integration.py", line 364, in test_delete_invalid_role_of_user
    invalid_id[i])
  File "/home/muralik/tempest_30may/tempest/tempest/services/identity/json/admin_client.py", line 157, in delete_role_from_user_on_tenant
    % (tenant_id, user_id, role_id))
  File "/home/muralik/tempest_30may/tempest/tempest/common/rest_client.py", line 158, in delete
    return self.request('DELETE', url)
  File "/home/muralik/tempest_30may/tempest/tempest/common/rest_client.py", line 224, in request
    message = resp_body['computeFault']['message']
KeyError: '\'computeFault\'\n-------------------- >> begin captured logging << --------------------\ntempest.config: INFO: Using tempest config file /home/muralik/tempest_30may/tempest/etc/tempest.conf\ntempest.common.rest_client: ERROR: Request URL: http://10.233.52.27:35357/v2.0//tenants/6052ff20135c4c0ea81be59b0e706e11/users/ab39c6dc61b648a8afcdd119a6590bdf/roles/OS-KSADM/99944759323334\ntempest.common.rest_client: ERROR: Request Body: None\ntempest.common.rest_client: ERROR: Response Headers: {\'date\': \'Wed, 30 May 2012 13:57:01 GMT\', \'content-type\': \'application/json\', \'content-length\': \'161\', \'status\': \'500\', \'vary\': \'X-Auth-Token\'}\ntempest.common.rest_client: ERROR: Response Body: {u\'error\': {u\'message\': u"An unexpected error prevented the server from fulfilling your request. u\'99944759323334\'", u\'code\': 500, u\'title\': u\'Internal Server Error\'}}\n--------------------- >> end captured logging << ---------------------'

======================================================================
ERROR: Should not be able to DELETE role with nonexistant tenant ID in request
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/muralik/tempest_30may/tempest/tempest/tests/identity/test_integration.py", line 338, in test_delete_role_of_invalid_tenant
    self.role_ids[1])
  File "/home/muralik/tempest_30may/tempest/tempest/services/identity/json/admin_client.py", line 157, in delete_role_from_user_on_tenant
    % (tenant_id, user_id, role_id))
  File "/home/muralik/tempest_30may/tempest/tempest/common/rest_client.py", line 158, in delete
    return self.request('DELETE', url)
  File "/home/muralik/tempest_30may/tempest/tempest/common/rest_client.py", line 224, in request
    message = resp_body['computeFault']['message']
KeyError: '\'computeFault\'\n-------------------- >> begin captured logging << --------------------\ntempest.common.rest_client: ERROR: Request URL: http://10.233.52.27:35357/v2.0//tenants/99923932989272/users/ab39c6dc61b648a8afcdd119a6590bdf/roles/OS-KSADM/741a74328d7c44488c0780c3ae3a788f\ntempest.common.rest_client: ERROR: Request Body: None\ntempest.common.rest_client: ERROR: Response Headers: {\'date\': \'Wed, 30 May 2012 13:57:01 GMT\', \'content-type\': \'application/json\', \'content-length\': \'179\', \'status\': \'500\', \'vary\': \'X-Auth-Token\'}\ntempest.common.rest_client: ERROR: Response Body: {u\'error\': {u\'message\': u"An unexpected error prevented the server from fulfilling your request. u\'741a74328d7c44488c0780c3ae3a788f\'", u\'code\': 500, u\'title\': u\'Internal Server Error\'}}\n--------------------- >> end captured logging << ---------------------'

======================================================================
ERROR: Should not be able to DELETE role from nonexistant user on tenant
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/muralik/tempest_30may/tempest/tempest/tests/identity/test_integration.py", line 312, in test_delete_role_of_invalid_user
    self.role_ids[1])
  File "/home/muralik/tempest_30may/tempest/tempest/services/identity/json/admin_client.py", line 157, in delete_role_from_user_on_tenant
    % (tenant_id, user_id, role_id))
  File "/home/muralik/tempest_30may/tempest/tempest/common/rest_client.py", line 158, in delete
    return self.request('DELETE', url)
  File "/home/muralik/tempest_30may/tempest/tempest/common/rest_client.py", line 224, in request
    message = resp_body['computeFault']['message']
KeyError: '\'computeFault\'\n-------------------- >> begin captured logging << --------------------\ntempest.common.rest_client: ERROR: Request URL: http://10.233.52.27:35357/v2.0//tenants/6052ff20135c4c0ea81be59b0e706e11/users/99916982875333/roles/OS-KSADM/741a74328d7c44488c0780c3ae3a788f\ntempest.common.rest_client: ERROR: Request Body: None\ntempest.common.rest_client: ERROR: Response Headers: {\'date\': \'Wed, 30 May 2012 13:57:01 GMT\', \'content-type\': \'application/json\', \'content-length\': \'179\', \'status\': \'500\', \'vary\': \'X-Auth-Token\'}\ntempest.common.rest_client: ERROR: Response Body: {u\'error\': {u\'message\': u"An unexpected error prevented the server from fulfilling your request. u\'741a74328d7c44488c0780c3ae3a788f\'", u\'code\': 500, u\'title\': u\'Internal Server Error\'}}\n--------------------- >> end captured logging << ---------------------'

----------------------------------------------------------------------

affects: tempest → keystone
Revision history for this message
Rohit Karajgi (rohitk) wrote :

Looks like a Dup of https://bugs.launchpad.net/nova/+bug/999567

Rajalakshmi, please check my branch IdentityAdmin branch, to avoid duplication of effort.
https://review.openstack.org/#/c/7438/

Many tests are already under review.

Revision history for this message
Dolph Mathews (dolph) wrote :

This is fixed by a patch already in review: https://review.openstack.org/#/c/6875/

All three of these tests return output similar to the following after applying the above patch: http://paste.openstack.org/raw/18235/

Changed in keystone:
assignee: nobody → Dolph Mathews (dolph)
importance: Undecided → Low
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/6875
Committed: http://github.com/openstack/keystone/commit/23ca656927947dada40591bdd1badd5a531c2983
Submitter: Jenkins
Branch: master

commit 23ca656927947dada40591bdd1badd5a531c2983
Author: Dolph Mathews <email address hidden>
Date: Wed Mar 28 10:37:16 2012 -0700

    Refactor 404's into managers & drivers (bug 968519)

    The goal is to move the responsibility of reference checks away from
    controllers and into the underlying managers & drivers, which can
    handle the task with equal or greater efficiency.

    - Tenant references from create_user/update_user are NOT tested
      due to inconsistencies between backends
    - Additional test coverage improvements

    Also fixes bug 999209, bug 999608, bug 1006029, bug 1006055, bug 1006287,
    bug 1006334, and bug 1006344.

    Change-Id: I7de592e7dd4518038436b9a9fdaab559b00a0537

Changed in keystone:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in keystone:
milestone: none → folsom-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in keystone:
milestone: folsom-2 → 2012.2
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.