Bug 1546112 - internal server error when cloud_networks, cloud_subnets or security_groups subcolls requested on RHEVM
Summary: internal server error when cloud_networks, cloud_subnets or security_groups s...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: API
Version: 5.9.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: GA
: 5.10.0
Assignee: Gregg Tanzillo
QA Contact: Martin Kourim
URL:
Whiteboard: api:rest:provider
Depends On:
Blocks: 1552826
TreeView+ depends on / blocked
 
Reported: 2018-02-16 11:09 UTC by Martin Kourim
Modified: 2019-02-11 13:58 UTC (History)
3 users (show)

Fixed In Version: 5.10.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1552826 (view as bug list)
Environment:
Last Closed: 2019-02-11 13:58:43 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Martin Kourim 2018-02-16 11:09:04 UTC
Description of problem:
When accessing "cloud_networks", "cloud_subnets" or "security_groups" subcollection on RHEVM provider the request fails with internal server error:
{
    "error": {
        "kind": "internal_server_error",
        "message": "undefined method `all' for nil:NilClass",
        "klass": "NoMethodError"
    }
}


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


How reproducible:
100%


Steps to Reproduce:
1. add RHEVM provider
2. request the "cloud_networks", "cloud_subnets" or "security_groups" subcollection
GET /api/providers/:id/cloud_networks
GET /api/providers/:id/cloud_subnets
GET /api/providers/:id/security_groups

Comment 2 CFME Bot 2018-02-16 15:11:28 UTC
New commit detected on ManageIQ/manageiq-api/master:
https://github.com/ManageIQ/manageiq-api/commit/2fd9ee9d9b51918a010a212972268ca0ab6d1a9f

commit 2fd9ee9d9b51918a010a212972268ca0ab6d1a9f
Author:     Jillian Tullo <jtullo>
AuthorDate: Fri Feb 16 09:48:01 2018 -0500
Commit:     Jillian Tullo <jtullo>
CommitDate: Fri Feb 16 09:48:01 2018 -0500

    Ensure array is returned for subcollections
    
    Some providers return nil for cloud_networks, cloud_subnets, and security_groups, causing an internal server error to be raised.
    
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1546112

 .../api/subcollections/cloud_networks.rb           |  2 +-
 .../api/subcollections/cloud_subnets.rb            |  2 +-
 .../api/subcollections/security_groups.rb          |  2 +-
 spec/requests/providers_spec.rb                    | 32 ++++++++++++++++++++++
 4 files changed, 35 insertions(+), 3 deletions(-)

Comment 5 Martin Kourim 2018-06-28 11:08:10 UTC
Verified on 5.10.0.2 using our test automation


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