Bug 1254102 - Discovery rules page "undefined method `name' for nil:NilClass" in case hostgroup was deleted
Discovery rules page "undefined method `name' for nil:NilClass" in case hostg...
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Discovery Plugin (Show other bugs)
Unspecified Unspecified
high Severity high (vote)
: Beta
: --
Assigned To: Lukas Zapletal
Stephen Benjamin
: Triaged
Depends On:
Blocks: 1338516
  Show dependency treegraph
Reported: 2015-08-17 03:42 EDT by Alexander Braverman
Modified: 2017-09-08 08:29 EDT (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-07-27 05:17:52 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Foreman debug (10.90 MB, application/x-xz)
2015-08-17 03:42 EDT, Alexander Braverman
no flags Details

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 2050343 None None None Never

  None (edit)
Description Alexander Braverman 2015-08-17 03:42:19 EDT
Created attachment 1063664 [details]
Foreman debug

Description of problem:
Opening 'Discovery Rules' page results with an error:
undefined method `name' for nil:NilClass

Version-Release number of selected component (if applicable):

How reproducible:
Open 'Discovery Rules'

Steps to Reproduce:

Actual results:

Expected results:

Additional info:
Satellite was upgraded from 6.1.0 to 6.1.1
Comment 2 Shlomi Zadok 2015-08-17 07:53:40 EDT
Upstream seems to solve this issue at https://github.com/theforeman/foreman_discovery/blob/develop/app/views/discovery_rules/index.html.erb#L19
Can this be cherry-picked?
Comment 3 Lukas Zapletal 2015-08-17 07:56:22 EDT
Which commit sha is that? Can you please prepare cherry pick request for that?
Comment 5 Sachin Ghai 2015-08-17 08:21:07 EDT
Reproduced. If we delete Hostgroup after associating it to Discovery Rule.
Comment 8 Lukas Zapletal 2015-08-26 09:11:48 EDT
The above commit only masks the fact a rule does not have a hostgroup.
Comment 9 Lukas Zapletal 2015-08-26 09:17:54 EDT
Upstream patch done: https://github.com/theforeman/foreman_discovery/pull/212

Cherry pick the UI patch as well ^^^
Comment 15 Bryan Kearney 2016-01-04 16:34:51 EST
Upstream bug assigned to lzap@redhat.com
Comment 16 Bryan Kearney 2016-02-16 04:09:12 EST
Moving to POST since upstream bug http://projects.theforeman.org/issues/11574 has been closed
Applied in changeset commit:foreman_discovery|82d93bfb7748482ca32ab293d8c0b47c38c4c018.
Comment 18 Stephen Benjamin 2016-03-24 13:01:18 EDT
Created hostgroup Foo, with discovery rule Bar.  Tried to delete hostgroup Foo, it's no longer possible: "Cannot delete record because dependent discovery rules exist"
Comment 21 errata-xmlrpc 2016-07-27 05:17:52 EDT
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, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


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