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 2050100 - Module streams enabled by default are gone when CV starts using filters
Summary: Module streams enabled by default are gone when CV starts using filters
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Content Views
Version: 6.10.2
Hardware: x86_64
OS: Linux
high
urgent
Target Milestone: 6.11.0
Assignee: Ryan Verdile
QA Contact: Danny Synk
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-02-03 09:12 UTC by momran
Modified: 2024-02-08 19:48 UTC (History)
18 users (show)

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


Attachments (Terms of Use)
(unsupported) Sat6.10 patch (3.73 KB, application/mbox)
2022-02-21 11:19 UTC, Pavel Moravec
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 34434 0 Normal Ready For Testing Modulemd-defaults are not present in content view repository metadata 2022-02-14 21:47:53 UTC
Github katello/pull/9937 0 None None None 2022-02-14 21:47:53 UTC
Red Hat Product Errata RHSA-2022:5498 0 None None None 2022-07-05 14:33:04 UTC

Description momran 2022-02-03 09:12:22 UTC
Description of problem:
-----------------------

Module streams are not working as expected in Red Hat Satellite 6.10.2-1. On a RHEL 8 content host registered to Red Hat Satellite 6.10.2-1, module streams that should be enabled by default aren't. User has to enable them manually on the content host. For example by running:
  ~~~
  # yum module enable python36:3.6 ruby:2.5
  ~~~

Otherwise, errors like this one are encountered:
~~~
Execution of '/usr/bin/dnf -d 0 -e 1 -y list python36' returned 1: Error: No matching Packages to list
[...]
change from 'purged' to 'present' failed: Execution of '/usr/bin/dnf -d 0 -e 1 -y install rubygem-foreman_scap_client' returned 1: Error: 
 Problem: package rubygem-foreman_scap_client-0.5.0-1.el8sat.noarch requires ruby(release), but none of the providers can be installed
  - cannot install the best candidate for the job
  - package ruby-libs-2.5.3-104.module+el8.0.0+3250+4b7d6d43.i686 is filtered out by modular filtering
  - package ruby-libs-2.5.5-105.module+el8.1.0+3656+f80bfa1d.i686 is filtered out by modular filtering
  - package ruby-libs-2.7.4-137.module+el8.4.0+12025+f744ca41.x86_64 is filtered out by modular filtering
  - package ruby-libs-2.5.5-106.module+el8.3.0+7153+c6f6daa5.i686 is filtered out by modular filtering
  - package ruby-libs-2.5.5-106.module+el8.3.0+7153+c6f6daa5.x86_64 is filtered out by modular filtering
  - package ruby-libs-2.7.1-133.module+el8.3.0+7192+4e3a532a.i686 is filtered out by modular filtering
  - package ruby-libs-2.5.9-107.module+el8.4.0+10822+fe4fffb1.x86_64 is filtered out by modular filtering
  - package ruby-libs-2.5.3-104.module+el8.0.0+3250+4b7d6d43.x86_64 is filtered out by modular filtering
  - package ruby-libs-2.7.3-136.module+el8.4.0+10728+4c884998.x86_64 is filtered out by modular filtering
  - package ruby-libs-2.6.3-106.module+el8.1.0+3653+beb38eb0.i686 is filtered out by modular filtering
  - package ruby-libs-2.5.9-107.module+el8.4.0+10822+fe4fffb1.i686 is filtered out by modular filtering
  - package ruby-libs-2.6.7-107.module+el8.4.0+10830+bbd85cce.x86_64 is filtered out by modular filtering
  - package ruby-libs-2.7.4-137.module+el8.4.0+12025+f744ca41.i686 is filtered out by modular filtering
  - package ruby-libs-2.7.1-133.module+el8.3.0+7192+4e3a532a.x86_64 is filtered out by modular filtering
  - package ruby-libs-2.6.3-106.module+el8.1.0+3653+beb38eb0.x86_64 is filtered out by modular filtering
  - package ruby-libs-2.5.5-105.module+el8.1.0+3656+f80bfa1d.x86_64 is filtered out by modular filtering
  - package ruby-libs-3.0.2-140.module+el8.5.0+12856+0c654ebc.i686 is filtered out by modular filtering
  - package ruby-libs-2.6.7-107.module+el8.4.0+10830+bbd85cce.i686 is filtered out by modular filtering
  - package ruby-libs-2.5.3-103.module+el8+2671+ebcc7ee0.x86_64 is filtered out by modular filtering
  - package ruby-libs-2.7.3-136.module+el8.4.0+10728+4c884998.i686 is filtered out by modular filtering
  - package ruby-libs-2.5.3-103.module+el8+2671+ebcc7ee0.i686 is filtered out by modular filtering
  - package ruby-libs-3.0.2-140.module+el8.5.0+12856+0c654ebc.x86_64 is filtered out by modular filtering
~~~


How reproducible:
-----------------
Always with CVs that has a filter to include errata by date.


Actual results:
---------------
Module streams, that should be enabled by default on a RHEL 8 content host, are disabled and need to be enabled manually.


Expected results:
-----------------
Module streams, that should be enabled by default on a RHEL 8 content host, are enabled without the need for manual intervention.

Comment 2 Pavel Moravec 2022-02-03 09:47:03 UTC
Usually, information about modules default enabledness is not touched by Satellite at all. Satellite fetches that info from CDN (or other remote source) and copies it to any cloned pulp repo without modification.

The only two possible ways that can alter the content of modulemd-defaults list:
- CV filters that manipulate with modules, *somehow* (but particular reproducer is unknown)
- some unknown bug in pulp2to3 migration, that purges away the info (*probably* from katello root repository already, as that artifact is refered by all other cloned repos, I *think*) - again, no known reproducer, though

Comment 5 Pavel Moravec 2022-02-03 15:53:26 UTC
Reproducer:

1) Sync RHEL8 Appstream repo.
2) Add just that repo to a CV
3) Create the filters per #c3 with errata inclusion date 2022-01-01 (include any older errata)
4) Publish the CV
5) Check(*) the modulemd-defaults presence in modules.yaml metadata - it *will* be present (so far so good)
6) Modify the errata inclusion date to 2021-01-01 and republish the CV
7) A different pulp artifact will be created also for modules.yaml, and this artifact will have *no* modulemd-defaults .


(*) check the pulp artifact directly on the Satellite, via:

sudo -u pulp PULP_SETTINGS='/etc/pulp/settings.py' DJANGO_SETTINGS_MODULE='pulpcore.app.settings' pulpcore-manager shell

from pulp_rpm.app.models.repository import RpmDistribution, RpmPublication
from pulpcore.app.models.repository import RepositoryVersion

for rpmd in RpmDistribution.objects.filter(base_path__contains='<PUT_HERE_CONTENTVIEW_NAME>').all():
  pub = rpmd.publication
  print("%s %s %s %s" % (pub.published_metadata.get(relative_path__contains='modules.yaml').contentartifact_set.first().artifact.file.path, rpmd.base_path, pub.repository_version, pub.repository.rpm_rpmrepository.last_sync_revision_number))


Output will have /var/lib/pulp/media/artifact/8b/3214b6042f02b4c2c2434eb1f18bbafbe44bd76d145b7d746b59a24ac7579c or similar - that is the modules.yaml file :)

Comment 7 Pavel Moravec 2022-02-04 11:20:42 UTC
I can confirm Sat6.9 does behave properly here. The reproducer shows expected list of "modulemd-defaults" in either "filter errata until .." case.

So it is a regression in 6.10.

(re-adding the accidentally deleted keywords)

Comment 8 Jan Senkyrik 2022-02-10 14:26:21 UTC
This is probably related so I am not opening a new BZ (let me know if you want me to):

On Satellite 6.10 no profiles are shown for any module streams:

  - WebUI --> Content --> Module Streams --> $stream --> Profiles tab --> 'No profiles to show'


This applies to *all* module streams. I browsed through them all on Satellite 6.10 and none of them has any profiles:


# for id in $(hammer --username admin --password RedHat1! --no-headers module-stream list | awk {'print $1'}); do hammer --username admin --password RedHat1! module-stream info --id $id | grep Profiles -A 1; done
~~~
Profiles:

Profiles:

Profiles:

Profiles:

Profiles:

Profiles:

...
...
~~~


Same command executed on Satellite 6.9 for reference:

# for id in $(hammer --username admin --password RedHat1! --no-headers module-stream list | awk {'print $1'}); do hammer --username admin --password RedHat1! module-stream info --id $id | grep Profiles -A 1; done
~~~
Profiles:           
 1) ID:   28
Profiles:           
 1) ID:   266
Profiles:           
 1) ID:   256
Profiles:           
 1) ID:   234
Profiles:           
 1) ID:   224
Profiles:           
 1) ID:   220
Profiles:           
 1) ID:   215
Profiles:           
 1) ID:   211
Profiles:           
 1) ID:   209
Profiles:           
 1) ID:   196
...
...
~~~

Comment 11 Pavel Moravec 2022-02-13 10:50:41 UTC
Indeed, copy_contents is the key method.

It is present in 6.9 and being *used* there, successfully.

It is present in 6.10 but the method is *not* used by CV publish, and the publish does not add module_default.

The method is missing in Sat7.0 snap 9 (where module_default is mentioned in incremental CV only) , and I can reproduce the problem there as well.


