Bug 1013837
Summary: | Unable to delete an user if the user had any active notifications | ||
---|---|---|---|
Product: | Red Hat Satellite | Reporter: | sthirugn <sthirugn> |
Component: | Content Management | Assignee: | Petr Chalupa <pchalupa> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Tazim Kolhar <tkolhar> |
Severity: | high | Docs Contact: | |
Priority: | unspecified | ||
Version: | 6.0.2 | CC: | cwelton, hhovsepy, jmontleo, mmccune, tkolhar, tsanders |
Target Milestone: | Unspecified | Keywords: | Triaged |
Target Release: | Unused | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | 1013798 | Environment: | |
Last Closed: | 2014-07-02 14:05:18 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: | |||
Bug Depends On: | |||
Bug Blocks: | 1013798, 1026936, 1026948 |
Description
sthirugn@redhat.com
2013-09-30 21:45:50 UTC
other tables that need to be cleaned out when deleting a user (query to find all user table FKs): katello=> SELECT tc.constraint_name, tc.table_name, kcu.column_name, ccu.table_name AS foreign_table_name, ccu.column_name AS foreign_column_name FROM information_schema.table_constraints AS tc JOIN information_schema.key_column_usage AS kcu ON tc.constraint_name = kcu.constraint_name JOIN information_schema.constraint_column_usage AS ccu ON ccu.constraint_name = tc.constraint_name WHERE constraint_type = 'FOREIGN KEY' AND ccu.table_name = 'users' AND ccu.column_name = 'id'; constraint_name | table_name | column_name | foreign_table_name | foreign_column_name --------------------------------+---------------------+-------------+--------------------+--------------------- activation_keys_user_id_fk | activation_keys | user_id | users | id changeset_users_user_id_fk | changeset_users | user_id | users | id help_tips_user_id_fk | help_tips | user_id | users | id roles_users_user_id_fk | roles_users | user_id | users | id search_favorites_user_id_fk | search_favorites | user_id | users | id search_histories_user_id_fk | search_histories | user_id | users | id task_statuses_user_id_fk | task_statuses | user_id | users | id user_notices_user_id_fk | user_notices | user_id | users | id organizations_users_user_id_fk | organizations_users | user_id | users | id (9 rows) fixed in 6a40eba9618409b004807484fdb0dcf1a6d9f60a Tested on revision: Katello-Katello-Installation-RegisterRHNClassic-1.1-4.noarch foreman-postgresql-1.3.0-18.el6sat.noarch candlepin-scl-runtime-1-5.el6_4.noarch apr-util-ldap-1.3.9-3.el6_0.1.x86_64 openldap-2.4.23-31.el6.x86_64 pulp-nodes-common-2.3.0-0.22.beta.el6sat.noarch candlepin-scl-1-5.el6_4.noarch elasticsearch-0.19.9-8.el6sat.noarch katello-glue-candlepin-1.4.6-40.el6sat.noarch candlepin-tomcat6-0.8.25-1.el6sam.noarch katello-qpid-broker-key-pair-1.0-1.noarch Katello-Katello-Configuration-KatelloClient-1.1-53.noarch Katello-Katello-Installation-Satellite6Latest-1.0-13.noarch katello-candlepin-cert-key-pair-1.0-1.noarch katello-qpid-client-key-pair-1.0-1.noarch foreman-1.3.0-18.el6sat.noarch katello-cli-common-1.4.3-24.el6sat.noarch pulp-selinux-2.3.0-0.22.beta.el6sat.noarch python-ldap-2.3.10-1.el6.x86_64 katello-certs-tools-1.4.4-1.el6sat.noarch pulp-server-2.3.0-0.22.beta.el6sat.noarch pulp-katello-plugins-0.2-1.el6sat.noarch pulp-nodes-parent-2.3.0-0.22.beta.el6sat.noarch candlepin-scl-quartz-2.1.5-5.el6_4.noarch candlepin-selinux-0.8.25-1.el6sam.noarch signo-katello-0.0.23-2.el6sat.noarch katello-glue-pulp-1.4.6-40.el6sat.noarch katello-selinux-1.4.4-4.el6sat.noarch katello-1.4.6-40.el6sat.noarch katello-configure-foreman-1.4.7-6.el6sat.noarch katello-all-1.4.6-40.el6sat.noarch ruby193-rubygem-ldap_fluff-0.2.2-2.el6sat.noarch foreman-proxy-1.3.0-3.el6sat.noarch pulp-rpm-handlers-2.3.0-0.22.beta.el6sat.noarch katello-agent-1.4.4-3.el6sat.noarch Katello-Katello-Installation-HammerCLI-1.0-9.noarch katello-cli-1.4.3-24.el6sat.noarch candlepin-scl-rhino-1.7R3-1.el6_4.noarch katello-configure-1.4.7-6.el6sat.noarch pulp-puppet-plugins-2.3.0-0.22.beta.el6sat.noarch pulp-rpm-plugins-2.3.0-0.22.beta.el6sat.noarch candlepin-0.8.25-1.el6sam.noarch ruby193-rubygem-net-ldap-0.3.1-3.el6sat.noarch katello-common-1.4.6-40.el6sat.noarch katello-glue-elasticsearch-1.4.6-40.el6sat.noarch katello-foreman-all-1.4.6-40.el6sat.noarch candlepin-cert-consumer-hades.usersys.redhat.com-1.0-1.noarch signo-0.0.23-2.el6sat.noarch Katello-Katello-Sanity-ImportKeys-1.2-1.noarch User delete still fails: 1. Create an user - User1 2. Log in as User1 3. Create org, import manifest, create activation key. 4. Log out and log in back as an other admin user 5. Attempt to remove the User1, it will fail with error: "ERROR: update or delete on table "users" violates foreign key constraint "activation_keys_user_id_fk" on table "activation_keys" DETAIL: Key (id)=(3) is still referenced from table "activation_keys". (PGError) " The original bug related to notifications is fixed, this is failing because of missing commit from bug https://bugzilla.redhat.com/show_bug.cgi?id=1007117. Please cherry-pick https://github.com/Katello/katello/commit/eb3248f774bca8a7ecfdc1241ea5952c6caaf768 to fix FK activation-key issue. Tested on revision: Katello-Katello-Installation-RegisterRHNClassic-1.1-4.noarch foreman-postgresql-1.3.0-20.el6sat.noarch candlepin-scl-runtime-1-5.el6_4.noarch python-ldap-2.3.10-1.el6.x86_64 apr-util-ldap-1.3.9-3.el6_0.1.x86_64 openldap-2.4.23-31.el6.x86_64 katello-certs-tools-1.4.4-1.el6sat.noarch pulp-server-2.3.0-0.22.beta.el6sat.noarch pulp-nodes-parent-2.3.0-0.22.beta.el6sat.noarch katello-glue-pulp-1.4.6-47.el6sat.noarch katello-1.4.6-47.el6sat.noarch candlepin-selinux-0.8.25-1.el6sam.noarch katello-qpid-broker-key-pair-1.0-1.noarch Katello-Katello-Configuration-KatelloClient-1.1-53.noarch Katello-Katello-Installation-Satellite6Latest-1.0-13.noarch katello-candlepin-cert-key-pair-1.0-1.noarch katello-qpid-client-key-pair-1.0-1.noarch foreman-1.3.0-20.el6sat.noarch katello-cli-common-1.4.3-27.el6sat.noarch pulp-selinux-2.3.0-0.22.beta.el6sat.noarch katello-configure-1.4.7-7.el6sat.noarch pulp-puppet-plugins-2.3.0-0.22.beta.el6sat.noarch pulp-nodes-common-2.3.0-0.22.beta.el6sat.noarch pulp-rpm-plugins-2.3.0-0.22.beta.el6sat.noarch candlepin-scl-1-5.el6_4.noarch elasticsearch-0.19.9-8.el6sat.noarch katello-common-1.4.6-47.el6sat.noarch katello-glue-candlepin-1.4.6-47.el6sat.noarch katello-glue-elasticsearch-1.4.6-47.el6sat.noarch candlepin-tomcat6-0.8.25-1.el6sam.noarch katello-all-1.4.6-47.el6sat.noarch ruby193-rubygem-ldap_fluff-0.2.2-2.el6sat.noarch foreman-proxy-1.3.0-3.el6sat.noarch pulp-rpm-handlers-2.3.0-0.22.beta.el6sat.noarch katello-agent-1.4.4-3.el6sat.noarch Katello-Katello-Installation-HammerCLI-1.0-9.noarch signo-0.0.23-2.el6sat.noarch katello-cli-1.4.3-27.el6sat.noarch candlepin-scl-rhino-1.7R3-1.el6_4.noarch pulp-katello-plugins-0.2-1.el6sat.noarch candlepin-scl-quartz-2.1.5-5.el6_4.noarch signo-katello-0.0.23-2.el6sat.noarch ruby193-rubygem-net-ldap-0.3.1-3.el6sat.noarch katello-selinux-1.4.4-4.el6sat.noarch katello-configure-foreman-1.4.7-7.el6sat.noarch candlepin-0.8.25-1.el6sam.noarch katello-foreman-all-1.4.6-47.el6sat.noarch candlepin-cert-consumer-hades.usersys.redhat.com-1.0-1.noarch Katello-Katello-Sanity-ImportKeys-1.2-1.noarch The same steps for reproduce, the same error is shown. 1. Create an user - User1 2. Log in as User1 3. Create org, import manifest, create activation key. 4. Log out and log in back as an other admin user 5. Attempt to remove the User1, it will fail with error: "ERROR: update or delete on table "users" violates foreign key constraint "activation_keys_user_id_fk" on table "activation_keys" DETAIL: Key (id)=(3) is still referenced from table "activation_keys". (PGError) " moving to test this in MDP3 *** Bug 1026936 has been marked as a duplicate of this bug. *** VERIFIED : user deleted This was delivered with 6.0.3, which is the Satellite 6 Beta. |