Bug 1404280 - Suspending role in diagnostics Error caught: [ActiveRecord::RecordNotFound] Couldn't find MiqServer with 'id'=0
Summary: Suspending role in diagnostics Error caught: [ActiveRecord::RecordNotFound] C...
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: UI - OPS
Version: 5.7.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: GA
: 5.8.0
Assignee: Harpreet Kataria
QA Contact: Parthvi Vala
Whiteboard: configuration:appliance
Depends On:
Blocks: 1414887
TreeView+ depends on / blocked
Reported: 2016-12-13 14:19 UTC by Matouš Mojžíš
Modified: 2019-07-18 10:32 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1414887 (view as bug list)
Last Closed: 2018-02-28 15:26:04 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:

Attachments (Terms of Use)
production.log (8.75 KB, text/plain)
2016-12-13 14:19 UTC, Matouš Mojžíš
no flags Details

Description Matouš Mojžíš 2016-12-13 14:19:44 UTC
Created attachment 1231231 [details]

Description of problem:

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

How reproducible:

Steps to Reproduce:
1.Go to Settings -> Configuration -> Diagnostics -> CFME Region
2.Select Roles by Servers or Servers by Roles
3. Select a role and suspend it by clicking on configuration -> suspend in toolbar

Actual results:
Error in production.log added in attachment

Expected results:

Additional info:

Comment 2 Joe Rafaniello 2016-12-15 16:41:10 UTC
It looks like ops_controller/diagnostics.rb is calling MiqServer.find with 0 as an argument:

        @selected_server = kls.find(from_cid(x_node.split("-").last))

Comment 3 Harpreet Kataria 2016-12-18 19:30:57 UTC

Comment 4 CFME Bot 2016-12-19 15:01:21 UTC
New commit detected on ManageIQ/manageiq/master:

commit 7c008ee357c9f0ae91d15754656bb6f2805fe3bc
Author:     Harpreet Kataria <hkataria@redhat.com>
AuthorDate: Sun Dec 18 14:29:33 2016 -0500
Commit:     Harpreet Kataria <hkataria@redhat.com>
CommitDate: Sun Dec 18 14:36:07 2016 -0500

    Fixed code that sets selected_server record to be used by view.
    Use existing parent record to set @selected_server variable that should point to the record selected in the diagnostics tree on the left.

 app/controllers/ops_controller/diagnostics.rb      |  3 +-
 .../controllers/ops_controller/diagnostics_spec.rb | 34 ++++++++++++++++++++++
 2 files changed, 35 insertions(+), 2 deletions(-)

Comment 7 Matouš Mojžíš 2017-06-29 14:14:01 UTC
Verified in Active roles can be suspended without any errors.

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