Very easy to reproduce: 1. create an org 2. delete that org 3. in psql: select * from providers; note orphaned "Red Hat" provider
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
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
Closed in favor of tracking in the CFSE BZ 885261