Bug 2178176

Summary: Satellite showing errata from module streams not installed on client as upgradable/installable when content is imported (not synced)
Product: Red Hat Satellite Reporter: Joniel Pasqualetto <jpasqual>
Component: PulpAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: visawant
Severity: medium Docs Contact:
Priority: high    
Version: 6.12.1CC: ahumbe, bgajjava, bihouse, bvassova, dalley, dkliban, ggainey, hyu, osousa, paji, rchan, rkhadkik, vdeshpan, visawant, wpinheir
Target Milestone: 6.14.0Keywords: PrioBumpGSS, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pulp-rpm-3.18.14, pulp-rpm-3.17.19 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2190513 (view as bug list) Environment:
Last Closed: 2023-11-08 14:18:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Joniel Pasqualetto 2023-03-14 13:12:04 UTC
Description of problem:

After importing repositories containing modular rpms (AppStream, for example), Satellite shows errata applicable to the host even if the module stream is not enabled on the client.

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

Satellite 6.12

How reproducible:
Always

Steps to Reproduce:
1. Import an AppStream repository into Satellite
2. Register a RHEL8 client and install any module stream rpms ("dnf module install ruby:2.5" for example)
3. Look at the errata and you'll see errata targeting other ruby module streams

Actual results:

Will see some errata that are targeted to module streams that are not enabled on the system. 

Expected results:

Only errata targeted to module streams enabled/installed on the client should be listed.


Additional info:

Comment 10 Robin Chan 2023-04-05 13:10:14 UTC
The Pulp upstream bug status is at closed. Updating the external tracker on this bug.

Comment 11 Robin Chan 2023-04-05 13:10:16 UTC
All upstream Pulp bugs are at MODIFIED+. Moving this bug to POST.

Comment 12 Bianca House 2023-05-08 14:25:15 UTC
*** Bug 2150167 has been marked as a duplicate of this bug. ***

Comment 13 Barbora Vassova 2023-06-01 11:59:27 UTC
Hello, is there any workaround for this?

Comment 23 visawant 2023-07-26 13:43:56 UTC
Verified


Version tested:
---------------
Satellite 6.14.0 Snap 8


Steps perform:
--------------
1. Create a custom product/repository syncing content from https://partha.fedorapeople.org/test-repos/pteradactly-with-dino-errata/

2. Set it to download policy immediate, sync, and export it.
~~~
# hammer product create --name custom_prod --organization-id 1
# hammer repository create --name custom_repo --content-type yum --organization-id 1 --product custom_prod --url https://partha.fedorapeople.org/test-repos/pteradactly-with-dino-errata/
# hammer repository update --id=11 --download-policy='immediate'
# hammer product synchronize --name custom_prod --organization-id 1
# hammer content-export complete repository --id 1 --format importable
# rsync -aPz /var/lib/pulp/exports/* root:/var/lib/pulp/imports/
~~~

3. On another Satellite, import the repository
~~~
# hammer content-import repository --path /var/lib/pulp/imports/Default_Organization/Export-custom_repo-11/1.0/2023-07-26T07-15-52-04-00/ --organization="Default Organization"
~~~

4. Register an RHEL8 client to the importing Satellite

5. Go to the web UI and look at the errata available for the client


Expected results:
-----------------
1. Zero installable errata as seen in UI

2. Pulp API returns the packages as expected
~~~
[root@ip-fqdn ~]# su - postgres
Last login: Wed Jul 26 07:42:55 EDT 2023 on pts/0
[postgres@ip-fqdn ~]$ psql pulpcore
psql (12.12)
Type "help" for help.

pulpcore=# select * from rpm_modulemd_packages;
 id |             modulemd_id              |              package_id              
