Bug 1008829

Summary: reassigning user role shows database error
Product: Red Hat Satellite Reporter: Ales Dujicek <adujicek>
Component: APIAssignee: Bryan Kearney <bkearney>
Status: CLOSED WONTFIX QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: NightlyCC: cwelton, mmccune
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-02-18 14:39:55 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ales Dujicek 2013-09-17 07:11:19 UTC
Description of problem:

when assigning user_role which is already assigned to user, we get database error

> user assign_role --username bob --role testrole
ERROR:  duplicate key value violates unique constraint "index_roles_users_on_user_id_and_role_id"

Version-Release number of selected component (if applicable):
katello-configure-1.4.5-1.git.3.a9848fc.el6.noarch
katello-common-1.4.6-1.git.143.5712bb8.el6.noarch
katello-cli-1.4.3-1.git.46.a2fefb7.el6.noarch
katello-1.4.6-1.git.143.5712bb8.el6.noarch
katello-repos-1.4.2-1.el6.noarch
katello-candlepin-cert-key-pair-1.0-1.noarch
pulp-katello-plugins-0.2-1.el6.noarch
katello-glue-candlepin-1.4.6-1.git.143.5712bb8.el6.noarch
katello-all-1.4.6-1.git.143.5712bb8.el6.noarch
katello-qpid-broker-key-pair-1.0-1.noarch
signo-katello-0.0.21-1.el6.noarch
katello-glue-pulp-1.4.6-1.git.143.5712bb8.el6.noarch
katello-selinux-1.4.4-1.git.1.7abb02b.el6.noarch
katello-qpid-client-key-pair-1.0-1.noarch
katello-glue-elasticsearch-1.4.6-1.git.143.5712bb8.el6.noarch
katello-certs-tools-1.4.4-1.el6.noarch
katello-cli-common-1.4.3-1.git.46.a2fefb7.el6.noarch

How reproducible:
always

Steps to Reproduce:
1.
> user_role create --name testrole
> user create --username bob --password testing --email root@localhost
2.
> user assign_role --username bob --role testrole
User 'bob' assigned to role 'testrole'
> user assign_role --username bob --role testrole
ERROR:  duplicate key value violates unique constraint "index_roles_users_on_user_id_and_role_id"

Comment 4 Bryan Kearney 2014-02-18 14:39:55 UTC
this is against the katello-cli which we are not using any more, closing.