Bug 1325879

Summary: unregistering a Content Host can pause ListenOnCandlepinEvents with Candlepin::Consumer: 410 Gone error
Product: Red Hat Satellite Reporter: Tomas Strachota <tstrachota>
Component: Content ManagementAssignee: Tomas Strachota <tstrachota>
Status: CLOSED ERRATA QA Contact: Renzo Nuccitelli <rnuccite>
Severity: high Docs Contact:
Priority: high    
Version: 6.2.0CC: bcourt, bkearney, chrobert, ealcaniz, jcallaha, ktordeur, mmccune, pmoravec, rnuccite, tstrachota
Target Milestone: UnspecifiedKeywords: Regression, Reopened, Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1320557 Environment:
Last Closed: 2018-02-21 17:31:10 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: 1320557    
Bug Blocks:    

Comment 1 Tomas Strachota 2016-04-11 12:24:38 UTC
I cloned the bug 1320557 into Satellite 6.2. Even though the code was moved to a different file and it has changed a bit as 6.2 no longer uses elasticsearch, the root of the problem persists. It is still possible that an event form Candlepin comes when the host is already unregistered.

app/lib/actions/candlepin/import_pool_handler.rb:

def reindex_consumer(message)
  if message.content['newEntity']
    uuid = JSON.parse(message.content['newEntity'])['consumer']['uuid']
    subscription_facet = ::Katello::Host::SubscriptionFacet.find_by_uuid(uuid)
    if subscription_facet.nil?
      @logger.debug "skip re-indexing of non-existent registered host #{uuid}"
    else
      @logger.debug "re-indexing content host #{subscription_facet.host.name}"
      subscription_facet.update_subscription_status
    end
  end
end

Comment 2 Mike McCune 2016-05-11 23:24:43 UTC
This is shipping in 6.1.9 and must be fixed in 6.2, marking regression+blocker to ensure it gets fixed.

Comment 5 Bryan Kearney 2016-07-26 15:25:24 UTC
Moving 6.2 bugs out to sat-backlog.

Comment 6 Bryan Kearney 2016-07-26 15:30:49 UTC
Moving 6.2 bugs out to sat-backlog.

Comment 8 Ivan Necas 2016-08-16 11:32:44 UTC
Since the elasticsearch was removed in satellite 6.2, this issue was resolved in 6.2 as well

Comment 9 Tomas Strachota 2016-08-18 09:33:09 UTC
I'm re-opening this. Elasticsearch is gone but the problem actually lied in the code that was triggering ES re-index. Please see my first comment for details: https://bugzilla.redhat.com/show_bug.cgi?id=1325879#c1

Comment 10 Tomas Strachota 2016-08-18 13:46:38 UTC
Created redmine issue http://projects.theforeman.org/issues/16170 from this bug

Comment 11 Bryan Kearney 2016-08-18 14:14:46 UTC
Upstream bug component is Content Management

Comment 12 Bryan Kearney 2016-08-22 22:14:34 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/16170 has been closed

Comment 16 Renzo Nuccitelli 2017-09-27 15:52:41 UTC
Feature worked on Satellite 6.3 snap 18. I've registered a Content Host using AK and it has shown green icon on UI. Just after that I've unsubscribed it and icon changed to red one. Thus I'm moving this BZ to verified.

Comment 17 Bryan Kearney 2018-02-21 17:31:10 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.

https://access.redhat.com/errata/RHSA-2018:0336