Bug 1298325

Summary: SCVMM Provider refresh error refresh_parser.rb:324:in `process_snapshots'
Product: Red Hat CloudForms Management Engine Reporter: Josh Carter <jocarter>
Component: ProvidersAssignee: Bronagh Sorota <bsorota>
Status: CLOSED ERRATA QA Contact: Jeff Teehan <jteehan>
Severity: high Docs Contact:
Priority: high    
Version: 5.5.0CC: bsorota, cpelland, dajohnso, fdewaley, gblomqui, jfrey, jhardy, jocarter, jteehan, obarenbo, simaishi
Target Milestone: GAKeywords: ZStream
Target Release: 5.6.0   
Hardware: All   
OS: All   
Whiteboard: scvmm:ems_refresh:snapshot
Fixed In Version: 5.6.0.8 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1331093 (view as bug list) Environment:
Last Closed: 2016-06-29 15:29:18 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: Unknown Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1331093    

Description Josh Carter 2016-01-13 19:10:02 UTC
Description of problem:

The following error gets created in the web UI following the SCVMM provider refresh:

undefined method `each' for nil:NilClass


[----] E, [2016-01-13T16:14:15.454469 #3064:6c398c] ERROR -- : MIQ(ManageIQ::Providers::Microsoft::InfraManager::Refresher#refresh) EMS: [SCVMM], id: [1000000000001] Refresh failed
[----] E, [2016-01-13T16:14:15.454712 #3064:6c398c] ERROR -- : [NoMethodError]: undefined method `each' for nil:NilClass  Method:[rescue in block in refresh]
[----] E, [2016-01-13T16:14:15.454828 #3064:6c398c] ERROR -- : /var/www/miq/vmdb/app/models/manageiq/providers/microsoft/infra_manager/refresh_parser.rb:324:in `process_snapshots'
/var/www/miq/vmdb/app/models/manageiq/providers/microsoft/infra_manager/refresh_parser.rb:194:in `parse_vm'
/var/www/miq/vmdb/app/models/manageiq/providers/microsoft/infra_manager/refresh_parser.rb:64:in `block in get_vms'
/var/www/miq/vmdb/app/models/manageiq/providers/microsoft/infra_manager/refresh_parser.rb:601:in `block in process_collection'
/var/www/miq/vmdb/app/models/manageiq/providers/microsoft/infra_manager/refresh_parser.rb:600:in `each'
/var/www/miq/vmdb/app/models/manageiq/providers/microsoft/infra_manager/refresh_parser.rb:600:in `process_collection'
/var/www/miq/vmdb/app/models/manageiq/providers/microsoft/infra_manager/refresh_parser.rb:64:in `get_vms'
/var/www/miq/vmdb/app/models/manageiq/providers/microsoft/infra_manager/refresh_parser.rb:31:in `ems_inv_to_hashes'
/var/www/miq/vmdb/app/models/manageiq/providers/microsoft/infra_manager/refresh_parser.rb:7:in `ems_inv_to_hashes'
/var/www/miq/vmdb/app/models/manageiq/providers/microsoft/infra_manager/refresher.rb:10:in `parse_inventory'


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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 6 Bronagh Sorota 2016-01-25 17:26:19 UTC
i have a theoretical explanation for this error which can be proven or disproven by testing on a SCVMM SP1 environment first. Jeff, can you help with this?

Comment 7 Jeff Teehan 2016-01-26 04:19:54 UTC
Absolutely.  As I said to dajo, everything seems to working fine on our environment.  I'm still trying to figure out how to break it.

Comment 8 Jeff Teehan 2016-01-26 05:18:31 UTC
I can't reproduce it.

I'm going to need some more info.  I routine check this provider and it always works.  I put a snapshot on everything and it still works.  I keep the latest Rollup Update installed.  Perhaps the customer is running and older version.

As far as whether the older SCVMM SP1 is supported or not, well, I support this platform.  I've always kept it up to date and it works just fine.  I'm going to need more info.

Please make sure the customer is using the latest version.  I've provided info at https://mojo.redhat.com/docs/DOC-1044058

I don't know what else to do.

Comment 10 Felix Dewaleyne 2016-01-29 15:53:28 UTC
environment affected :

OS Version of VMM Server: 6.2 (Windows Server 2012)
3.1.6109.0 System Center 2012 SP1 Update Rollup 11

Comment 12 Bronagh Sorota 2016-01-29 16:14:34 UTC
Yes, that would be a good next step. 
Jeff, can you do apply the rollups?

Comment 13 Jeff Teehan 2016-01-31 22:42:45 UTC
I installed the requested version, verified it, and created a few more checkpoints both from SCVMM and from Hyper-V  Still seems to still be working.  Kind of wish it wasn't.

Comment 14 Jeff Teehan 2016-01-31 22:44:52 UTC
I updated the mojo page as well.

Comment 19 Jeff Teehan 2016-02-23 17:03:05 UTC
I responded twice with the same answer, which is I cannot reproduce it.  I have added all kinds of snapshots to no avail.  I don't know what else to try.

Comment 24 Bronagh Sorota 2016-05-03 13:57:07 UTC
Felix / Dave - I have no further suggestions.
The error indicates that we are trying to read the VMCheckpoints property from the VM but it is either not present or it has a NIL value. This is my best guess since none of us can reproduce it. I have made a PR to fix this.

Comment 25 CFME Bot 2016-05-19 11:45:46 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/414ec3f2bb98b696231ab4a89a6afbd3b1d279a0

commit 414ec3f2bb98b696231ab4a89a6afbd3b1d279a0
Author:     Bronagh Sorota <bsorota>
AuthorDate: Tue Apr 26 13:51:32 2016 -0400
Commit:     Bronagh Sorota <bsorota>
CommitDate: Wed May 18 12:48:09 2016 -0400

    Return empty array if VMCheckpoints is NIL.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1298325

 .../manageiq/providers/microsoft/infra_manager/refresh_parser.rb    | 6 ++++++
 1 file changed, 6 insertions(+)

Comment 26 Jeff Teehan 2016-06-16 18:49:03 UTC
I checked again with the new fix.  Everything continues to work fine and I've gone to extreme measures with checkpoints.  I even put the snapshots on a drive SCVMM can't see and it still worked fine.

Perhaps the checkpoint is just coincidental to another issue.  This new bug produces a very similar error - https://bugzilla.redhat.com/show_bug.cgi?id=1347406

It's not the checkpoints unless the VM is simply corrupt.  I've tried everything on all versions of SCVMM and Windows VMs.   Please reopen it if you find additional information.

Moving to Verified using https://10.16.7.187/vm_infra/explorer as there was a code change.

Comment 28 errata-xmlrpc 2016-06-29 15:29:18 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/RHBA-2016:1348