Project

General

Profile

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.

Status:
Closed
Priority:
High
Assignee:
Category:
Hosts
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1372917

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: http://pastebin.test.redhat.com/40871

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
parameters.

History

#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-3.0.0.90/app/models/katello/concerns/redhat_extensions.rb:76:in `distribution_repositories' | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.90/app/models/katello/concerns/redhat_extensions.rb:59:in `kickstart_repos' | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.90/app/helpers/katello/hosts_and_hostgroups_helper.rb:190:in `kickstart_repository_options' | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.90/app/helpers/katello/hosts_and_hostgroups_helper.rb:56:in `kickstart_repository_id' | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.90/app/helpers/katello/hosts_and_hostgroups_helper.rb:43:in `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 https://github.com/Katello/katello/pull/6508 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