Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-24787

Kickstart Repository association is not deleted from a host when it is unregistered from satellite.

    • None
    • None
    • None
    • To Do
    • No

      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.

      1. 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

            [SAT-24787] Kickstart Repository association is not deleted from a host when it is unregistered from satellite.

            Errata Tool added a comment -

            Since the problem described in this issue should be resolved in a recent advisory, it has been closed.

            For information on the advisory (Critical: Satellite 6.16.0 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-2024:8906

            Errata Tool added a comment - Since the problem described in this issue should be resolved in a recent advisory, it has been closed. For information on the advisory (Critical: Satellite 6.16.0 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-2024:8906

            Eric Helms added a comment -

            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@redhat.com. You can also visit https://access.redhat.com/articles/7032570 for general account information.

            Eric Helms added a comment - 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@redhat.com. You can also visit https://access.redhat.com/articles/7032570 for general account information.

            Eric Helms added a comment -

            Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/37518 has been resolved.

            Eric Helms added a comment - Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/37518 has been resolved.

            Ian Ballou added a comment -

            Created redmine issue https://projects.theforeman.org/issues/37518 from this bug

            Ian Ballou added a comment - Created redmine issue https://projects.theforeman.org/issues/37518 from this bug

              iballou@redhat.com Ian Ballou
              rhn-support-saydas Sayan Das
              Vijaykumar Sawant
              Vijaykumar Sawant Vijaykumar Sawant
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 days
                  2d