Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 1511598

Summary: Bound repositories can become mismatched between katello and pulp and will never correct itself
Product: Red Hat Satellite 6 Reporter: Justin Sherrill <jsherril>
Component: Content ManagementAssignee: satellite6-bugs <satellite6-bugs>
Status: NEW --- QA Contact: Lai <ltran>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.2.12CC: bbuckingham, cdonnell
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Justin Sherrill 2017-11-09 16:39:35 UTC
Description of problem:

A customer recently reported a case where errata were not showing up.  While running some debug commands we noticed this:

Host.find_by(:name => "HOSTNAME").content_facet.bound_repositories.pluck(:name)
 
=> ["Red Hat Satellite Tools 6.2 for RHEL 6 Server RPMs x86_64", "Red Hat Enterprise Linux 6 Server - Supplementary RPMs x86_64 6Server", "Red Hat Enterprise Linux 6 Server - Optional RPMs x86_64 6Server", "Red Hat Enterprise Linux 6 Server RPMs x86_64 6Server"] 


Katello::Pulp::Consumer.new(Host.find_by(:name => "HOSTNAME").content_facet.uuid).bound_yum_repositories.count 

=> 0

Something must have happened between when we saved the bound repos in katello and when they are saved in pulp (such as a pulp error was thrown).  

In addition, if a client gets in this state and katello-upload-package --force is run, the server will never actually update pulp because its 'optimized' to not generate applicability too often.




How reproducible:
not easily

Some ideas:

Get rid of the 'optimization' and always update pulp and generate applicability for 6.3, since the client is now caching it locally

Add a transaction to the db update, so that if pulp throws an error on save, the katello db save is rolled back and an exception is thrown.