Bug 1596069 - Internal Server Error during filtering by flavor name in API
Summary: Internal Server Error during filtering by flavor name in API
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: API
Version: 5.8.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: GA
: 5.10.0
Assignee: Julian Cheal
QA Contact: Parthvi Vala
URL:
Whiteboard:
Depends On:
Blocks: 1572700 1607441 1607442
TreeView+ depends on / blocked
 
Reported: 2018-06-28 08:10 UTC by Imaan
Modified: 2021-09-09 14:47 UTC (History)
8 users (show)

Fixed In Version: 5.10.0.6
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1607441 1607442 (view as bug list)
Environment:
Last Closed: 2019-02-11 14:05:38 UTC
Category: ---
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Imaan 2018-06-28 08:10:06 UTC
Description of problem:

Internal Server Error during filtering by flavor name in API.

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

Red Hat CloudForms 4.6

How reproducible:100%

API Query: 

https://Cloudforms.example.com/api/vms?filter[]=flavor.name="m1.tiny"

API Response: 

{
    "error": {
        "kind": "internal_server_error",
        "message": "undefined method `klass' for nil:NilClass\nDid you mean?  class",
        "klass": "NoMethodError"
    }
}

Expected results: It should return 200 status code with flavor information.

Comment 4 Dave Johnson 2018-06-28 08:43:12 UTC
Please assess the impact of this issue and update the severity accordingly.  Please refer to https://bugzilla.redhat.com/page.cgi?id=fields.html#bug_severity for a reminder on each severity's definition.

If it's something like a tracker bug where it doesn't matter, please set the severity to Low.

Comment 5 Julian Cheal 2018-07-11 12:18:12 UTC
WIP PR https://github.com/ManageIQ/manageiq/pull/17692

Not sure if this is correct, but it stops throwing the error.

Comment 6 Julian Cheal 2018-07-18 19:36:24 UTC
Fixed in PR https://github.com/ManageIQ/manageiq/pull/17692 Vm needed to belong to Flavor in the models.

Comment 9 Parthvi Vala 2018-11-12 14:28:33 UTC
FIXED. Verified on 5.10.0.23.20181106165157_92dd189.

Request: GET /api/vms?filter[]=flavor.name="<flavor_name>"
Response: {
    "name": "vms",
    "count": 14,
    "subcount": 1,
    "subquery_count": 1,
    "pages": 1,
    "resources": [
        {
            "href": "https://<ip_address>/api/vms/99"
        }
    ],
    "actions": [
        ...
    ],
    "links": {
        "self": "https://<ip_address>/api/vms?filter%5B%5D=flavor.name%3D%22Standard_A2%22&offset=0",
        "first": "https://<ip_address>/api/vms?filter%5B%5D=flavor.name%3D%22Standard_A2%22&offset=0",
        "last": "https://<ip_address>/api/vms?filter%5B%5D=flavor.name%3D%22Standard_A2%22&offset=0"
    }
}


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