Bug 961112

Summary: Deleting environment only removes it from Foreman but not from Katello
Product: Red Hat Satellite Reporter: Og Maciel <omaciel>
Component: Content ManagementAssignee: Dmitri Dolguikh <dmitri>
Status: CLOSED CURRENTRELEASE QA Contact: Og Maciel <omaciel>
Severity: high Docs Contact:
Priority: high    
Version: NightlyCC: dmitri, gkhachik, jsherril, mmccune
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: UnusedFlags: mmccune: needinfo+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-18 21:19:41 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 Og Maciel 2013-05-08 20:07:18 UTC
Description of problem:

Deleting an environment from a Katello organization using the Katello UI only removes it from Foreman. The environment can still be seen from the Katello UI


Version-Release number of selected component (if applicable):

* candlepin-0.8.5-1.el6.noarch
* candlepin-selinux-0.8.5-1.el6.noarch
* candlepin-tomcat6-0.8.5-1.el6.noarch
* elasticsearch-0.19.9-7.el6.noarch
* foreman-1.1stable-30.3849429.el6.noarch
* foreman-postgresql-1.1stable-30.3849429.el6.noarch
* katello-1.4.2-1.git.222.82e7958.el6.noarch
* katello-all-1.4.2-1.git.222.82e7958.el6.noarch
* katello-candlepin-cert-key-pair-1.0-1.noarch
* katello-certs-tools-1.4.2-1.el6.noarch
* katello-cli-1.4.2-1.git.37.40869e0.el6.noarch
* katello-cli-common-1.4.2-1.git.37.40869e0.el6.noarch
* katello-common-1.4.2-1.git.222.82e7958.el6.noarch
* katello-configure-1.4.3-1.el6.noarch
* katello-configure-foreman-1.4.3-1.el6.noarch
* katello-glue-candlepin-1.4.2-1.git.222.82e7958.el6.noarch
* katello-glue-elasticsearch-1.4.2-1.git.222.82e7958.el6.noarch
* katello-glue-pulp-1.4.2-1.git.222.82e7958.el6.noarch
* katello-qpid-broker-key-pair-1.0-1.noarch
* katello-qpid-client-key-pair-1.0-1.noarch
* katello-repos-1.4.2-1.el6.noarch
* katello-selinux-1.4.3-1.git.3.ce8227b.el6.noarch
* pulp-rpm-plugins-2.1.1-0.10.beta.el6.noarch
* pulp-selinux-2.1.1-0.10.beta.el6.noarch
* pulp-server-2.1.1-0.10.beta.el6.noarch

How reproducible:


Steps to Reproduce:
1. Create a new org and environment from Katello
2. Delete the environment
3.
  
Actual results:

UI shows a successful message but the environment is never removed

Expected results:


Additional info:
Started GET "/foreman/foreman_katello_engine/api/environments/show?org=Org2&env=QE&content_view=Default_Organization_View" for 127.0.0.1 at 2013-05-08 16:00:23 -0400
Processing by ForemanKatelloEngine::Api::EnvironmentsController#show as application/json;version=2
  Parameters: {"org"=>"Org2", "env"=>"QE", "content_view"=>"Default_Organization_View", "id"=>"show", "environment"=>{}}
  Rendered api/v2/errors/not_found.json.rabl (0.7ms)
Completed 404 Not Found in 6ms (Views: 1.4ms | ActiveRecord: 0.6ms)


Started DELETE "/foreman/api/environments/10" for 127.0.0.1 at 2013-05-08 16:00:23 -0400
Processing by Api::V1::EnvironmentsController#destroy as JSON
  Parameters: {"id"=>"10", "environment"=>{}}
Completed 200 OK in 32ms (Views: 0.6ms | ActiveRecord: 0.0ms)

Comment 1 Og Maciel 2013-05-08 20:08:53 UTC
katello> environment list --org Org2
---------------------------------------------------------------------------------------------------------------------
                                                  Environment List

ID Name    Label   Description Org  Prior Environment 
---------------------------------------------------------------------------------------------------------------------
11 QE      QE                  Org2 DEV               
10 DEV     DEV                 Org2 Library           
9  Library Library None        Org2 None

katello> environment delete --org Org2 --name QE
Successfully deleted environment [ QE ]
katello> environment list --org Org2
---------------------------------------------------------------------------------------------------------------------
                                                  Environment List

