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 2224494 - The "IPv4 Subnet" field is not showing subnets while selecting the "Domain" in a Hostgroup
Summary: The "IPv4 Subnet" field is not showing subnets while selecting the "Domain" i...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Puppet
Version: 6.14.0
Hardware: x86_64
OS: All
medium
medium
Target Milestone: 6.14.0
Assignee: Leos Stejskal
QA Contact: sganar
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-07-21 06:50 UTC by Sayan Das
Modified: 2023-11-08 14:20 UTC (History)
6 users (show)

Fixed In Version: foreman_puppet-6.0.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-11-08 14:20:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
showing that domain is selected in the subnets (51.80 KB, image/png)
2023-07-21 06:50 UTC, Sayan Das
no flags Details
Showing the BUG in UI (33.08 KB, image/png)
2023-07-21 06:50 UTC, Sayan Das
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github theforeman foreman_puppet pull 367 0 None open Update @theforeman npm packages 2023-08-10 11:32:52 UTC
Red Hat Issue Tracker SAT-19114 0 None None None 2023-07-24 12:29:56 UTC
Red Hat Product Errata RHSA-2023:6818 0 None None None 2023-11-08 14:20:21 UTC

Description Sayan Das 2023-07-21 06:50:27 UTC
Created attachment 1976846 [details]
showing that domain is selected in the subnets

Description of problem:

When I am creating an Hostgroup, I can select the Domain but the associated subnets are not showing selectable in the "IPv4 Subnet" field. 

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. Build a Satellite 6.14.0
2. Create a domain
3. Create a ipv4 subnet and associate the domain with the subnet
4. From WebUI, Try creating a hostgroup and select the "Domain" in Networks tab. 


Actual results:

Domain is selected but "IPv4 Subnet" field keeps on showing "No Subnets".

( screenshots attached to showcase the issue )

Expected results:

Subnets should be listed for selection if they are properly associated with the Domain


Additional info:

This is a Regression from 6.13\6.12

Comment 1 Sayan Das 2023-07-21 06:50:59 UTC
Created attachment 1976847 [details]
Showing the BUG in UI

Comment 2 Sayan Das 2023-07-21 06:53:40 UTC
Before anyone asks, This is how the domain and subnets were created\updated:

# hammer domain update --name lab.example.com --dns satellite614.lab.example.com

# hammer subnet create --name satellite-subnet-dhcp       --description satellite-subnet --network 192.168.125.0 --mask 255.255.255.0       --gateway 192.168.125.1 --dns-primary 192.168.125.5 --dns-secondary 192.168.125.1       --ipam DHCP --from 192.168.125.130 --to 192.168.125.150 --boot-mode DHCP       --domains lab.example.com --dhcp-id 1 --dns-id 1 --tftp-id 1 --remote-execution-proxy-ids 1 --discovery-id 1        --locations GSS --organizations RedHat

# hammer subnet create --name satellite-subnet-static       --description satellite-subnet --network 192.168.125.0 --mask 255.255.255.0       --gateway 192.168.125.1 --dns-primary 192.168.125.5 --dns-secondary 192.168.125.1       --ipam None --boot-mode Static       --domains lab.example.com --dns-id 1 --tftp-id 1 --remote-execution-proxy-ids 1 --discovery-id 1        --locations GSS --organizations RedHat


From rake console:

irb(main):003:0> Domain.first.name
=> "lab.example.com"

irb(main):004:0> Domain.first.subnets.pluck(:name)
=> ["satellite-subnet-static", "satellite-subnet-dhcp"]

Comment 7 Sayan Das 2023-08-08 13:41:27 UTC
This issue can no longer be reproduced on any new installation of Sat 6.14 snaps. If we restore the backup of non-working satellite to a new satellite, even then also, the issue is not reproducible. 

Based on that, I am closing this BZ as NOTABUG for now and will rebuild the affected satellite. 

If I can by anychance reproduce it in a new instance in the future, I will reopen it.

Comment 8 Sayan Das 2023-08-08 16:04:54 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 Katello BZ https://bugzilla.redhat.com/show_bug.cgi?id=2224498 


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 the Katello BZ and this BZ.

Comment 9 Adam Ruzicka 2023-08-09 11:13:11 UTC
FTR, I can confirm this is easily reproducible when puppet is enabled.

Comment 10 Leos Stejskal 2023-08-10 06:29:41 UTC
The issue is not reproducible on the DEV setup,
so I have a suspicion that it's related to new changes in JS translation files and the compilation of the assets.

Comment 11 Leos Stejskal 2023-08-10 10:54:04 UTC
Hi Maria,
I'll need help here.
The issue is not reproducible in the DEV environment, even with compiled assets,
the problem must happen somewhere during the compilation

Steps to reproduce:
1. Build a Satellite stream with a puppet foreman (see below how to enable puppet)
2. Create a domain
3. Create an ipv4 subnet and associate the domain with the subnet
4. From WebUI, Try creating a host group and select the "Domain" in the Networks tab. 

Subnets should be listed for selection if they are properly associated with the Domain.
But they are not.

I updated npm dependencies [0] but not sure if it's going to solve the issue.


How to install puppet:
satellite-installer --enable-foreman-plugin-puppet \
--enable-foreman-cli-puppet \
--foreman-proxy-puppet true \
--foreman-proxy-puppetca true \
--enable-puppet \
--puppet-server true

[0] https://github.com/theforeman/foreman_puppet/pull/367/files

Comment 12 Leos Stejskal 2023-08-10 11:17:09 UTC
Workaround: Select an environment and then the subnet loading works

Comment 13 Leos Stejskal 2023-08-10 11:32:52 UTC
Huh, to my pleasant surprise this PR [0] is actually fixing it,
deployed the packit RPM and it works!

[0] https://github.com/theforeman/foreman_puppet/pull/367

Comment 14 Maria 2023-08-10 11:43:02 UTC
The pr that solves it is: https://github.com/theforeman/foreman_puppet/pull/358 for me
the error I get when reproducing this is: Cannot read properties of undefined (reading 'match') (`if (url.match('hostgroups'))`)

Comment 15 sganar 2023-08-17 15:43:55 UTC
Verified.

Tested on Satellite 6.14.0 Snap 12.0
rubygem-foreman_puppet-6.0.1-1.el8sat.noarch

Steps followed: 
1. Enable puppet on Satellite(6.14 snap 12)
2. Create a domain
3. Create an ipv4 subnet and associate the domain with the subnet
From WebUI, Try creating a hostgroup and select the "Domain" in the Networks tab. 


Observation: 
Subnets are properly listed when they are properly associated with the selected Domain.

Comment 18 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


Note You need to log in before you can comment on or make changes to this bug.