Bug 1434609

Summary: clean_backend_objects doesn't handle nil subscription_facet uuids properly
Product: Red Hat Satellite Reporter: Justin Sherrill <jsherril>
Component: InfrastructureAssignee: Justin Sherrill <jsherril>
Status: CLOSED ERRATA QA Contact: jcallaha
Severity: high Docs Contact:
Priority: medium    
Version: 6.2.0CC: bbuckingham, jcallaha, mmccune, zhunting
Target Milestone: UnspecifiedKeywords: PrioBumpField, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: rubygem-katello- Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1446718 (view as bug list) Environment:
Last Closed: 2017-06-20 17:23:25 UTC Type: ---
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-03-21 22:16:47 UTC
Currently the rake katello:clean_backend_objects does not remove the host if its uuid is nil on subscription-facet

Comment 1 Justin Sherrill 2017-03-21 22:16:51 UTC
Created from redmine issue http://projects.theforeman.org/issues/18972

Comment 2 Justin Sherrill 2017-03-21 22:16:54 UTC
Upstream bug assigned to jsherril

Comment 4 Satellite Program 2017-03-23 20:12:48 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/18972 has been resolved.

Comment 6 jcallaha 2017-05-25 20:01:25 UTC
Verified in Satellite 6.2.10 Snap 1.

In the foreman-rake console run the following commands
1. sub = Host.find(ID).subscription_facet
2. sub.uuid = nil
3. sub.save

Then run the rake command

-bash-4.2# foreman-rake katello:clean_backend_objects COMMIT=true
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_theme_satellite-0.1.43/app/models/concerns/satellite_packages.rb:4: warning: already initialized constant Katello::Ping::PACKAGES
/opt/theforeman/tfm/root/usr/share/gems/gems/katello- warning: previous definition of PACKAGES was here
Host 2 docker2  is partially missing.  Un-registering
Host 3 docker3  is partially missing.  Un-registering
Host 5 docker4  is partially missing.  Un-registering
Host 108 docker108  is partially missing.  Un-registering
1 orphaned consumer id(s) found.

When visiting the content host page for that host, you see the following message:
"This Host is not currently registered with subscription-manager. Click here for registration information."

Comment 8 errata-xmlrpc 2017-06-20 17:23:25 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.