Bug 1254102 - Discovery rules page "undefined method `name' for nil:NilClass" in case hostgroup was deleted
Summary: Discovery rules page "undefined method `name' for nil:NilClass" in case hostg...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Discovery Plugin
Version: 6.1.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: Unspecified
Assignee: Lukas Zapletal
QA Contact: Stephen Benjamin
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks: 1338516
TreeView+ depends on / blocked
 
Reported: 2015-08-17 07:42 UTC by Alexander Braverman
Modified: 2019-12-16 04:52 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-27 09:17:52 UTC
Target Upstream Version:
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 2050343 0 None None None Never
Red Hat Product Errata RHBA-2016:1501 0 normal SHIPPED_LIVE Red Hat Satellite 6.2 Capsule and Server 2016-07-27 12:28:58 UTC

Description Alexander Braverman 2015-08-17 07:42:19 UTC
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):
6.1.1

How reproducible:
Open 'Discovery Rules'

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:
Satellite was upgraded from 6.1.0 to 6.1.1

Comment 2 Shlomi Zadok 2015-08-17 11:53:40 UTC
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 11:56:22 UTC
Which commit sha is that? Can you please prepare cherry pick request for that?

Comment 5 Sachin Ghai 2015-08-17 12:21:07 UTC
Reproduced. If we delete Hostgroup after associating it to Discovery Rule.

Comment 8 Lukas Zapletal 2015-08-26 13:11:48 UTC
The above commit only masks the fact a rule does not have a hostgroup.

Comment 9 Lukas Zapletal 2015-08-26 13:17:54 UTC
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 21:34:51 UTC
Upstream bug assigned to lzap

Comment 16 Bryan Kearney 2016-02-16 09:09:12 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/11574 has been closed
-------------
Anonymous
Applied in changeset commit:foreman_discovery|82d93bfb7748482ca32ab293d8c0b47c38c4c018.

Comment 18 Stephen Benjamin 2016-03-24 17:01:18 UTC
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 09:17:52 UTC
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.

https://access.redhat.com/errata/RHBA-2016:1501


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