Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
Description of problem:
When opening 4 child hostgroups (sharing the same parent) from the GUI , an error occurs :
undefined method `name' for nil:NilClass
2022-03-24T15:05:47 [I|app|2b5772f9] Backtrace for 'undefined method `name' for nil:NilClass' error (ActionView::Template::Error): undefined method `name' for nil:NilClass
2b5772f9 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_ansible-6.3.4.1/app/helpers/foreman_ansible/ansible_roles_helper.rb:58:in `block in model_roles_attrs'
2b5772f9 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_ansible-6.3.4.1/app/helpers/foreman_ansible/ansible_roles_helper.rb:58:in `map'
2b5772f9 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_ansible-6.3.4.1/app/helpers/foreman_ansible/ansible_roles_helper.rb:58:in `model_roles_attrs'
2b5772f9 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_ansible-6.3.4.1/app/helpers/foreman_ansible/ansible_roles_helper.rb:47:in `role_attributes_for_roles_switcher'
Version-Release number of selected component (if applicable):
satellite 6.10.3
How reproducible:
Could be reproduced.
Steps to Reproduce:
1. Navigating to hostgroup page on the satellite
Actual results:
Error undefined method `name' for nil:NilClass
Expected results:
Viewing/editing hostgroup
Additional info:
- The issue is only with 4 hostgroups sharing the same parent.
- New hostgroups with the same parent work without issue.
- The issue started after upgrading from 6.9.8 to 6.10.3
- Removing current assigned Ansible roles to the hostgroup using hammer did not fix the issue.
- The full trace of the error will be on the first comment.
(In reply to Brad Buckingham from comment #2)
> Does the same error occur if viewing the child hostgroup from hammer?
No, from hammer , the hostgroup can be viewed and edited without issues.
Reproducer: add an ansible role to a HostGroup while removing the same ansible role. Then editing the HG fails with above backtrace.
Detailed reproducer in WebUI:
- Edit a HostGroup and navigate to Ansible Roles pane
- Add an Ansible Role from the Available Roles - do NOT click to Submit button yet!
- Meanwhile, open Ansible Roles page and delete the role you are about to add to the HG
- Now, Submit the HG change
- Edit the same HG
It seems we need to validate list of ansible role IDs at the time of submitting a HostGroup change?
Hi,
I'm closing the BZ as won't fix. After triaging the BZ with the team we agreed that there is no point in creating a
generic BZ, as this problem is across the whole application and there are no planned efforts to fix the issue.
Comment 14Red Hat Bugzilla
2024-01-25 04:25:19 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days