----+--------------------------------------+--------------------------------------
  1 | a7b6a65a-0144-4cfa-a956-78a1cb36b33c | 3d02e711-72b7-4d1a-97e1-04b09323afd9
  2 | 3583030e-8309-4a19-9c55-678813be2bfd | 39c50d17-9d9f-4d72-a504-27ed5c1687d1
  3 | 084e962d-2426-4d3c-ba10-c1655044f0c5 | c63e6177-ccbe-483b-8b4c-2347a76671f8
  5 | 5635777d-ab6f-4f71-8f34-e20d244d686a | 6bdd0d4c-85cd-4100-b231-597af4c2d766
  7 | 79fec3f3-416a-4b1c-84d0-d2c5c406cb6f | 096b342c-b915-4738-8cb0-82f96b7c3599
  9 | a778c025-6963-4b46-8685-719be0924d04 | 56248014-8a87-4d7f-9d1b-f817d163d0c1
 11 | 35dfbbc3-f6a0-4753-98b4-f77f74799405 | 705a0300-b4e3-4e9f-9928-572de382fe0c
 12 | 8618cfb3-a7e3-4c12-a930-bb14808cb270 | adbd6c31-372d-4161-9dfd-bbf47c70dca0
 13 | 975f07d0-9efb-49bb-abd3-57a676025da3 | 8af11a0d-792c-4e3c-971b-584dc8014e68
 14 | d9a28ad1-d8a5-4cbf-9f36-341be8cd11f9 | bd34af06-fbdd-4b03-9c55-b2bc93e9cacf
 15 | 4ccffccd-f948-4c46-b627-bd2e46993811 | dbe6b4f5-9d57-4913-abbe-30bc8d703d0f
(15 rows)

pulpcore=# 
pulpcore=# select count(*) from rpm_modulemd_packages;
 count 
-------
    15
(1 row)

pulpcore=# \q
~~~

3. Foreman rake console returns the query output as expected
~~~
[postgres@ip-fqdn ~]$ su - root
Password: 
Last login: Wed Jul 26 07:48:13 EDT 2023 on pts/0
[root@ip-fqdn ~]# foreman-rake console
Loading production environment (Rails 6.1.7.3)
irb(main):001:0> repo = Katello::Repository.last
=> #<Katello::Repository id: 11, pulp_id: "1-Import-custom_repo-11-Library-9bdae18e-9af9-4d59...", library_instance_id: 9, content_view_version_id: 6, relative_path: "D...
irb(main):002:0> repo_type = repo.repository_type.content_types_to_index.find{|t| t.model_class == Katello::ModuleStream}
=> #<Katello::RepositoryType::ContentType:0x000055db3d160558 @model_class=Katello::ModuleStream(id: integer, name: string, pulp_id: string, version: string, context: st...
irb(main):003:0> indexer = Katello::ContentUnitIndexer.new(content_type: repo_type, repository: repo, optimized: false)
=> #<Katello::ContentUnitIndexer:0x000055db42326518 @content_type=#<Katello::RepositoryType::ContentType:0x000055db3d160558 @model_class=Katello::ModuleStream(id: integ...
irb(main):004:0> pp indexer.units_from_pulp.first.first
{"pulp_href"=>
  "/pulp/api/v3/content/rpm/modulemds/4ccffccd-f948-4c46-b627-bd2e46993811/",
 "pulp_created"=>"2023-07-24T10:30:40.498+00:00",
 "name"=>"walrus",
 "stream"=>"0.71",
 "version"=>"20180707144203",
 "context"=>"c0ffee42",
 "arch"=>"x86_64",
 "artifacts"=>["walrus-0:0.71-1.noarch"],
 "dependencies"=>[],
 "packages"=>
  ["/pulp/api/v3/content/rpm/packages/dbe6b4f5-9d57-4913-abbe-30bc8d703d0f/"],
 "profiles"=>{"default"=>["walrus"], "flipper"=>["walrus"]},
 "description"=>"A module for the walrus 0.71 package"}
=> {"pulp_href"=>"/pulp/api/v3/content/rpm/modulemds/4ccffccd-f948-4c46-b627-bd2e46993811/", "pulp_created"=>"2023-07-24T10:30:40.498+00:00", "name"=>"walrus", "stream"=>"0.71", "version"=>"20180707144203", "context"=>"c0ffee42", "arch"=>"x86_64", "artifacts"=>["walrus-0:0.71-1.noarch"], "dependencies"=>[], "packages"=>["/pulp/api/v3/content/rpm/packages/dbe6b4f5-9d57-4913-abbe-30bc8d703d0f/"], "profiles"=>{"default"=>["walrus"], "flipper"=>["walrus"]}, "description"=>"A module for the walrus 0.71 package"}
irb(main):005:0>
~~~

Comment 27 errata-xmlrpc 2023-11-08 14:18:58 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 (Important: Satellite 6.14 security and 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/RHSA-2023:6818