Bug 886142

Summary: katello-upgrade fails from 1.0 to 1.1
Product: [Retired] Subscription Asset Manager Reporter: Jordan OMara <jomara>
Component: katelloAssignee: Lukas Zapletal <lzap>
Status: CLOSED DEFERRED QA Contact: SAM QE List <sam-qe-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: 1.2CC: athomas, bbreard, bkearney, cwelton, sthirugn, tcarlin, tomckay
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 885261 Environment:
Last Closed: 2012-12-18 14:45:48 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: 885261    
Bug Blocks: 816564    

Comment 1 Tom McKay 2012-12-12 13:42:48 UTC
Very easy to reproduce:
1. create an org
2. delete that org
3. in psql: select * from providers;
   note orphaned "Red Hat" provider

Comment 2 sthirugn@redhat.com 2012-12-12 20:06:18 UTC
As per Tom McKay's request, I tested this bug today.  It worked fine.

Steps:
1. Provision RHEL 6.3 Server 
2. Install SAM 1.1
3. Add an Environment to ACME Organization
4. Subscribe an other machine to this SAM
5. Create an other Organization - Test Organization
5. Delete the ACME Organization
6. Follow the Upgrade process (1.1 to 1.2) in https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Subscription_Asset_Manager/1.2/html/Installation_Guide/sect-Installation_Guide-Administration-Upgrading_Subscription_Asset_Manager.html

Actual Results:
SAM Upgrade from 1.1 to 1.2 was successful.  No errors seen.


Logs:
[root@mgmt13 yum.repos.d]# katello-upgrade
================================================================================
 Katello upgrade
================================================================================

1/2: Update Candlepin (0003_update_candlepin.sh)
 Updates Candlepin database schema to the latest version

Do you want to proceed? (y/n): y

Update Candlepin OK.

================================================================================

2/2: Migrate Katello database (0004_migrate_katello_db.sh)
 Updates Katello database schema to the latest version

Do you want to proceed? (y/n): y

Migrate Katello database OK.

================================================================================
Upgrade successful
Finished 2 of 2 upgrade steps
Now that Katello has been upgraded, please run `katello-service start
to re-enable all of your services
In the future, you can run this script with the -a / --auto-stop option to
automatically stop & start your services

Comment 3 Tom McKay 2012-12-12 20:17:18 UTC
To clarify, my specific test scenario involving an older version of the tool creating an org with content, deleting it, and then upgrading to a newer version worked. There is still a potential for trouble in that the "Red Hat" provider is not deleted when the org is.

Leaving this BZ open to evaluate fix for CFSE BZ 885261

Comment 4 Tom McKay 2012-12-18 14:45:48 UTC
Closed in favor of tracking in the CFSE BZ 885261