So the step

tasks << smart_proxy.pulp_api.extensions.send(:module_default).copy(repo.pulp_id, destination_repo.pulp_id)

(in some appropriate variant) must be called.

Comment 13 Pavel Moravec 2022-02-13 11:58:11 UTC
I think we need to adopt

https://github.com/Katello/katello/commit/d6cb33076d4606676086c0159282aaef5022fda9

also to "publish CV with filters" scenario.

Either in finalize phase like that commit, or in copy_content_for_source - I am checking where more appropriate place will be.

Comment 17 Pavel Moravec 2022-02-13 20:48:05 UTC
TL;DR: 

- *any* filter in a CV causes no module streams are enabled by default
- Hao has a perspective patch that works well in all scenarios we tried
- engineering should review the patch (Hao++ to open PR?)

Comment 20 Hao Chang Yu 2022-02-14 08:34:21 UTC
(In reply to Pavel Moravec from comment #17)
> TL;DR: 
> 
> - *any* filter in a CV causes no module streams are enabled by default
> - Hao has a perspective patch that works well in all scenarios we tried
> - engineering should review the patch (Hao++ to open PR?)

Pavel++ Thanks for testing the proposed patch.

Comment 22 Bryan Kearney 2022-02-17 16:06:30 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/34434 has been resolved.

Comment 23 Pavel Moravec 2022-02-21 11:19:39 UTC
Created attachment 1862382 [details]
(unsupported) Sat6.10 patch

Unsupported(!) downstream patch for Sat6.10 based on the upstream fix. To apply it (again: so far unsupported):

cd /opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.1.39
cat /path/to/patch/79755f1b11ca648e1d153aca9ceee46201cfabac.sat610.patch | patch -p1
foreman-maintain service restart --exclude=puppetserver,tomcat,postgresql,foreman-proxy

to revert it back:

cd /opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.1.39
cat /path/to/patch/79755f1b11ca648e1d153aca9ceee46201cfabac.sat610.patch | patch -p1 -R
foreman-maintain service restart --exclude=puppetserver,tomcat,postgresql,foreman-proxy


I have run few tests and expected enabled modules are generated again.

Comment 25 Stephen Wadeley 2022-03-14 20:17:19 UTC
Hello jsenkyri

after consulting with rverdile, comment 8 is a different bug.

Thank you

Comment 26 Stephen Wadeley 2022-03-14 20:52:25 UTC
(In reply to Stephen Wadeley from comment #25)
> Hello jsenkyri
> 
> after consulting with rverdile, comment 8 is a different bug.
> 
Bug 2063999 - No profiles are shown for any module streams

Comment 31 Danny Synk 2022-05-06 20:08:31 UTC
Verified on Satellite 6.11 running on both RHEL 7 and 8 (katello-4.3.0-1).

Steps to Test:
1. Sync the rhel-8-for-x86_64-appstream-rpms repository to Satellite.
2. Generate and download a debug certificate for the organization in which the repo was synced.
3. Import the debug certificate into a web browser.
4. Create a content view containing the RHEL 8 appstream repo and add a content filter with content type 'module stream' and inclusion type 'include.'
5. Add all module streams in the repo to the content filter.
6. Publish a new version of the content view.
7. In the browser, navigate to the repodata directory of the content view (e.g. https://satellite.example.com/pulp/content/Default_Organization/Library/rhel8_module_filter/content/dist/rhel8/8/x86_64/appstream/os/repodata/).
8. Download the modules.yaml file.
9. Check that modulesmd-defaults stanzas are present in the modules.yaml file.
10. Create another content view containing the RHEL 8 appstream repo and add a content filter with content type 'Errata - by date range' and inclusion type 'include.'
11. Configure the content filter to include all errata issued before 1 January 2022.
12. Publish a new version of the content view.
13. In the browser, navigate to the repodata directory of the content view.
14. Download the modules.yaml file.
15. Check that modulesmd-defaults stanzas are present in the modules.yaml file.
16. Change the date range on the content filter to include all errata issued before 1 January 2021.
17. Publish a new version of the content view.
18. Download the modules.yaml repodata file for the content view.
19. Check that modulesmd-defaults stanzas are present in the modules.yaml file.
20. Enable the 'solve dependencies' option on the content view with the module stream content filter, then repeat steps 6-9.
21. Enable the 'solve dependencies' option on the content view with the errata date range content filter, then repeat steps 11-19.

Expected Results:
modulemd-defaults stanzas are present in the modules.yaml repodata file for all content view versions.

Actual Results:
modulemd-defaults stanzas are present in the modules.yaml repodata file for all content view versions.

Comment 34 errata-xmlrpc 2022-07-05 14:32:45 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.