Bug 874185

Summary: After 1.0 to 1.1 upgrade, seeing duplicated repositories in UI
Product: Red Hat Satellite Reporter: Og Maciel <omaciel>
Component: WebUIAssignee: Ivan Necas <inecas>
Status: CLOSED ERRATA QA Contact: Hayk Hovsepyan <hhovsepy>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.0.1CC: dmacpher, gkhachik, hhovsepy, inecas, jsherril, mmccune
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Due to a missing label association after upgrading 1.0 to 1.1, System Engine displays repository entries twice in the Content Search page. This fix simulates labels post-migration.
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-04 19:57:58 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:
Attachments:
Description Flags
screenshot1
none
screenshot2 none

Description Og Maciel 2012-11-07 16:34:51 UTC
Description of problem:

After upgrading from 1.0 to 1.1, I noticed that the web ui showed duplicated entries for my repositories in the Content Search page.

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

* candlepin-0.7.8.1-1.el6cf.noarch
* candlepin-selinux-0.7.8.1-1.el6cf.noarch
* candlepin-tomcat6-0.7.8.1-1.el6cf.noarch
* katello-1.1.12-20.el6cf.noarch
* katello-all-1.1.12-20.el6cf.noarch
* katello-candlepin-cert-key-pair-1.0-1.noarch
* katello-certs-tools-1.1.8-1.el6cf.noarch
* katello-cli-1.1.8-12.el6cf.noarch
* katello-cli-common-1.1.8-12.el6cf.noarch
* katello-common-1.1.12-20.el6cf.noarch
* katello-configure-1.1.9-11.el6cf.noarch
* katello-glue-candlepin-1.1.12-20.el6cf.noarch
* katello-glue-foreman-0.1.318-1.el6cf.noarch
* katello-glue-pulp-1.1.12-20.el6cf.noarch
* katello-qpid-broker-key-pair-1.0-1.noarch
* katello-qpid-client-key-pair-1.0-1.noarch
* katello-selinux-1.1.1-2.el6cf.noarch
* pulp-1.1.14-1.el6cf.noarch
* pulp-common-1.1.14-1.el6cf.noarch
* pulp-selinux-server-1.1.14-1.el6cf.noarch

How reproducible:


Steps to Reproduce:
1. Get a 1.0 system and create org with 1 custom provider, 1 product, 2 repos
2. Sync and promote product
3. Upgrade to 1.1
4. Visit Content Search and search for all repos or packages
  
Actual results:

Seeing duplicated entries

Expected results:


Additional info:

Comment 1 Og Maciel 2012-11-07 16:35:24 UTC
Created attachment 640178 [details]
screenshot1

Comment 2 Og Maciel 2012-11-07 16:35:53 UTC
Created attachment 640179 [details]
screenshot2

Comment 4 Justin Sherrill 2012-11-08 02:45:58 UTC
The problem seems to be that for some reason  library_instance_id isn't being set properly on non-library Repository objects within katello's db upon upgrade.

IT is supposed to set in 20120702175532_add_repository_library_id.rb but for some reason its not.  When i run the code by hand after upgrading it seems to function properly....

Will dig some more.

Comment 5 Ivan Necas 2012-11-08 09:37:39 UTC
The problem is org.promotion_paths doesn't start with Library when running the migration for some reason. Digging in as well.

Comment 6 Ivan Necas 2012-11-08 09:49:13 UTC
Taking back my last comment: this is the real issue:

  def get_clone env
    Repository.find_by_pulp_id(self.clone_id(env))
  rescue
    nil
  end

clone_id uses label, but this is introduced in the migration after this one. The rescue causes the migration continues without error

Comment 7 Ivan Necas 2012-11-08 10:57:23 UTC
Patch send in https://github.com/Katello/katello/pull/1018

Comment 8 Garik Khachikyan 2012-11-08 12:55:48 UTC
btw: i just reproduced the same with: 1.0.1 -> 1.1

Comment 13 Justin Sherrill 2012-11-09 03:27:04 UTC
Good catch Ivan, thanks for taking this over during my PTO.  Since the labels were added after i added this migration they worked fine at the time obviously and worked after the upgrade was complete ;)

I do wonder if it had been simplier to just move the migration after the label creation one, but that may have caused other complications i guess.  Anyways, good work!

Comment 16 Ivan Necas 2012-11-09 08:57:54 UTC
Moving the migrations is not an option in the upstream, since it would break the installatins that already have this migration applied.

Comment 17 Ivan Necas 2012-11-09 09:26:54 UTC
There was an additional issue found with this fix: https://bugzilla.redhat.com/show_bug.cgi?id=874768

This fix comes in https://github.com/Katello/katello/pull/1027/commits

Comment 18 Hayk Hovsepyan 2012-11-09 13:26:36 UTC
Verified on recent brew revision:

katello-certs-tools-1.1.8-1.el6cf.noarch
katello-configure-1.1.9-12.el6cf.noarch
katello-glue-candlepin-1.1.12-22.el6cf.noarch
katello-common-1.1.12-22.el6cf.noarch
katello-glue-pulp-1.1.12-22.el6cf.noarch
katello-agent-1.1.2-1.el6cf.noarch
katello-glue-foreman-0.1.311-1.el6_2.noarch
katello-candlepin-cert-key-pair-1.0-1.noarch
katello-qpid-client-key-pair-1.0-1.noarch
katello-cli-common-1.1.8-12.el6cf.noarch
katello-selinux-1.1.1-2.el6cf.noarch
katello-qpid-broker-key-pair-1.0-1.noarch
katello-cli-1.1.8-12.el6cf.noarch
katello-1.1.12-22.el6cf.noarch

Now it does not show duplicate search results.

Comment 20 errata-xmlrpc 2012-12-04 19:57:58 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2012-1543.html

Comment 21 Mike McCune 2013-08-16 17:58:32 UTC
getting rid of 6.0.0 version since that doesn't exist