Bug 1404280

Summary: Suspending role in diagnostics Error caught: [ActiveRecord::RecordNotFound] Couldn't find MiqServer with 'id'=0
Product: Red Hat CloudForms Management Engine Reporter: Matouš Mojžíš <mmojzis>
Component: UI - OPSAssignee: Harpreet Kataria <hkataria>
Status: CLOSED CURRENTRELEASE QA Contact: Parthvi Vala <pvala>
Severity: medium Docs Contact:
Priority: high    
Version: 5.7.0CC: abellott, hkataria, jhardy, jrafanie, mpovolny, obarenbo, simaishi
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: configuration:appliance
Fixed In Version: 5.8.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1414887 (view as bug list) Environment:
Last Closed: 2018-02-28 15:26:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1414887    
Attachments:
Description Flags
production.log none

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

Description of problem:


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

How reproducible:
Always

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
https://github.com/ManageIQ/manageiq/pull/13234

Comment 4 CFME Bot 2016-12-19 15:01:21 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/7c008ee357c9f0ae91d15754656bb6f2805fe3bc

commit 7c008ee357c9f0ae91d15754656bb6f2805fe3bc
Author:     Harpreet Kataria <hkataria>
AuthorDate: Sun Dec 18 14:29:33 2016 -0500
Commit:     Harpreet Kataria <hkataria>
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.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1404280

 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 5.8.1.0. Active roles can be suspended without any errors.