Bug 1501927

Summary: RHV compute resource screen shows DataTables warning invalid json response
Product: Red Hat Satellite Reporter: Eric Lavarde <elavarde>
Component: Compute Resources - RHEVAssignee: orabin
Status: CLOSED ERRATA QA Contact: Lukáš Hellebrandt <lhellebr>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: dsirrine, ehelms, inecas, lhellebr, orabin, pcreech
Target Milestone: 6.5.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: foreman-1.20.1.11-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-14 12:36:38 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: 1115190, 1583242, 1583243    
Attachments:
Description Flags
datatables warning dialog
none
messed up VM tab none

Description Eric Lavarde 2017-10-13 13:38:15 UTC
Created attachment 1338233 [details]
datatables warning dialog

Description of problem:
After creating a compute resource, it doesn't seem to be able to properly parse the output of the API calls. The "Virtual Machines" tab looks as well broken.

Version-Release number of selected component (if applicable):
satellite-6.3.0-19.0.beta.el7sat.noarch

How reproducible:
Each time I go to the RHEV's compute resource page, but I haven't checked if it happens with any RHV compute resource.

Steps to Reproduce:
1. hammer compute-resource create --datacenter Default --description "RHEV on my Laptop" --locations "Default Location" --name "cr-rhev-laptop" --organizations "Default Organization" --password ADMINPWD --provider Ovirt --url https://rhev.example.com/api --user 'admin@internal'
2. Go to the Satellite UI, Infrastructure -> Compute resources
3. Click on the compute resource's name

Actual results:
Error message dialog: DataTables warning: table id=DataTables_Table_0 - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1 (see screenshot).
Additionally the page with the VMs is empty and rather malformed (e.g. no page number, see 2nd screenshot).

Expected results:
No error message and the VMs are properly listed (there are two of them).

Additional info:
RHEV version 3.6 is used here.

Comment 1 Eric Lavarde 2017-10-13 13:39:12 UTC
Created attachment 1338235 [details]
messed up VM tab

Comment 3 orabin 2018-01-04 17:47:03 UTC
Created redmine issue http://projects.theforeman.org/issues/22154 from this bug

Comment 4 Satellite Program 2018-01-04 19:26:12 UTC
Upstream bug assigned to orabin

Comment 5 Satellite Program 2018-01-04 19:26:15 UTC
Upstream bug assigned to orabin

Comment 6 orabin 2018-06-18 11:52:31 UTC
*** Bug 1583243 has been marked as a duplicate of this bug. ***

Comment 7 Shira Maximov 2018-07-10 13:58:26 UTC
*** Bug 1523251 has been marked as a duplicate of this bug. ***

Comment 8 orabin 2018-08-09 09:38:57 UTC
The main bug here is: https://projects.theforeman.org/issues/22155 and it was merged upstream.
The other connected bug is about the message being unclear in the UI. That message no longer exists with the bug fixed.
I'm moving this to POST.

Comment 10 Lukáš Hellebrandt 2019-01-03 12:26:38 UTC
Verified with Sat 6.5 snap 9

It is now possible to add and edit RHEV CR using Hammer (this BZ only applied to Hammer, despite it not being mentioned here) without causing wrong Datacenter settings.

Comment 11 Lukáš Hellebrandt 2019-01-03 12:54:06 UTC
Nope. I was too quick verifying this.

1) Whenever I try to change datacenter through Hammer, it seems to set the first datacenter in the list rather than the one specified.
2) When entering a name of nonexistent datacenter, the command "succeeds", changing nothing.

No tracebacks. But I think it can be caused by the wrong logic here [1]. What happens if something fails?

[1] https://projects.theforeman.org/projects/foreman/repository/revisions/62976743b694fea31fc4111f23d8025966af28a4/diff/app/controllers/api/v2/compute_resources_controller.rb

Comment 12 Lukáš Hellebrandt 2019-01-03 13:14:52 UTC
Ad 2) : Also changing to the first datacenter in the list

Comment 13 orabin 2019-02-21 08:50:48 UTC
The new issue opened for the bug in Comment 11 (https://projects.theforeman.org/issues/25817) is now merged.

Comment 15 Lukáš Hellebrandt 2019-03-14 12:12:17 UTC
Verified with Sat 6.5 snap 19 using reproducers from OP and comment 11.

The issue is fixed and regression caused by first fix version and described in comment 11 is also fixed.

Comment 17 errata-xmlrpc 2019-05-14 12:36:38 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/RHSA-2019:1222