keystone doesn't cleanly remove all data for a user when using SQL backend for Identity

Bug #963348 reported by Joseph Heck
34
This bug affects 7 people
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Medium
Eduardo Patrocinio

Bug Description

Hello,

How can a user cleanly be removed from Keystone? Maybe I am missing a step - and I apologize if so - but I'm running into the following issue:

keystone tenant-create --name=ProjectX
keystone user-create --name=Foo --pass=password
keystone user-role-add --user=$USER_ID --tenant_id=$TENANT_ID --role=$ADMIN_ROLE_ID

In the SQL database, I can now see entries under the user, tenant, user_tenant_membership, and metadata tables.

Now, if I do

keystone user-delete $USER_ID

The entry is removed from the user table, but no other tables.

If I do

keystone user-role-remove --user=$USER_ID --tenant_id=$TENANT_ID --role=$ADMIN_ROLE_ID

The entry is removed from user_tenant_membership, but not the metadata table.

keystone user-delete $USER_ID

removes the user from the user table, but still not metadata.

If I add the user to more than one role, the user will stay in the user_tenant_membership table until all roles have been removed, but there is still an entry in metadata.

Is this a bug or am I missing a step for cleanly removing a user?

Thanks,
Joe

Joseph Heck (heckj)
Changed in keystone:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
yong sheng gong (gongysh) wrote :

I think we should use foreign key and cascading deletion to make sure the clean deletion. In addition, since token table use extra column to save roles, tenants information, we will enhance auth process to deal with if the user, role or tenant has been deleted and then return the right information.
below is an extra field for a certain token:
{"metadata": {"roles": ["ca43893555be4153acc701568beeec8e", "85c54052d4dc41aba5d1671216766064", "3d3f2139ef514935ba698f40012ddaeb"]}, "user": {"email": "<email address hidden>", "enabled": true, "id": "44c3d88f257a4dc39790c318fcb1a2cc", "name": "admin", "tenantId": null}, "tenant": {"enabled": true, "id": "36cf36c3972a437890e5df7bf9805097", "name": "admin", "description": null}}

Revision history for this message
PerlStalker (perlstalker) wrote :

I'm seeing the same problem when a role is removed using keystone role-remove. The role ID remains in the json stored in the 'data' column.

Revision history for this message
Michael Lin (michael-lin) wrote :

I have the same problem :(

Revision history for this message
Akira Yoshiyama (yosshy) wrote :

Me too.

Revision history for this message
Alan Pevec (apevec) wrote :

user-delete should be fixed as a part of bug 973243

Revision history for this message
Tihomir Trifonov (ttrifonov) wrote :

The problem above results in unexpected behavior when calling user-role-list. If an user is being assigned to a role, and then the role is deleted, the user-role-list fails with 404:

$ keystone user-role-list --user-id 779d85b855824501a9d526a316ed63a5
Could not find role: 5bf8cf73290041bc8954dd123e1c959b (HTTP 404)

Changed in keystone:
assignee: nobody → Eduardo Patrocinio (epatro)
Revision history for this message
Eduardo Patrocinio (epatro) wrote :

The original bug has been fixed on https://bugs.launchpad.net/bugs/973243.

Working on the issue when the role is deleted, as reported on 2012-08-08.

Revision history for this message
Eduardo Patrocinio (epatro) wrote :

The original bug has already been fixed.

The issue reported on 2012-08-08:

$ keystone user-role-list --user-id 779d85b855824501a9d526a316ed63a5
Could not find role: 5bf8cf73290041bc8954dd123e1c959b (HTTP 404)

can't be recreated (keystone user-role-list --user-id <user_id> works properly after the role is deleted).

Rgds,

Changed in keystone:
status: Triaged → Invalid
assignee: Eduardo Patrocinio (epatro) → nobody
Changed in keystone:
assignee: nobody → Eduardo Patrocinio (epatro)
status: Invalid → In Progress
Revision history for this message
gordon chung (chungg) wrote :

cannot reproduce bug anymore. based on comments, bug is fixed.

Changed in keystone:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in keystone:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

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