Bug 1002495

Summary: org delete after importing manifest fails
Product: Red Hat Satellite Reporter: Ales Dujicek <adujicek>
Component: APIAssignee: Partha Aji <paji>
Status: CLOSED CURRENTRELEASE QA Contact: Hayk Hovsepyan <hhovsepy>
Severity: medium Docs Contact:
Priority: unspecified    
Version: NightlyCC: cwelton, ehelms, gkhachik, hhovsepy, jmontleo, mmccune, pchalupa
Target Milestone: UnspecifiedKeywords: Regression, 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-04-24 17:10: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:
Bug Depends On: 977744    
Bug Blocks:    

Description Ales Dujicek 2013-08-29 10:27:28 UTC
Description of problem:

after importing manifest using UI and deleting organization
I get this error message from UI:
Failed to delete organization 'org4'. Check notices for more details.
PGError: ERROR: update or delete on table "organizations" violates foreign key constraint "notices_organization_id_fk" on table "notices" DETAIL: Key (id)=(12) is still referenced from table "notices". : COMMIT (ActiveRecord::InvalidForeignKey)

CLI prints only:
Organization [ orgA ] deletion failed:: 


Version-Release number of selected component (if applicable):
katello-glue-elasticsearch-1.4.3-1.git.281.6adbd58.el6.noarch
katello-qpid-client-key-pair-1.0-1.noarch
katello-repos-1.4.2-1.el6.noarch
katello-cli-1.4.3-1.git.17.587602e.el6.noarch
katello-certs-tools-1.4.2-1.el6.noarch
pulp-katello-plugins-0.2-1.el6.noarch
katello-glue-candlepin-1.4.3-1.git.281.6adbd58.el6.noarch
katello-1.4.3-1.git.281.6adbd58.el6.noarch
katello-candlepin-cert-key-pair-1.0-1.noarch
katello-cli-common-1.4.3-1.git.17.587602e.el6.noarch
katello-selinux-1.4.4-1.el6.noarch
katello-all-1.4.3-1.git.281.6adbd58.el6.noarch
katello-glue-pulp-1.4.3-1.git.281.6adbd58.el6.noarch
katello-qpid-broker-key-pair-1.0-1.noarch
katello-configure-1.4.4-1.git.7.8244ec0.el6.noarch
katello-common-1.4.3-1.git.281.6adbd58.el6.noarch


How reproducible:
always

Steps to Reproduce:
1. create org
2. using UI import manifest
3. delete org

Comment 2 Petr Chalupa 2013-10-11 14:41:23 UTC
fixed in 6a40eba9618409b004807484fdb0dcf1a6d9f60a

