Bug 1007432 - Deleting a user which has administrator role after performing a series of cli operations fails
Summary: Deleting a user which has administrator role after performing a series of cli...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Subscription Asset Manager
Classification: Retired
Component: katello
Version: 1.3
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Tom McKay
QA Contact: sthirugn@redhat.com
URL:
Whiteboard:
Depends On:
Blocks: sam13-tracker
TreeView+ depends on / blocked
 
Reported: 2013-09-12 13:26 UTC by Tazim Kolhar
Modified: 2016-04-26 00:55 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-10-01 11:26:08 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2013:1390 0 normal SHIPPED_LIVE Release 1.3 of Subscription Asset Manager 2013-10-01 14:43:14 UTC

Description Tazim Kolhar 2013-09-12 13:26:30 UTC
Description of problem:
Deleting a user which has administrator role after performing a series of Org operations fails

Version-Release number of selected component (if applicable):
# rpm -qa | grep katello
katello-cli-1.4.3-10.el6sat.noarch
katello-headpin-1.4.3-12.el6sam_splice.noarch
katello-configure-1.4.4-4.el6sat.noarch
katello-glue-candlepin-1.4.3-12.el6sam_splice.noarch
katello-selinux-1.4.4-2.el6sat.noarch
katello-candlepin-cert-key-pair-1.0-1.noarch
katello-certs-tools-1.4.2-2.el6sat.noarch
katello-cli-common-1.4.3-10.el6sat.noarch
katello-glue-elasticsearch-1.4.3-12.el6sam_splice.noarch
katello-common-1.4.3-12.el6sam_splice.noarch
katello-headpin-all-1.4.3-12.el6sam_splice.noarch


How reproducible:
everytime

Steps to Reproduce:

Create a User
1. # headpin -u admin -p **** user create --username testuser --password redhat --email testuser
Successfully created user [ testuser ]

Assign Admin rights
2. # headpin --username *** --password "admin" user assign_role --username "testuser" --role "Administrator" 
User 'testuser' assigned to role 'Administrator'

Create a Org using the new user's credentials
3. # headpin -u testuser -p **** org create --name torg
Successfully created org [ torg ]

Delete the org using the new user's credentials
4. # headpin -u testuser -p *** org delete --name torg
Successfully deleted org [ torg ]            

Try to delete that user
5. # headpin -u admin -p ***** user delete --username testuser
ERROR:  update or delete on table "users" violates foreign key constraint "task_statuses_user_id_fk" on table "task_statuses"
DETAIL:  Key (id)=(6) is still referenced from table "task_statuses".

Check if user is deleted
6. # headpin -u admin -p **** user list
--------------------------------------------------------------------------------
                                   User List

ID Username Email          Disabled Default Organization Default Environment 
--------------------------------------------------------------------------------
1  admin    root@localhost False    None                 None                
6  t123     t1  False    None                 None              

Actual results:
User is not deleted

Expected results:
User should be deleted successfully

Additional info:

Comment 1 Tom McKay 2013-09-13 13:18:30 UTC
[root@rhel64-update-5 ~]# headpin -u admin -p admin user create --username testuser --password redhat --email testuser
Successfully created user [ testuser ]
[root@rhel64-update-5 ~]# headpin --username admin --password "admin" user assign_role --username "testuser" --role "Administrator"
User 'testuser' assigned to role 'Administrator'
[root@rhel64-update-5 ~]# headpin -u testuser -p admin org create --name torg
Invalid credentials
[root@rhel64-update-5 ~]# headpin -u testuser -p redhat org create --name torg
Successfully created org [ torg ]
[root@rhel64-update-5 ~]# headpin -u testuser -p redhat org delete --name torg
Successfully deleted org [ torg ]            
[root@rhel64-update-5 ~]# headpin -u admin -p admin user delete --username testuser
Successfully deleted user [ testuser ]
[root@rhel64-update-5 ~]# headpin -u admin -p admin user list
-------------------------------------------------------------------------------------------------------------------------
                                                        User List

ID Username      Email                 Disabled Default Organization Default Environment 
-------------------------------------------------------------------------------------------------------------------------
3  UserAdminOne  UserAdminOne  False    None                 None                
4  UserSystemOne UserSystemOne False    None                 None                
1  admin         root@localhost        False    None                 None                
[root@rhel64-update-5 ~]#

Comment 2 sthirugn@redhat.com 2013-09-13 18:18:01 UTC
Verified.

* candlepin-0.8.26-1.el6sam.noarch
* candlepin-scl-1-5.el6_4.noarch
* candlepin-scl-quartz-2.1.5-5.el6_4.noarch
* candlepin-scl-rhino-1.7R3-1.el6_4.noarch
* candlepin-scl-runtime-1-5.el6_4.noarch
* candlepin-selinux-0.8.26-1.el6sam.noarch
* candlepin-tomcat6-0.8.26-1.el6sam.noarch
* elasticsearch-0.19.9-8.el6sat.noarch
* katello-candlepin-cert-key-pair-1.0-1.noarch
* katello-certs-tools-1.4.2-2.el6sat.noarch
* katello-cli-1.4.3-10.el6sat.noarch
* katello-cli-common-1.4.3-10.el6sat.noarch
* katello-common-1.4.3-13.el6sam_splice.noarch
* katello-configure-1.4.4-4.el6sat.noarch
* katello-glue-candlepin-1.4.3-13.el6sam_splice.noarch
* katello-glue-elasticsearch-1.4.3-13.el6sam_splice.noarch
* katello-headpin-1.4.3-13.el6sam_splice.noarch
* katello-headpin-all-1.4.3-13.el6sam_splice.noarch
* katello-selinux-1.4.4-2.el6sat.noarch
* thumbslug-0.0.34-1.el6sam.noarch
* thumbslug-selinux-0.0.34-1.el6sam.noarch

Comment 3 Tazim Kolhar 2013-09-16 06:25:49 UTC
Verified :

# rpm -qa | grep katello
katello-glue-candlepin-1.4.3-13.el6sam_splice.noarch
katello-certs-tools-1.4.2-2.el6sat.noarch
katello-cli-1.4.3-10.el6sat.noarch
katello-configure-1.4.4-4.el6sat.noarch
katello-glue-elasticsearch-1.4.3-13.el6sam_splice.noarch
katello-candlepin-cert-key-pair-1.0-1.noarch
katello-cli-common-1.4.3-10.el6sat.noarch
katello-common-1.4.3-13.el6sam_splice.noarch
katello-headpin-1.4.3-13.el6sam_splice.noarch
katello-selinux-1.4.4-2.el6sat.noarch
katello-headpin-all-1.4.3-13.el6sam_splice.noarch


# headpin -u admin -p **** user create --username testuser --password **** --email testuser
Successfully created user [ testuser ]

# headpin --username admin --password **** user assign_role --username "testuser" --role "Administrator" 
User 'testuser' assigned to role 'Administrator'

# headpin -u testuser -p **** org create --name torg
Successfully created org [ torg ]

# headpin -u testuser -p **** org delete --name torg
Successfully deleted org [ torg ]        
    
# headpin -u admin -p **** user delete --username testuser
Successfully deleted user [ testuser ]

# headpin -u admin -p **** user list
------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                      User List

ID Username Email          Disabled Default Organization Default Environment 
------------------------------------------------------------------------------------------------------------------------------------------------------
1  admin    root@localhost False    None                 None

Comment 5 errata-xmlrpc 2013-10-01 11:26:08 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHEA-2013-1390.html


Note You need to log in before you can comment on or make changes to this bug.