Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
subscription_status of content hosts according to Satellite WebUI is incorrect vs. `subscription-manager status` output of corresponding system.
STEPS TAKEN:
1. We validated that the subscription_status reported on the Satellite WebUI was unknown, while `subscription-manager status` (what is reported by Candlepin /rhsm API) output shows valid subscription status
2. Checked the internal Katello subscription_status (which returns "valid") of the content host using the below rake script:
#!/bin/bash
echo '
myHost = Host.find_by_name("myhost.example.com")
Katello::Candlepin::Consumer.new(myHost.subscription_facet.uuid, myHost.organization.label).entitlement_status
' | foreman-rake console
Which gives the output:
Katello::Candlepin::Consumer.new(myHost.subscription_facet.uuid, myHost.organization.label).entitlement_status
"valid"
3. Reimported Katello::Subscription and Katello::Pools using the below rake script:
#!/bin/bash
echo "Importing Subscription Pools from Candlepin to Katello (what is displayed on the WebUI)."
echo '
namespace :katello do
task :import_subscriptions => ["environment"] do
User.current = User.anonymous_api_admin
puts _("Importing Subscriptions")
Katello::Subscription.import_all
Katello::Pool.import_all
end
end
' | foreman-rake console
This did NOT resolve the issue
4. Checked the subscription_status according to hammer, to rule out any possible issues with the UI code and prove that the Katello API is returning incorrect subscription_status:
$ hammer host list --search "name ~ myhost.example.com and subscription_status = valid"
---|------|------------------|------------|----|-----|--------------|----------------------
ID | NAME | OPERATING SYSTEM | HOST GROUP | IP | MAC | CONTENT VIEW | LIFECYCLE ENVIRONMENT
---|------|------------------|------------|----|-----|--------------|----------------------
$ hammer host list --search "name ~ myhost.example.com and subscription_status != valid"
------|---------------------------|------------------|--------------------|--------------|-------------------|--------------|----------------------
ID | NAME | OPERATING SYSTEM | HOST GROUP | IP | MAC | CONTENT VIEW | LIFECYCLE ENVIRONMENT
------|---------------------------|------------------|--------------------|--------------|-------------------|--------------|----------------------
XXXXX | myhost.example.com | RHEL Server 7.6 | ExampleHostGroup | xx.xx.xx.xx | XX:XX:XX:XX:XX:XX | ExampleContentView | ExampleLifecycleEnvironment
------|---------------------------|------------------|--------------------|--------------|-------------------|--------------|----------------------
Since hammer also returns incorrect data regarding the subscription_status, this proves that the Katello API returns incorrect data (this same test could have been performed with curl)
ADDITIONAL NOTES:
1. This Satellite was previously changed to Simple Content Access mode, then again reverted to Organization Environment Access mode. The issue was noticed after reverting to Organization Environment Access mode.
2. Possibly some incorrect code path is getting traversed at:
https://github.com/Katello/katello/blob/master/app/models/katello/subscription_status.rb#L44-L48
For example, maybe the status_override is taking precedence over Katello::Candlepin::Consumer.new(host.subscription_facet.uuid, host.organization.label).entitlement_status (which returned the valid status, as we checked in step #2 above)
subscription_status of content hosts according to Satellite WebUI is incorrect vs. `subscription-manager status` output of corresponding system. STEPS TAKEN: 1. We validated that the subscription_status reported on the Satellite WebUI was unknown, while `subscription-manager status` (what is reported by Candlepin /rhsm API) output shows valid subscription status 2. Checked the internal Katello subscription_status (which returns "valid") of the content host using the below rake script: #!/bin/bash echo ' myHost = Host.find_by_name("myhost.example.com") Katello::Candlepin::Consumer.new(myHost.subscription_facet.uuid, myHost.organization.label).entitlement_status ' | foreman-rake console Which gives the output: Katello::Candlepin::Consumer.new(myHost.subscription_facet.uuid, myHost.organization.label).entitlement_status "valid" 3. Reimported Katello::Subscription and Katello::Pools using the below rake script: #!/bin/bash echo "Importing Subscription Pools from Candlepin to Katello (what is displayed on the WebUI)." echo ' namespace :katello do task :import_subscriptions => ["environment"] do User.current = User.anonymous_api_admin puts _("Importing Subscriptions") Katello::Subscription.import_all Katello::Pool.import_all end end ' | foreman-rake console This did NOT resolve the issue 4. Checked the subscription_status according to hammer, to rule out any possible issues with the UI code and prove that the Katello API is returning incorrect subscription_status: $ hammer host list --search "name ~ myhost.example.com and subscription_status = valid" ---|------|------------------|------------|----|-----|--------------|---------------------- ID | NAME | OPERATING SYSTEM | HOST GROUP | IP | MAC | CONTENT VIEW | LIFECYCLE ENVIRONMENT ---|------|------------------|------------|----|-----|--------------|---------------------- $ hammer host list --search "name ~ myhost.example.com and subscription_status != valid" ------|---------------------------|------------------|--------------------|--------------|-------------------|--------------|---------------------- ID | NAME | OPERATING SYSTEM | HOST GROUP | IP | MAC | CONTENT VIEW | LIFECYCLE ENVIRONMENT ------|---------------------------|------------------|--------------------|--------------|-------------------|--------------|---------------------- XXXXX | myhost.example.com | RHEL Server 7.6 | ExampleHostGroup | xx.xx.xx.xx | XX:XX:XX:XX:XX:XX | ExampleContentView | ExampleLifecycleEnvironment ------|---------------------------|------------------|--------------------|--------------|-------------------|--------------|---------------------- Since hammer also returns incorrect data regarding the subscription_status, this proves that the Katello API returns incorrect data (this same test could have been performed with curl) ADDITIONAL NOTES: 1. This Satellite was previously changed to Simple Content Access mode, then again reverted to Organization Environment Access mode. The issue was noticed after reverting to Organization Environment Access mode. 2. Possibly some incorrect code path is getting traversed at: https://github.com/Katello/katello/blob/master/app/models/katello/subscription_status.rb#L44-L48 For example, maybe the status_override is taking precedence over Katello::Candlepin::Consumer.new(host.subscription_facet.uuid, host.organization.label).entitlement_status (which returned the valid status, as we checked in step #2 above)