Comment 5 Hayk Hovsepyan 2013-10-14 09:08:57 UTC
Verified in revision:
Katello-Katello-Installation-RegisterRHNClassic-1.1-4.noarch
foreman-1.3.0-17.el6sat.noarch
katello-cli-1.4.3-20.el6sat.noarch
pulp-selinux-2.3.0-0.17.beta.el6sat.noarch
openldap-2.4.23-31.el6.x86_64
apr-util-ldap-1.3.9-3.el6_0.1.x86_64
python-ldap-2.3.10-1.el6.x86_64
katello-certs-tools-1.4.4-1.el6sat.noarch
pulp-nodes-parent-2.3.0-0.17.beta.el6sat.noarch
elasticsearch-0.19.9-8.el6sat.noarch
katello-glue-candlepin-1.4.6-31.el6sat.noarch
candlepin-tomcat6-0.8.25-1.el6sam.noarch
candlepin-cert-consumer-dionysus.usersys.redhat.com-1.0-1.noarch
Katello-Katello-Installation-Satellite6Latest-1.0-12.noarch
candlepin-scl-rhino-1.7R3-1.el6_4.noarch
katello-candlepin-cert-key-pair-1.0-1.noarch
katello-qpid-client-key-pair-1.0-1.noarch
signo-0.0.22-2.el6sat.noarch
foreman-proxy-1.3.0-3.el6sat.noarch
foreman-postgresql-1.3.0-17.el6sat.noarch
katello-cli-common-1.4.3-20.el6sat.noarch
katello-configure-1.4.7-3.el6sat.noarch
pulp-server-2.3.0-0.17.beta.el6sat.noarch
pulp-nodes-common-2.3.0-0.17.beta.el6sat.noarch
pulp-puppet-plugins-2.3.0-0.17.beta.el6sat.noarch
candlepin-scl-1-5.el6_4.noarch
ruby193-rubygem-net-ldap-0.3.1-3.el6sat.noarch
candlepin-selinux-0.8.25-1.el6sam.noarch
signo-katello-0.0.22-2.el6sat.noarch
katello-selinux-1.4.4-4.el6sat.noarch
katello-glue-elasticsearch-1.4.6-31.el6sat.noarch
katello-1.4.6-31.el6sat.noarch
katello-configure-foreman-1.4.7-3.el6sat.noarch
katello-all-1.4.6-31.el6sat.noarch
pulp-rpm-handlers-2.3.0-0.17.beta.el6sat.noarch
katello-agent-1.4.4-3.el6sat.noarch
candlepin-scl-runtime-1-5.el6_4.noarch
katello-configure-foreman-proxy-1.4.7-3.el6sat.noarch
pulp-rpm-plugins-2.3.0-0.17.beta.el6sat.noarch
pulp-katello-plugins-0.2-1.el6sat.noarch
candlepin-scl-quartz-2.1.5-5.el6_4.noarch
candlepin-0.8.25-1.el6sam.noarch
katello-common-1.4.6-31.el6sat.noarch
katello-glue-pulp-1.4.6-31.el6sat.noarch
katello-foreman-all-1.4.6-31.el6sat.noarch
ruby193-rubygem-ldap_fluff-0.2.2-2.el6sat.noarch
katello-qpid-broker-key-pair-1.0-1.noarch
Katello-Katello-Configuration-KatelloClient-1.1-53.noarch
Katello-Katello-Sanity-ImportKeys-1.2-1.noarch

Comment 6 Hayk Hovsepyan 2013-10-14 09:41:18 UTC
The bug still fails for several scenarios:

create org > create environment > import manifest > delete org
create org > import manifest > refresh manifest > delete org
create org > import manifest > delete application in customer portal > delete org
create org > import manifest > in customer portal increase/decrease subscriptions > refresh manifest > delete org

