Bug 1446166 - accessing RHEV provider fails with "NoMethodError: undefined method `>=' for nil:NilClass"
Summary: accessing RHEV provider fails with "NoMethodError: undefined method `>=' for ...
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
high
Target Milestone: GA
: 5.9.0
Assignee: Boriso
QA Contact: Ilanit Stein
URL:
Whiteboard: api:rest:provider
Depends On:
Blocks: 1446613
TreeView+ depends on / blocked
 
Reported: 2017-04-27 11:29 UTC by Martin Kourim
Modified: 2018-03-06 15:20 UTC (History)
7 users (show)

Fixed In Version: 5.9.0.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1446613 (view as bug list)
Environment:
Last Closed: 2018-03-06 15:20:01 UTC
Category: ---
Cloudforms Team: RHEVM
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Excerpt of evm.log (15.37 KB, text/plain)
2017-04-27 12:01 UTC, Milan Falešník
no flags Details

Description Martin Kourim 2017-04-27 11:29:07 UTC
Description of problem:
When a RHEV provider is added and "Relationships and Power States" are not refreshed, it's not possible to access the provider using REST API. It fails with `NoMethodError: undefined method `>=' for nil:NilClass`.

Please see http://pastebin.test.redhat.com/479296 for relevant parts of the evm.log


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


How reproducible:
Very


Steps to Reproduce:
1. add the RHEV provider using "Discover Infrastructure Providers" (this way it's not necessary to specify credentials and the provider is not refreshed automatically)
2. GET /api/providers/:id


Actual results:
NoMethodError: undefined method `>=' for nil:NilClass"

Comment 2 Milan Falešník 2017-04-27 12:01:09 UTC
Created attachment 1274594 [details]
Excerpt of evm.log

Copying the log from the pastebin link as an attachment to ensure preservation of the data.

Comment 3 Juan Hernández 2017-04-27 17:29:48 UTC
This happens when the provider is added without credentials because without credentials there is no way to determine the version of the API, therefore the 'api_version' method returns 'nil'.

This was detected already as a problem that happens when the refresh hasn't been performed yet. The solution already merged to the new 'manageiq-providers-ovirt' repository:

  Renderer fails when calling validate_import_vm
  https://github.com/ManageIQ/manageiq-providers-ovirt/pull/3

But it was marked as fine/no.

The corresponding pull request before the creation of the new repository was never merged either:

  Prevent NoMethodError when api_version is nil in VmImport
  https://github.com/ManageIQ/manageiq/pull/14013

So I think we should consider setting the flag to 'fine/yes', and backport it.

Comment 4 Piotr Kliczewski 2017-04-28 07:37:51 UTC
Here is the backport to fine:

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

Comment 6 Ilanit Stein 2017-05-04 06:02:09 UTC
Moving qe_test_coverage to + as this bug is already included in existing RHV provider crud test.

Comment 7 Ilanit Stein 2017-11-09 13:50:00 UTC
Verified on CFME-5.9.0.4/RHV-4.1.7

Followed description's flow:

1. add the RHEV provider using "Discover Infrastructure Providers" (this way it's not necessary to specify credentials and the provider is not refreshed automatically)
2. GET /api/providers/:id - successful.


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