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 2032098 - Incremental publish content view doesn't copy any contents
Summary: Incremental publish content view doesn't copy any contents
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Content Views
Version: 6.10.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: 6.11.0
Assignee: satellite6-bugs
QA Contact: Lai
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-12-14 03:04 UTC by Hao Chang Yu
Modified: 2024-08-21 08:55 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2043719 (view as bug list)
Environment:
Last Closed: 2022-07-05 14:31:01 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 34145 0 Normal New Incremental publish content view doesn't copy any contents 2021-12-14 06:29:28 UTC
Github Katello katello pull 9854 0 None open Fixes #34145 - Errata href not updated 2021-12-14 07:46:58 UTC
Red Hat Knowledge Base (Solution) 6607551 0 None None None 2022-02-12 08:26:26 UTC
Red Hat Product Errata RHSA-2022:5498 0 None None None 2022-07-05 14:31:13 UTC

Description Hao Chang Yu 2021-12-14 03:04:41 UTC
Description of problem:
After publishing an incremental content view, the content count remain the same as previous version. The specified errata are not copy to the latest published version.

This is because Katello database is still storing to the errata with old href which have been deleted by Pulp (delete orphan). When Katello instructs Pulp to copy those errata, nothing will be copy because they are no longer exist in Pulp.

Like any other content in Pulp 3, advisories are immutable. So when there is some change to it, a new one is created, it is then associated to a repository as a part of a new repository version and the old one is unassociated and becomes orphaned.

They are some errata/advisory's fields that Katello doesn't store in its database but Pulp does, such as version, pushcount, fromstr, rights etc. When one of those field changed after syncing the repo, Katello can't notice the change and "index_content" will not update the hrefs.


For example:
# The version of the RHSA-2020:3220 has bumped up to version '2' but other fields, such as updated_date remain unchanged.

pulpcore=# select content_ptr_id,  id, updated_date, issued_date, title, status, fromstr, version, severity, release,rights, pushcount, reboot_suggested from rpm_updaterecord where content_ptr_id in ('10dd841a-c411-41e1-9e3e-9b3021877daa', 'c9404462-9edb-4cef-9632-b59268e673fa');
            content_ptr_id            |       id       |    updated_date     |     issued_date     |                     title                     | status |            fromstr             | version | severity  
| release |           rights           | pushcount | reboot_suggested 
--------------------------------------+----------------+---------------------+---------------------+-----------------------------------------------+--------+--------------------------------+---------+-----------
+---------+----------------------------+-----------+------------------
 10dd841a-c411-41e1-9e3e-9b3021877daa | RHSA-2020:3220 | 2020-07-29 17:19:23 | 2020-07-29 17:19:38 | Important: kernel security and bug fix update | final  | release-engineering | 1       | Important 
| 0       | Copyright 2020 Red Hat Inc | 7         | t
 c9404462-9edb-4cef-9632-b59268e673fa | RHSA-2020:3220 | 2020-07-29 17:19:23 | 2020-07-29 17:19:38 | Important: kernel security and bug fix update | final  | release-engineering | 2       | Important 
| 0       | Copyright 2020 Red Hat Inc | 7         | t
(2 rows)


# However, we can see that Katello is still referring the old href.

irb(main):128:0> pp Katello::RepositoryErratum.find(2888951)
#<Katello::RepositoryErratum:0x000000000da40e40
 id: 2888951,
 erratum_id: 50031,
 repository_id: 1,
 created_at: Wed, 24 Nov 2021 01:48:03 UTC +00:00,
 updated_at: Wed, 24 Nov 2021 01:48:03 UTC +00:00,
 erratum_pulp3_href:
  "/pulp/api/v3/content/rpm/advisories/10dd841a-c411-41e1-9e3e-9b3021877daa/">  <======== The new one should be "c9404462-9edb-4cef-9632-b59268e673fa"


# The repository is a library instance

irb(main):131:0> pp Katello::RepositoryErratum.find(2888951).repository
#<Katello::Repository:0x000000000984d740
 id: 1,
 pulp_id:
  "Default_Organization-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_Linux_7_Server_RPMs_x86_64_7Server",
 library_instance_id: nil,
 content_view_version_id: 1,
 relative_path:
  "Default_Organization/Library/content/dist/rhel/server/7/7Server/x86_64/os",
 environment_id: 1,
 saved_checksum_type: "sha1",
 distribution_version: nil,
 distribution_arch: nil,
 distribution_bootable: nil,
 distribution_family: nil,
 distribution_variant: nil,
 container_repository_name: nil,
 root_id: 1,
 remote_href:
  "/pulp/api/v3/remotes/rpm/rpm/8c9ff859-90a4-4885-ba3f-238fd878eb6a/",
 publication_href:
  "/pulp/api/v3/publications/rpm/rpm/2e694e90-5e43-42c7-9f8f-3f61314115c4/",
 version_href:
  "/pulp/api/v3/repositories/rpm/rpm/4aeedada-9a72-4570-8498-8ffaf1bcbf78/versions/4/",


# As we can see below "/pulp/api/v3/repositories/rpm/rpm/4aeedada-9a72-4570-8498-8ffaf1bcbf78/versions/4/" is associated to RHSA-2020:3220 version '2'.

pulpcore=# select rc.repository_id, rc.content_id, v.pulp_id as version_pulp_id, v.number, v.complete from core_repositorycontent rc left join core_repositoryversion v on v.pulp_id = rc.version_added_id where content_id = 'c9404462-9edb-4cef-9632-b59268e673fa' and rc.repository_id = '4aeedada-9a72-4570-8498-8ffaf1bcbf78';
            repository_id             |              content_id              |           version_pulp_id            | number | complete 
--------------------------------------+--------------------------------------+--------------------------------------+--------+----------
 4aeedada-9a72-4570-8498-8ffaf1bcbf78 | c9404462-9edb-4cef-9632-b59268e673fa | 83c626e6-b5d1-4f2c-be8e-b8f5e0a3acd9 |      4 | t
(1 row)


Index content method should check if the href of a unit has been changed and update it accordingly.


This issue is also affecting other functionality that need to copy content from source to destination repos, such as publishing content view with filter. The task will fail with the following error.

PulpRpmClient::ApiError
...
Response body: ["Could not find the following content units: ['/pulp/api/v3/content/rpm/advisories/297c4432-cc7b-4998-b75b-1a8f85d00dc8/', '/pulp/api/v3/content/rpm/advisories/513e7889-12f3-4598-ada7-4236e0f95d87/', '/pulp/api/v3/content/rpm/advisories/4f525eb5-9659-4a8a-a42f-d6fb00787da7/', '/pulp/api/v3/content/rpm/advisories/ba40ef74-bf92-49bb-aa3f-0ae07d343d9b/']"]

Comment 3 Bryan Kearney 2022-01-11 20:05:01 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/34145 has been resolved.

Comment 4 Lai 2022-04-21 20:47:39 UTC
Steps to retest:

1. sync a few repos with erratas
2. Create a cv and add repos from step 1
3. create a filter that exclude a package
4. publish cv
5. incrementally update the cv with an errata

Expected:
cv should be published with a new version and have the content counts should be updated

Actual:
cv is published with new version and the content counts are updated


Verified on 6.11_17 on rhel7 and rhel8

Comment 8 errata-xmlrpc 2022-07-05 14:31:01 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.