Bug 2224498

Summary: "Synced Media" selection is not happening even after selecting the Right CV\LCE\ContentSource\Arch\OS in Hosts or Hostgroups
Product: Red Hat Satellite Reporter: Sayan Das <saydas>
Component: PuppetAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Partha Aji <paji>
Severity: urgent Docs Contact:
Priority: high    
Version: 6.14.0CC: gtalreja, iballou, jlenz, paji, rlavi
Target Milestone: 6.14.0Keywords: Regression, Triaged, UserExperience
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-11-08 14:20:07 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 Sayan Das 2023-07-21 07:10:49 UTC
Description of problem:

When creating a Host or Hostgroup, Even if I select the right Content Source\CV\LCE in the first page of the Form and then select the expected Arch and OS in the Operating System page , The media option remains grayed out.

This is happening when my LCE+CV combination has the kickstart repos included as expected. 

This is a regression behavior from 6.13\6.12.


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

satellite-6.14.0-3.el8sat.noarch
foreman-3.7.0.2-1.el8sat.noarch
katello-4.9.0-1.el8sat.noarch

How reproducible:

100%

Steps to Reproduce:
1. Create a Satellite 6.14
2. Sync RHEL 8.8 BaseOS and Kickstart repos as well as RPMs repos and Create+Publish a CV called "RHEL8" with them.
3. Sync RHEL 9.2 BaseOS and kickstart repos as well as RPMs repos and Create+Publish a CV called "RHEL9" with them.
4. Try creating a Hostgroup and as a part of that, Select Content Source, Lifecycle, CV, then switch to Operating Systems tab and then select Architecture and the OS name ( according to the CV selected ).

5. Try creating a Host and as a part of that, Select Content Source, Lifecycle, CV, then switch to Operating Systems tab and then select Architecture and the OS name ( according to the CV selected ).

Actual results:

For both Step 4 and 5, In the Operating Systems tab, The Synced Media or All Media options are grayed out.


Expected results:

It should automatically show the right Synced Media. 

Additional info:

NOTE: 
* The issue is not related to CV but for Default Org View as well.
* Assume, We selected The following at first i.e. 

CV = RHEL8
LCE=Library
Content Source=satellite614.lab.example.com
Arch=x86_64
OS=RedHat 8.8

Now, After Step 4 or 5 , on the same form, If we switch back the CV to Default Organization View and then back to RHEL8 and then if we go to Operating Systems tab again, Now Synced Media appears there. 

If we switch to another CV RHEL9 and select the OS as RedHat 9.2, The old Synced Media selection remains the same and does not changes to the 9.2 kickstart.

Comment 1 Sayan Das 2023-07-21 07:11:55 UTC
I did not know what component I can select as the issue is with both Host and HOstgroup forms. 

Hence selected the Hosts Form component. Please move the BZ to right component if it's not the right one.

Comment 2 Sayan Das 2023-07-21 07:58:35 UTC
I also noticed this message popping up very frequently when I was exercising the steps mentioned and it makes no sense at all.

2023-07-21T12:56:26 [I|app|d4c5066c] Hostgroup has content view and lifecycle environment assigned; using those

Comment 12 Sayan Das 2023-08-08 16:07:24 UTC
I managed to find the source of the issue. 

I started debugging the problem in Developer console of chrome and that's where I found this error when I was trying to reproduce this BZ or the other BZ https://bugzilla.redhat.com/show_bug.cgi?id=2224494


Uncaught TypeError: Cannot read properties of undefined (reading 'match')
    at t.reloadPuppetclassParams (foreman_puppet:global-0dcaccdafc99814ce1ea.js:1:23871)
    at HTMLSelectElement.<anonymous> (foreman_puppet:global-0dcaccdafc99814ce1ea.js:1:2679)
    at HTMLDocument.dispatch (jquery.js:4737:27)
    at g.handle (jquery.js:4549:28)
    at Object.trigger (jquery.js:7807:12)
    at HTMLSelectElement.<anonymous> (jquery.js:7875:17)
    at Function.each (jquery.js:365:19)
    at _.fn.init.each (jquery.js:137:17)
    at _.fn.init.trigger (jquery.js:7874:15)
    at r.triggerChange (select2.js:1168:31)
t.reloadPuppetclassParams @ foreman_puppet:global-0dcaccdafc99814ce1ea.js:1
(anonymous) @ foreman_puppet:global-0dcaccdafc99814ce1ea.js:1
dispatch @ jquery.js:4737
g.handle @ jquery.js:4549
trigger @ jquery.js:7807
(anonymous) @ jquery.js:7875
each @ jquery.js:365
each @ jquery.js:137
trigger @ jquery.js:7874
triggerChange @ select2.js:1168
onSelect @ select2.js:2465
selectHighlighted @ select2.js:1870
(anonymous) @ select2.js:807
(anonymous) @ select2.js:681
dispatch @ jquery.js:4737
g.handle @ jquery.js:4549


And that first line pointed to  https://satellite614.lab.example.com/webpack/foreman_puppet/foreman_puppet:global-0dcaccdafc99814ce1ea.js 


A quick look tells me it was related to foreman_puppet and Yes, my affected satellite had the puppet-related features enabled. This also makes sense as on every new install where i later tested these two bugs, They were not having puppet enabled at all.

As soon as I disabled puppet using "satellite-maintain plugin purge-puppet" , the issue got resolved in my affected satellite 6.14.

This means the foreman_puppet plugin is causing some issues here for both this BZ and  BZ https://bugzilla.redhat.com/show_bug.cgi?id=2224494


Should this also be moved to Puppet component ?



-- Sayan

Comment 19 errata-xmlrpc 2023-11-08 14:20:07 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