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.
Bug 1979092 - Capsule cname is reported as opposed to hostname
Summary: Capsule cname is reported as opposed to hostname
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: RH Cloud - Inventory
Version: 6.9.3
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: 6.11.0
Assignee: Shimon Shtein
QA Contact: Lukáš Hellebrandt
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-07-04 21:09 UTC by Taft Sanders
Modified: 2023-05-19 10:04 UTC (History)
6 users (show)

Fixed In Version: foreman_rh_cloud_5.0.32
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-07-05 14:29:32 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github theforeman foreman_rh_cloud pull 696 0 None Merged BZ #1979092 - Use infrastructure facet to determine foreman host 2022-03-31 16:37:05 UTC
Red Hat Issue Tracker TFMRHCLOUD-285 0 None None None 2021-11-11 12:30:51 UTC
Red Hat Product Errata RHSA-2022:5498 0 None None None 2022-07-05 14:29:45 UTC

Description Taft Sanders 2021-07-04 21:09:29 UTC
Description of problem:
When Satellite is known as a different name the notification feature from the task 'InsightsFullSync' looks for the Capsules name as 'SmartProxy.default_capsule.name'. If the cname and FQDN are different this will throw issues with finding the server.

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

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:
# foreman-rake console
Loading production environment (Rails 6.0.3.4)
irb(main):001:0> ENV['SATELLITE_RH_CLOUD_FOREMAN_HOST']
=> nil
irb(main):002:0> ::SmartProxy.default_capsule.name
=> "satellite.example.com"
irb(main):003:0> ::Host.unscoped.friendly.find(ENV['SATELLITE_RH_CLOUD_FOREMAN_HOST'] || ::SmartProxy.default_capsule.name)
Traceback (most recent call last):
        2: from lib/tasks/console.rake:5:in `block in <top (required)>'
        1: from (irb):3
ActiveRecord::RecordNotFound (can't find record with friendly id: "satellite.example.com")
irb(main):004:0> ::Host.unscoped.friendly.find("satellite.example.com")
Traceback (most recent call last):
        2: from lib/tasks/console.rake:5:in `block in <top (required)>'
        1: from (irb):4
ActiveRecord::RecordNotFound (can't find record with friendly id: "satellite.example.com")
irb(main):005:0> ::Host.unscoped.friendly.find("real.satellite.com")
=> #<Host::Managed id: 1, name: "real.satellite.com", last_compile: "2021-07-03 09:14:49", last_report: [FILTERED], updated_at: "2021-07-03 09:14:59", created_at: "2017-11-15 11:20:44", root_pass: [FILTERED], architecture_id: 1, operatingsystem_id: 13, environment_id: 2, ptable_id: 371, medium_id: nil, build: false, comment: "Satellite", disk: "", installed_at: nil, model_id: 1, hostgroup_id: 1260, owner_id: 3, owner_type: "User", enabled: true, puppet_ca_proxy_id: 1, managed: true, use_image: nil, image_file: nil, uuid: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", compute_resource_id: 2, puppet_proxy_id: 1, certname: "real.satellite.com", image_id: nil, organization_id: 1, location_id: 2, type: "Host::Managed", otp: nil, realm_id: nil, compute_profile_id: nil, provision_method: nil, grub_pass: "XXXXXXXX", global_status: 0, lookup_value_matcher: [FILTERED], discovery_rule_id: nil, openscap_proxy_id: 1, pxe_loader: "PXELinux BIOS", initiated_at: nil, build_errors: nil>

Expected results:


Additional info:
To workaround this bug, you need to change the internal Capsule name back to "real.satellite.com"

Steps:
1) Web UI -> Infrastructure -> Capsule -> Click Edit the internal Capsule -> Set the name to "real.satellite.com"

2) Restart the Satellite so the change can take effect in Dynflow

foreman-maintain service restart

3) After that try manually trigger the InsightFullSync task

Web UI -> Configure -> Insights -> Click Start Recommendation Sync.

4) Check it the ask can finish successfully.

Comment 2 Eric Helms 2021-07-20 14:47:06 UTC
The real solution to this is a feature being discussed in the upstream and looked at for the Satellite 7.0 release. The details and discussion can be found at: https://community.theforeman.org/t/infrastructure-roles/22001

Comment 3 Shimon Shtein 2022-03-07 14:45:21 UTC
I'll move to post once plugin version would be available

Comment 5 Lukáš Hellebrandt 2022-05-24 15:15:14 UTC
Verified with Sat 6.11 snap 20.0.

1) Created a Sat, imported manifest, registered host
2) Created some issue on the host that CRC would show as Advisory, in my case: SMBLoris (added `max smbd processes = 0` to /etc/samba/smb.conf global section)
3) Waited for the Advisory to show in CRC
4) Configure -> Insights -> ... -> Sync recommendations
5) Go to the task 4) created => It succeeded and the Advisories are now shown in Configure -> Insights
6) Infrastructure -> Capsules -> Edit the internal capsule
7) There are fields Name and URL, changed Name to `renamed-capsule.wrong.fqdn.com`
8) Repeated 4) and 5)
9) `foreman-maintain service restart`
1) Repeated 4) and 5)

Comment 8 errata-xmlrpc 2022-07-05 14:29:32 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 (Moderate: Satellite 6.11 Release), 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-2022:5498


Note You need to log in before you can comment on or make changes to this bug.