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 2089580 - After syncing a repository, it doesn't sync to the capsule automatically.
Summary: After syncing a repository, it doesn't sync to the capsule automatically.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Repositories
Version: 6.10.5
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.10.7
Assignee: satellite6-bugs
QA Contact: Cole Higgins
URL:
Whiteboard:
: 2098271 2098275 (view as bug list)
Depends On: 2044314
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-05-24 04:26 UTC by Hao Chang Yu
Modified: 2022-12-09 18:06 UTC (History)
10 users (show)

Fixed In Version: tfm-rubygem-katello-4.1.1.60-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2103094 2103096 (view as bug list)
Environment:
Last Closed: 2022-07-06 12:07:13 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Hotfix RPM for Satellite 6.10.6 (9.30 MB, application/x-rpm)
2022-06-02 15:10 UTC, wclark
no flags Details
Updated Hotfix RPM for Satellite 6.10.6 (9.30 MB, application/x-rpm)
2022-06-28 21:09 UTC, wclark
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 34414 0 Normal Closed Post upgrade to 4.1, sync summary email notification shows the incorrect summary for newly added errata. 2022-06-01 22:00:56 UTC
Github /Katello katello pull 9931 0 None None None 2022-05-24 04:27:20 UTC
Red Hat Product Errata RHBA-2022:5516 0 None None None 2022-07-06 12:07:23 UTC

Description Hao Chang Yu 2022-05-24 04:26:04 UTC
Description of problem:
After syncing a repository and some contents have changed, Satellite will trigger an empty Capsule sync task which doesn't sync any repositores.

It appears to be the contents_changed flag not parsing into an action incorrectly. See the code below:

In file "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.1.56/app/lib/actions/katello/repository/sync.rb"
----------------------------------
...
              plan_self(:id => repo.id, :sync_result => output, :skip_metadata_check => skip_metadata_check, :validate_contents => validate_contents,
                        :contents_changed => contents_changed)  <========= This will always be "nil" as it is not getting from the output.
...
...
        def contents_changed
          input['contents_changed'] <=========
        end
-----------------------------------


Checking the upstream code, it appears that this issue has been fixed together with other issue[1] in the pull request below:

https://github.com/Katello/katello/pull/9931/files#diff-558aee5ae708f4471204806fef76de73707e6b4745ab4d348e8075953420d6ccR58


[1] https://projects.theforeman.org/issues/34414

Comment 1 Hao Chang Yu 2022-05-26 09:13:16 UTC
This is fixed in bug #2044314

Comment 6 wclark 2022-06-02 15:10:02 UTC
Created attachment 1886127 [details]
Hotfix RPM for Satellite 6.10.6

HOTFIX RPM is available for Satellite 6.10.3

INSTALL INSTRUCTIONS:

1. Take a complete backup or snapshot of Satellite 6.10.3 server

2. Download the hotfix RPM attached to this BZ and copy it to Satellite server

3. # yum install ./tfm-rubygem-katello-4.1.1.57-2.HOTFIXRHBZ2089580.el7sat.noarch.rpm --disableplugin=foreman-protector

4. # satellite-maintain service restart

Comment 7 wclark 2022-06-02 15:53:17 UTC
CORRECTION: the above comment has inconsistent Satellite versions due to copy & paste error on my part. To clarify, this hotfix is applicable to Satellite 6.10.6 only.

Comment 12 wclark 2022-06-28 21:09:44 UTC
Created attachment 1893266 [details]
Updated Hotfix RPM for Satellite 6.10.6

A new Hotfix RPM is available, which fixes both the Capsule Sync issue described here as well as the Errata Mail issue described in https://bugzilla.redhat.com/show_bug.cgi?id=2044314

INSTALL INSTRUCTIONS:

1. Take a complete backup or snapshot of Satellite 6.10.6 server

2. Download the hotfix RPM attached to this BZ and copy it to Satellite server

3. # yum install ./tfm-rubygem-katello-4.1.1.57-3.HOTFIXRHBZ2089580.el7sat.noarch.rpm --disableplugin=foreman-protector

4. # satellite-maintain service restart

Comment 13 wclark 2022-06-29 14:18:46 UTC
An important note about this bug and hotfix: This bug affects only repositories in the Library environment + Default Organization View. Capsule syncs following CV publish/promote should not be affected by this issue. The intended behavior of 'Optimized' Capsule syncs, for the Library environment + Default Organization View, is that repositories are only synced on Capsules when some change is detected in the repo, as compared to the last time it was synced on Satellite. This Hotfix restores that intended behavior. Some repository syncs on Satellite may however find no changes since the last sync (even though the Capsules are still behind Satellite) and therefore still not trigger the automatic syncs on Capsules even with the Hotfix installed.

To ensure all repositories in the Library + Default Org View are up to date on all Capsules, regardless of whether the most recent syncs on Satellite detect any changes in the repository, use this approach:

1. Install the Hotfix using the steps in the above comment. ( https://bugzilla.redhat.com/show_bug.cgi?id=2089580#c12 ). This will ensure that when repository syncs on Satellite do detect changes, those changes are propagated out to any Capsules with the Library environment assigned.

2. Clear smart proxy sync histories for all root repositories on Satellite with this command:

  # echo "Katello::RootRepository.all.map(&:id).each { |repo_id| Katello::Repository.find(repo_id).clear_smart_proxy_sync_histories }" |foreman-rake console

3. Run 'Optimized' syncs of each Capsule.

Comment 14 Waldirio M Pinheiro 2022-06-29 17:35:17 UTC
*** Bug 2098271 has been marked as a duplicate of this bug. ***

Comment 15 wclark 2022-06-30 19:48:30 UTC
Correction to the above script in comment #13 above. Step 2. (clear smart proxy sync histories) should use this command instead:

  # echo "Katello::Repository.where(content_view_version_id: 1).each(&:clear_smart_proxy_sync_histories)" |foreman-rake console

This will better target all repositories in the "Default Organization View"

Comment 24 errata-xmlrpc 2022-07-06 12:07:13 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 (Satellite 6.10.7 Async Bug Fix Update), 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/RHBA-2022:5516

Comment 25 Amar Ganbat 2022-07-06 17:29:46 UTC
*** Bug 2098275 has been marked as a duplicate of this bug. ***


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