This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
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 2277133 - Kickstart Repository association is not deleted from a host when it is unregistered from satellite.
Summary: Kickstart Repository association is not deleted from a host when it is unregi...
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hosts - Content
Version: 6.14.3
Hardware: All
OS: All
unspecified
medium
Target Milestone: Unspecified
Assignee: Ian Ballou
QA Contact: Satellite QE Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-04-25 12:00 UTC by Sayan Das
Modified: 2024-06-06 17:29 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2024-06-06 17:29:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 37518 0 Normal New Kickstart Repository association is not deleted from a host when it is unregistered 2024-05-29 21:01:58 UTC
Red Hat Issue Tracker   SAT-24787 0 None Migrated None 2024-06-06 17:29:33 UTC

Description Sayan Das 2024-04-25 12:00:26 UTC
Description of problem:

Continuing from https://bugzilla.redhat.com/show_bug.cgi?id=2277130 , If we look at the unregistered host from UI as well as the database, It will still have a Kickstart repository ID associated. 

Now, due to the lack of CV and LCE associations, When someone tries to directly just rebuild that stale entry, The kickstart template will be generated just with the BaseOS kickstart repo and will miss the Appstream repo, leading to failures during provisioning process. 


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

Red Hat Satellite 6.14.3 [ with https://github.com/Katello/katello/pull/10797/files applied ]

Red Hat Satellite 6.15.0 


How reproducible:

Always


Steps to Reproduce:

Exact same as https://bugzilla.redhat.com/show_bug.cgi?id=2277130


Actual results:

Same as https://bugzilla.redhat.com/show_bug.cgi?id=2277130

Additionally, if we look at the content_facet of the host, It will still have kickstart repository ID associated. 

Before:

irb(main):022:0> pp h.content_facet
#<Katello::Host::ContentFacet:0x000055d6e788d920
 id: 21,
 host_id: 28,
 uuid: "8d81043f-a295-4ba3-8ed1-37e1b50b20ea",
 kickstart_repository_id: 278,
 content_source_id: 1,
 installable_security_errata_count: 0,
 installable_enhancement_errata_count: 0,
 installable_bugfix_errata_count: 0,
 applicable_rpm_count: 16,
 upgradable_rpm_count: 0,
 applicable_module_stream_count: 0,
 upgradable_module_stream_count: 0,
 applicable_deb_count: 0,
 upgradable_deb_count: 0>

After:

irb(main):004:0> pp h.content_facet
#<Katello::Host::ContentFacet:0x0000559762f3e900
 id: 21,
 host_id: 28,
 uuid: nil,
 kickstart_repository_id: 278,
 content_source_id: 1,
 installable_security_errata_count: 0,
 installable_enhancement_errata_count: 0,
 installable_bugfix_errata_count: 0,
 applicable_rpm_count: 16,
 upgradable_rpm_count: 0,
 applicable_module_stream_count: 0,
 upgradable_module_stream_count: 0,
 applicable_deb_count: 0,
 upgradable_deb_count: 0>

The same would be visible in UI , when editing the host.

If we put the Host in Build mode, satellite allows doing so and just with the BaseOS kickstart repo URL which eventually leads to failed kickstart deployment, due to missing packages [ i.e. missing appstream kickstart repo ].


Expected results:

When registering a host, The kickstart_repository association should be removed from the host as well. 

So that when a user mistakenly tries to rebuild the host, It would show some sort of error with template rendering thus forcing the user to edit the host and select all relevant values and the save them, before retrying the build action. 


Additional info:

If i combine https://github.com/Katello/katello/pull/10797/files with host.content_facet.kickstart_repository = nil i.e. 

# git diff
diff --git a/app/services/katello/registration_manager.rb b/app/services/katello/registration_manager.rb
index e3add5b..9f93757 100644
--- a/app/services/katello/registration_manager.rb
+++ b/app/services/katello/registration_manager.rb
@@ -316,6 +316,8 @@ module Katello
           host.content_facet.applicable_errata = []
           host.content_facet.uuid = nil
           host.content_facet.content_view_environments = []
+          host.content_facet.content_source = ::SmartProxy.pulp_primary
+          host.content_facet.kickstart_repository = nil
           host.content_facet.save!
           Rails.logger.debug "remove_host_artifacts: marking CVEs unchanged to prevent backend update"
           host.content_facet.mark_cves_unchanged


It does the job at database level and also does not allow putting the host in build mode. 

But if I edit the host, And go to OS tab, I can still see the repository there. So I guess some additional UI level fix would be needed to maintain consistency.

Please check the support case 03796000 and the discussion on the same for additional information

Comment 2 Ian Ballou 2024-05-29 21:01:56 UTC
Created redmine issue https://projects.theforeman.org/issues/37518 from this bug

Comment 3 Eric Helms 2024-06-05 20:03:01 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/37518 has been resolved.

Comment 4 Eric Helms 2024-06-06 17:29:35 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "SAT-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.


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