Bug 1392594

Summary: Querying all providers while expanding cloud_networks causes an internal_server_error
Product: Red Hat CloudForms Management Engine Reporter: abellott
Component: APIAssignee: Jillian Tullo <jtullo>
Status: CLOSED CURRENTRELEASE QA Contact: Martin Kourim <mkourim>
Severity: high Docs Contact:
Priority: high    
Version: 5.7.0CC: cpelland, dajohnso, jhardy, obarenbo, slukasik
Target Milestone: GAKeywords: TestOnly
Target Release: 5.8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: rest:cloud:sdn
Fixed In Version: 5.8.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1397138 (view as bug list) Environment:
Last Closed: 2017-06-12 16:59:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1397138    

Description abellott 2016-11-07 21:02:06 UTC
Description of problem:

When the DB includes regular InfraManagers in addition to CloudManagers,
querying the providers causes a stack trace and returns an internal server
error (HTTP 500).

GET /api/providers?expand=resources,cloud_networks

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

5.7

How reproducible:

Always:

Steps to Reproduce:

1. Setup appliance.
2. Setup a VmWare or RedHat provider.
3. Run the GET /api/providers?expand=resources,cloud_networks API command


Actual results:

{
  "error": {
    "kind": "internal_server_error",
    "message": "undefined method `cloud_networks' for #<ManageIQ::Providers::Redhat::InfraManager:0x007f8d1966c1c0>",
    "klass": "NoMethodError"
  }
}

Expected results:

Successful provider resource list

Additional info:

Comment 2 Šimon Lukašík 2016-11-09 11:50:27 UTC
https://github.com/ManageIQ/manageiq/pull/12522

Comment 3 Šimon Lukašík 2016-11-14 11:47:39 UTC
Jillian was first to fix this. Reassigning.

https://github.com/ManageIQ/manageiq/pull/12467

Comment 4 abellott 2016-11-21 14:39:01 UTC
moving to POST this was merged upstream and backported to Euwe release:

$ git log -1
commit 82d6df6a1c6a093f1060453d21935843886776a1
Author: Alberto Bellotti <abellotti.github.com>
Date:   Wed Nov 16 10:14:50 2016 -0500

    Merge pull request #12467 from jntullo/fix_cloud_network_subcollection

    check if provider responds to cloud_networks in subcollection
    (cherry picked from commit 1ff3ed360f841c3f1c4546dbdb24617795875160)

    https://github.com/ManageIQ/manageiq/issues/12456

Comment 6 Martin Kourim 2017-02-28 19:32:38 UTC
Tested on appliance with VmWare and GCE providers. Provider resource list successfully returned.