Bug 1007432 - Deleting a user which has administrator role after performing a series of cli operations fails
Deleting a user which has administrator role after performing a series of cli...
Status: CLOSED ERRATA
Product: Subscription Asset Manager
Classification: Red Hat
Component: katello (Show other bugs)
1.3
x86_64 Linux
unspecified Severity medium
: rc
: ---
Assigned To: Tom McKay
sthirugn@redhat.com
:
Depends On:
Blocks: sam13-tracker
  Show dependency treegraph
 
Reported: 2013-09-12 09:26 EDT by Tazim Kolhar
Modified: 2016-04-25 20:55 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-10-01 07:26:08 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Tazim Kolhar 2013-09-12 09:26:30 EDT
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@redhat.com
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@redhat.com  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 09:18:30 EDT
[root@rhel64-update-5 ~]# headpin -u admin -p admin user create --username testuser --password redhat --email testuser@redhat.com
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@bar.com  False    None                 None                
4  UserSystemOne UserSystemOne@foo.com False    None                 None                
1  admin         root@localhost        False    None                 None                
[root@rhel64-update-5 ~]#
Comment 2 sthirugn@redhat.com 2013-09-13 14:18:01 EDT
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 02:25:49 EDT
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@redhat.com
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 07:26:08 EDT
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.