Bug #17815

Getting undefined method `name' for nil:NilClass when trying edit/view a host group

Added by Tomer Brisker over 4 years ago. Updated almost 3 years ago.

Target version:
Bugzilla link:
Fixed in Releases:
Found in Releases:


Cloned from

Description of problem:
When trying to view or edit a host group the following error is seen in the webui:
undefined method `name' for nil:NilClass
The entire traceback can be found here:

How reproducible:
So far, unable to reproduce.

Steps to Reproduce:
1. Attach properties to host group (puppet modules, kickstarts, etc)
2. Remove property being used in host group
3. Attempt to view/edit group

Actual results:
Removing a property being used by a host group renders the group inaccessible

Expected results:
Removing a property in use by the group should simply remove the property from the group and still be able to be edited.

Associated revisions

Revision a3d89422 (diff)
Added by Tomer Brisker over 4 years ago

Fixes #17815 - Prevent HG breaking when os/arch is removed

A hostgroup that has a content view assigned and then has it's os or
architecture removed will break in the UI, including any children
inheriting these attrubutes. This will safely check the related


#1 Updated by Tomer Brisker over 4 years ago

Actual reproducer:
1. Create HG with os, arch and content view and save.
2. Edit same HG and remove the arch and os, save.
3. Reopen the HG - it crashes.

Stack trace: | NoMethodError: undefined method `name' for nil:NilClass | /opt/theforeman/tfm/root/usr/share/gems/gems/katello- `distribution_repositories' | /opt/theforeman/tfm/root/usr/share/gems/gems/katello- `kickstart_repos' | /opt/theforeman/tfm/root/usr/share/gems/gems/katello- `kickstart_repository_options' | /opt/theforeman/tfm/root/usr/share/gems/gems/katello- `kickstart_repository_id' | /opt/theforeman/tfm/root/usr/share/gems/gems/katello- `use_install_media' | /usr/share/foreman/app/views/common/os_selection/_operatingsystem.html.erb:2:in `block in _5e049f3c8b8a59d4b5ba7658ce33472b'

#2 Updated by The Foreman Bot over 4 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Tomer Brisker
  • Pull request added

#3 Updated by Justin Sherrill over 4 years ago

  • Category set to Hosts
  • Legacy Backlogs Release (now unused) set to 188

#4 Updated by Anonymous over 4 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF