Bug 2050100
Summary: | Module streams enabled by default are gone when CV starts using filters | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Satellite | Reporter: | momran | ||||
Component: | Content Views | Assignee: | Ryan Verdile <rverdile> | ||||
Status: | CLOSED ERRATA | QA Contact: | Danny Synk <dsynk> | ||||
Severity: | urgent | Docs Contact: | |||||
Priority: | high | ||||||
Version: | 6.10.2 | CC: | ahumbe, casl, dsynk, ehelms, hyu, jkrajice, jpasqual, jsenkyri, jsherril, momran, onerleka, pcreech, pdwyer, phess, pmoravec, rverdile, sbible, swadeley | ||||
Target Milestone: | 6.11.0 | Keywords: | Regression, Triaged | ||||
Target Release: | Unused | ||||||
Hardware: | x86_64 | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | If docs needed, set a value | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | |||||||
: | 2059371 (view as bug list) | Environment: | |||||
Last Closed: | 2022-07-05 14:32:45 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: | |||||||
Attachments: |
|
Description
momran
2022-02-03 09:12:22 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 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 :) 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) 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 ... ... ~~~ 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. 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. 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?) (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. Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/34434 has been resolved. 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.
Hello jsenkyri after consulting with rverdile, comment 8 is a different bug. Thank you (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 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. 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 |