Bug 2224494
| Summary: | The "IPv4 Subnet" field is not showing subnets while selecting the "Domain" in a Hostgroup | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Red Hat Satellite | Reporter: | Sayan Das <saydas> | ||||||
| Component: | Puppet | Assignee: | Leos Stejskal <lstejska> | ||||||
| Status: | CLOSED ERRATA | QA Contact: | sganar | ||||||
| Severity: | medium | Docs Contact: | |||||||
| Priority: | medium | ||||||||
| Version: | 6.14.0 | CC: | aruzicka, lstejska, magaphon, pcreech, rlavi, sganar | ||||||
| Target Milestone: | 6.14.0 | Keywords: | Regression, Reopened, Triaged, UserExperience | ||||||
| Target Release: | Unused | ||||||||
| Hardware: | x86_64 | ||||||||
| OS: | All | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | foreman_puppet-6.0.1 | 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: | |||||||||
| Attachments: |
|
||||||||
Created attachment 1976847 [details]
Showing the BUG in UI
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"] 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. 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. FTR, I can confirm this is easily reproducible when puppet is enabled. 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. 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 Workaround: Select an environment and then the subnet loading works 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 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'))`) 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. 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 |
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