Comment 7 Petr Chalupa 2013-10-14 13:19:29 UTC
this was actually fixed in a previous commit 3b794e7ace8041dc3d90d2271d01aa0350d2800c which is missing in satellite (it's present in sam). Cherry-picking the above commit should fix the issue.

Comment 10 Hayk Hovsepyan 2013-10-18 13:13:39 UTC
Tested on latest sat6 puddle and katello nightly, now org delete fails with some other error.

Steps:
1. create new org, environments for it
2. import valid manifest
3. enable RHEL repo set and enable repo "Red Hat Enterprise Linux 6 Server RPMs x86_64 6Server". (not need to sync it)
4. create content definition, add RHEL repo into it, publish content view
5. try to delete org, it fails with error: "Failed to delete organization 'org delete'. Check notices for more details.
undefined method `editable?' for nil:NilClass (NoMethodError)"


Katello-Katello-Installation-RegisterRHNClassic-1.1-4.noarch
foreman-1.3.0-18.el6sat.noarch
openldap-2.4.23-31.el6.x86_64
pulp-katello-plugins-0.2-1.el6sat.noarch
candlepin-scl-quartz-2.1.5-5.el6_4.noarch
candlepin-selinux-0.8.25-1.el6sam.noarch
katello-glue-pulp-1.4.6-40.el6sat.noarch
katello-1.4.6-40.el6sat.noarch
katello-candlepin-cert-key-pair-1.0-1.noarch
ruby193-rubygem-ldap_fluff-0.2.2-2.el6sat.noarch
foreman-proxy-1.3.0-3.el6sat.noarch
katello-agent-1.4.4-3.el6sat.noarch
candlepin-scl-runtime-1-5.el6_4.noarch
candlepin-scl-rhino-1.7R3-1.el6_4.noarch
apr-util-ldap-1.3.9-3.el6_0.1.x86_64
katello-qpid-broker-key-pair-1.0-1.noarch
foreman-postgresql-1.3.0-18.el6sat.noarch
katello-cli-1.4.3-24.el6sat.noarch
katello-configure-1.4.7-6.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
candlepin-0.8.25-1.el6sam.noarch
ruby193-rubygem-net-ldap-0.3.1-3.el6sat.noarch
elasticsearch-0.19.9-8.el6sat.noarch
katello-common-1.4.6-40.el6sat.noarch
katello-glue-candlepin-1.4.6-40.el6sat.noarch
katello-glue-elasticsearch-1.4.6-40.el6sat.noarch
candlepin-tomcat6-0.8.25-1.el6sam.noarch
katello-foreman-all-1.4.6-40.el6sat.noarch
Katello-Katello-Configuration-KatelloClient-1.1-53.noarch
candlepin-cert-consumer-demeter.usersys.redhat.com-1.0-1.noarch
signo-0.0.23-2.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-nodes-parent-2.3.0-0.22.beta.el6sat.noarch
signo-katello-0.0.23-2.el6sat.noarch
katello-selinux-1.4.4-4.el6sat.noarch
katello-configure-foreman-1.4.7-6.el6sat.noarch
katello-all-1.4.6-40.el6sat.noarch
katello-qpid-client-key-pair-1.0-1.noarch
Katello-Katello-Installation-HammerCLI-1.0-9.noarch
pulp-rpm-handlers-2.3.0-0.22.beta.el6sat.noarch
Katello-Katello-Sanity-ImportKeys-1.2-1.noarch

Comment 12 Partha Aji 2013-10-29 22:20:48 UTC
should be fixed when https://github.com/Katello/katello/pull/3284 gets merged to master

Comment 13 Partha Aji 2013-10-29 22:23:28 UTC
should be fixed ->

c89ad4ad8a251fa898d8bfebf1e7ab1c2f16eae2

Comment 16 Hayk Hovsepyan 2013-10-31 13:40:54 UTC
Verified on revision:
Katello-Katello-Installation-RegisterRHSM-1.1-5.noarch
pulp-selinux-2.3.0-0.26.beta.el6sat.noarch
candlepin-scl-rhino-1.7R3-1.el6_4.noarch
python-ldap-2.3.10-1.el6.x86_64
katello-certs-tools-1.4.4-1.el6sat.noarch
openldap-2.4.23-31.el6.x86_64
pulp-server-2.3.0-0.26.beta.el6sat.noarch
pulp-nodes-common-2.3.0-0.26.beta.el6sat.noarch
ruby193-rubygem-net-ldap-0.3.1-3.el6sat.noarch
katello-glue-pulp-1.4.6-55.el6sat.noarch
katello-1.4.6-55.el6sat.noarch
katello-foreman-all-1.4.6-55.el6sat.noarch
katello-qpid-client-key-pair-1.0-1.noarch
candlepin-cert-consumer-apollo.usersys.redhat.com-1.0-1.noarch
signo-0.0.23-2.el6sat.noarch
Katello-Katello-Installation-Satellite6Latest-1.0-13.noarch
candlepin-scl-runtime-1-5.el6_4.noarch
katello-qpid-broker-key-pair-1.0-1.noarch
foreman-postgresql-1.3.0-24.el6sat.noarch
katello-cli-common-1.4.3-28.el6sat.noarch
katello-configure-1.4.7-7.el6sat.noarch
pulp-rpm-plugins-2.3.0-0.26.beta.el6sat.noarch
pulp-puppet-plugins-2.3.0-0.26.beta.el6sat.noarch
pulp-nodes-parent-2.3.0-0.26.beta.el6sat.noarch
candlepin-scl-1-5.el6_4.noarch
candlepin-0.8.25-1.el6sam.noarch
candlepin-selinux-0.8.25-1.el6sam.noarch
elasticsearch-0.19.9-8.el6sat.noarch
katello-common-1.4.6-55.el6sat.noarch
katello-glue-candlepin-1.4.6-55.el6sat.noarch
katello-glue-elasticsearch-1.4.6-55.el6sat.noarch
katello-all-1.4.6-55.el6sat.noarch
ruby193-rubygem-ldap_fluff-0.2.2-2.el6sat.noarch
Katello-Katello-Configuration-KatelloClient-1.1-53.noarch
pulp-rpm-handlers-2.3.0-0.26.beta.el6sat.noarch
katello-agent-1.4.4-3.el6sat.noarch
foreman-1.3.0-24.el6sat.noarch
katello-cli-1.4.3-28.el6sat.noarch
apr-util-ldap-1.3.9-3.el6_0.1.x86_64
pulp-katello-plugins-0.2-1.el6sat.noarch
candlepin-scl-quartz-2.1.5-5.el6_4.noarch
candlepin-tomcat6-0.8.25-1.el6sam.noarch
signo-katello-0.0.23-2.el6sat.noarch
katello-selinux-1.4.4-4.el6sat.noarch
katello-configure-foreman-1.4.7-7.el6sat.noarch
katello-candlepin-cert-key-pair-1.0-1.noarch
foreman-proxy-1.3.0-3.el6sat.noarch
Katello-Katello-Sanity-ImportKeys-1.2-1.noarch

Comment 17 Hayk Hovsepyan 2013-11-07 14:40:22 UTC
Here we have a regression in Satellite 6 MDP2 SNAP 9 Comp 1.
Org deletion with imported manifest still fails.


Katello-Katello-Installation-RegisterRHSM-1.1-6.noarch
pulp-selinux-2.3.0-0.29.beta.el6sat.noarch
candlepin-scl-rhino-1.7R3-1.el6_4.noarch
katello-configure-1.4.7-7.el6sat.noarch
openldap-2.4.23-31.el6.x86_64
pulp-server-2.3.0-0.29.beta.el6sat.noarch
pulp-katello-plugins-0.2-1.el6sat.noarch
ruby193-rubygem-net-ldap-0.3.1-3.el6sat.noarch
katello-glue-pulp-1.4.6-62.el6sat.noarch
katello-1.4.6-62.el6sat.noarch
katello-foreman-all-1.4.6-62.el6sat.noarch
katello-qpid-client-key-pair-1.0-1.noarch
katello-agent-1.4.4-3.el6sat.noarch
signo-0.0.23-2.el6sat.noarch
Katello-Katello-Installation-Satellite6Latest-1.0-15.noarch
candlepin-scl-runtime-1-5.el6_4.noarch
katello-qpid-broker-key-pair-1.0-1.noarch
foreman-postgresql-1.3.0-27.el6sat.noarch
katello-cli-common-1.4.3-29.el6sat.noarch
katello-certs-tools-1.4.4-1.el6sat.noarch
python-ldap-2.3.10-1.el6.x86_64
pulp-nodes-common-2.3.0-0.29.beta.el6sat.noarch
pulp-puppet-plugins-2.3.0-0.29.beta.el6sat.noarch
pulp-rpm-plugins-2.3.0-0.29.beta.el6sat.noarch
candlepin-scl-1-5.el6_4.noarch
candlepin-0.8.25-1.el6sam.noarch
candlepin-selinux-0.8.25-1.el6sam.noarch
elasticsearch-0.19.9-8.el6sat.noarch
katello-common-1.4.6-62.el6sat.noarch
katello-glue-candlepin-1.4.6-62.el6sat.noarch
katello-glue-elasticsearch-1.4.6-62.el6sat.noarch
katello-all-1.4.6-62.el6sat.noarch
ruby193-rubygem-ldap_fluff-0.2.2-2.el6sat.noarch
Katello-Katello-Configuration-KatelloClient-1.1-54.noarch
candlepin-cert-consumer-zeus.usersys.redhat.com-1.0-1.noarch
foreman-1.3.0-27.el6sat.noarch
katello-cli-1.4.3-29.el6sat.noarch
apr-util-ldap-1.3.9-3.el6_0.1.x86_64
pulp-nodes-parent-2.3.0-0.29.beta.el6sat.noarch
candlepin-scl-quartz-2.1.5-5.el6_4.noarch
candlepin-tomcat6-0.8.25-1.el6sam.noarch
signo-katello-0.0.23-2.el6sat.noarch
katello-selinux-1.4.4-4.el6sat.noarch
katello-configure-foreman-1.4.7-7.el6sat.noarch
katello-candlepin-cert-key-pair-1.0-1.noarch
foreman-proxy-1.3.0-3.el6sat.noarch
pulp-rpm-handlers-2.3.0-0.29.beta.el6sat.noarch
Katello-Katello-Installation-HammerCLI-1.0-11.noarch
Katello-Katello-Sanity-ImportKeys-1.2-1.noarch

Comment 19 Partha Aji 2013-11-07 19:46:49 UTC
should be fixed when  https://github.com/Katello/katello/pull/3338 gets merged to master.

Comment 20 Partha Aji 2013-11-07 21:43:06 UTC
Should be fixed ->
4006775d2bb41c4b11891686c2ca24962a655538

Comment 23 Hayk Hovsepyan 2013-11-08 11:28:01 UTC
Verified on revision:
Katello-Katello-Installation-RegisterRHSM-1.1-6.noarch
candlepin-scl-rhino-1.7R3-1.el6_4.noarch
katello-configure-1.4.7-7.el6sat.noarch
openldap-2.4.23-31.el6.x86_64
pulp-server-2.3.0-0.29.beta.el6sat.noarch
pulp-katello-plugins-0.2-1.el6sat.noarch
ruby193-rubygem-net-ldap-0.3.1-3.el6sat.noarch
katello-glue-pulp-1.4.6-63.el6sat.noarch
katello-1.4.6-63.el6sat.noarch
katello-foreman-all-1.4.6-63.el6sat.noarch
katello-qpid-client-key-pair-1.0-1.noarch
katello-agent-1.4.4-3.el6sat.noarch
signo-0.0.23-2.el6sat.noarch
Katello-Katello-Installation-Satellite6Latest-1.0-15.noarch
candlepin-scl-runtime-1-5.el6_4.noarch
katello-qpid-broker-key-pair-1.0-1.noarch
foreman-postgresql-1.3.0-27.el6sat.noarch
katello-cli-common-1.4.3-29.el6sat.noarch
katello-certs-tools-1.4.4-1.el6sat.noarch
python-ldap-2.3.10-1.el6.x86_64
pulp-nodes-common-2.3.0-0.29.beta.el6sat.noarch
pulp-puppet-plugins-2.3.0-0.29.beta.el6sat.noarch
pulp-rpm-plugins-2.3.0-0.29.beta.el6sat.noarch
candlepin-scl-quartz-2.1.5-5.el6_4.noarch
candlepin-0.8.25-1.el6sam.noarch
candlepin-selinux-0.8.25-1.el6sam.noarch
elasticsearch-0.19.9-8.el6sat.noarch
katello-common-1.4.6-63.el6sat.noarch
katello-glue-candlepin-1.4.6-63.el6sat.noarch
katello-glue-elasticsearch-1.4.6-63.el6sat.noarch
katello-all-1.4.6-63.el6sat.noarch
ruby193-rubygem-ldap_fluff-0.2.2-2.el6sat.noarch
Katello-Katello-Configuration-KatelloClient-1.1-54.noarch
candlepin-cert-consumer-artemis.usersys.redhat.com-1.0-1.noarch
foreman-1.3.0-27.el6sat.noarch
katello-cli-1.4.3-29.el6sat.noarch
pulp-selinux-2.3.0-0.29.beta.el6sat.noarch
apr-util-ldap-1.3.9-3.el6_0.1.x86_64
pulp-nodes-parent-2.3.0-0.29.beta.el6sat.noarch
candlepin-scl-1-5.el6_4.noarch
candlepin-tomcat6-0.8.25-1.el6sam.noarch
signo-katello-0.0.23-2.el6sat.noarch
katello-selinux-1.4.4-4.el6sat.noarch
katello-configure-foreman-1.4.7-7.el6sat.noarch
katello-candlepin-cert-key-pair-1.0-1.noarch
foreman-proxy-1.3.0-3.el6sat.noarch
pulp-rpm-handlers-2.3.0-0.29.beta.el6sat.noarch
Katello-Katello-Sanity-ImportKeys-1.2-1.noarch

Now it removes organization with manifest imported.

Comment 24 Bryan Kearney 2014-04-24 17:10:18 UTC
This was verified and delivered with MDP2. Closing it out.

Comment 25 Bryan Kearney 2014-04-24 17:11:36 UTC
This was delivered and verified with MDP2. Closing the bug.