ID Name    Label   Description Org  Prior Environment 
---------------------------------------------------------------------------------------------------------------------
11 QE      QE                  Org2 DEV               
10 DEV     DEV                 Org2 Library           
9  Library Library None        Org2 None

Comment 2 Dmitri Dolguikh 2013-05-16 15:46:52 UTC
Can't reproduce the issue. Could you test again? What versions of katello-foreman-engine and foreman_api are (were) being used?

Comment 4 Mike McCune 2013-06-19 04:08:18 UTC
I can't reproduce this either. Steps I took:

1) login to Katello webui
2) nav go ACME_Corporation details page under Organizations
3) Added an org, 'testdelete'
4) Navigated to Foreman -> Configuration -> Environments
5) Saw it existed also in Foreman 
6) Went back to Katello's Org UI details for ACME_Corpration
7) Deleted 'testdelete'
8) It was gone from both katello and foreman with repeated UI refreshes and CLI queries

Comment 5 Og Maciel 2013-06-19 12:25:22 UTC
No longer seeing this. Verified:
* apr-util-ldap-1.3.9-3.el6_0.1.x86_64
* candlepin-0.8.9-1.el6_4.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.9-1.el6_4.noarch
* candlepin-tomcat6-0.8.9-1.el6_4.noarch
* elasticsearch-0.19.9-8.el6sat.noarch
* foreman-1.1.10011-1.noarch
* foreman-compute-1.1.10011-1.noarch
* foreman-installer-puppet-concat-0-2.d776701.git.0.21ef926.el6sat.noarch
* foreman-installer-puppet-dhcp-0-5.3a4a13c.el6sat.noarch
* foreman-installer-puppet-dns-0-7.fcae203.el6sat.noarch
* foreman-installer-puppet-foreman-0-6.568c5c4.el6sat.noarch
* foreman-installer-puppet-foreman_proxy-0-8.bd1e35d.el6sat.noarch
* foreman-installer-puppet-puppet-0-3.ab46748.el6sat.noarch
* foreman-installer-puppet-tftp-0-5.ea6c5e5.el6sat.noarch
* foreman-installer-puppet-xinetd-0-50a267b8.git.0.44aca6a.el6sat.noarch
* foreman-libvirt-1.1.10011-1.noarch
* foreman-postgresql-1.1.10011-1.noarch
* foreman-proxy-1.1.10003-1.el6sat.noarch
* foreman-proxy-installer-1.0.1-10.f5ae2cd.el6sat.noarch
* katello-1.4.2-14.el6sat.noarch
* katello-all-1.4.2-14.el6sat.noarch
* katello-candlepin-cert-key-pair-1.0-1.noarch
* katello-certs-tools-1.4.2-2.el6sat.noarch
* katello-cli-1.4.2-7.el6sat.noarch
* katello-cli-common-1.4.2-7.el6sat.noarch
* katello-common-1.4.2-14.el6sat.noarch
* katello-configure-1.4.3-16.el6sat.noarch
* katello-configure-foreman-1.4.3-16.el6sat.noarch
* katello-foreman-all-1.4.2-14.el6sat.noarch
* katello-glue-candlepin-1.4.2-14.el6sat.noarch
* katello-glue-elasticsearch-1.4.2-14.el6sat.noarch
* katello-glue-pulp-1.4.2-14.el6sat.noarch
* katello-qpid-broker-key-pair-1.0-1.noarch
* katello-qpid-client-key-pair-1.0-1.noarch
* katello-selinux-1.4.3-3.el6sat.noarch
* openldap-2.4.23-31.el6.x86_64
* pulp-rpm-plugins-2.1.2-0.3.beta.el6sat.noarch
* pulp-selinux-2.1.2-0.3.beta.el6sat.noarch
* pulp-server-2.1.2-0.3.beta.el6sat.noarch
* python-ldap-2.3.10-1.el6.x86_64
* ruby193-rubygem-ldap_fluff-0.2.2-1.el6sat.noarch
* ruby193-rubygem-net-ldap-0.3.1-2.el6sat.noarch
* signo-0.0.18-1.el6sat.noarch
* signo-katello-0.0.18-1.el6sat.noarch

Comment 6 Mike McCune 2013-07-18 21:19:41 UTC
mass move to CLOSED:CURRENTRELEASE since MDP1 has been released.