{"action":"created","issue":{"url":"https://api.github.com/repos/ManageIQ/manageiq/issues/8259","repository_url":"https://api.github.com/repos/ManageIQ/manageiq","labels_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/8259/labels{/name}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/8259/comments","events_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/8259/events","html_url":"https://github.com/ManageIQ/manageiq/pull/8259","id":151202605,"number":8259,"title":"SCVMM - Handle exception raised when 'VMCheckpoints' are not present","user":{"login":"bronaghs","id":4379675,"avatar_url":"https://avatars.githubusercontent.com/u/4379675?v=3","gravatar_id":"","url":"https://api.github.com/users/bronaghs","html_url":"https://github.com/bronaghs","followers_url":"https://api.github.com/users/bronaghs/followers","following_url":"https://api.github.com/users/bronaghs/following{/other_user}","gists_url":"https://api.github.com/users/bronaghs/gists{/gist_id}","starred_url":"https://api.github.com/users/bronaghs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bronaghs/subscriptions","organizations_url":"https://api.github.com/users/bronaghs/orgs","repos_url":"https://api.github.com/users/bronaghs/repos","events_url":"https://api.github.com/users/bronaghs/events{/privacy}","received_events_url":"https://api.github.com/users/bronaghs/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ManageIQ/manageiq/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/ManageIQ/manageiq/labels/darga/yes","name":"darga/yes","color":"000000"},{"url":"https://api.github.com/repos/ManageIQ/manageiq/labels/providers/scvmm","name":"providers/scvmm","color":"5319e7"}],"state":"open","locked":false,"assignee":{"login":"blomquisg","id":14183,"avatar_url":"https://avatars.githubusercontent.com/u/14183?v=3","gravatar_id":"","url":"https://api.github.com/users/blomquisg","html_url":"https://github.com/blomquisg","followers_url":"https://api.github.com/users/blomquisg/followers","following_url":"https://api.github.com/users/blomquisg/following{/other_user}","gists_url":"https://api.github.com/users/blomquisg/gists{/gist_id}","starred_url":"https://api.github.com/users/blomquisg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blomquisg/subscriptions","organizations_url":"https://api.github.com/users/blomquisg/orgs","repos_url":"https://api.github.com/users/blomquisg/repos","events_url":"https://api.github.com/users/blomquisg/events{/privacy}","received_events_url":"https://api.github.com/users/blomquisg/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2016-04-26T18:13:09Z","updated_at":"2016-05-18T17:40:30Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/8259","html_url":"https://github.com/ManageIQ/manageiq/pull/8259","diff_url":"https://github.com/ManageIQ/manageiq/pull/8259.diff","patch_url":"https://github.com/ManageIQ/manageiq/pull/8259.patch"},"body":"As described in the BZ, we have been unable to reproduce this exception so I took an educated guess at the cause. The exception message in the log file is as follows:\r\n\r\n`----] E, [2016-01-13T16:14:15.454712 #3064:6c398c] ERROR -- : [NoMethodError]: undefined method each' for nil:NilClass  Method:[rescue in block in refresh]\r\n[----] 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`\r\n\r\n\r\n**the fix:**\r\nThis usually indicates an attempt was made to read a hash key that is not present. In this PR I check if the `VMCheckpoints` key is present before trying to read it to gather a list of snapshots.\r\n\r\n\r\n**spec test**\r\nI am open to ideas on how to write a test for this. The refresher spec tests read from the database after a refresh has completed. I could butcher the output of loading the static YML file of inventory in the `before` method so a VM's properties hash has no `VMCheckpoints` key: \r\nhttps://github.com/ManageIQ/manageiq/blob/master/spec/models/manageiq/providers/microsoft/infra_manager/refresher_spec.rb#L10\r\n.. but i do not love that approach.\r\n\r\nhttps://bugzilla.redhat.com/show_bug.cgi?id=1298325\r\n\r\n@miq-bot add_label darga/yes"},"comment":{"url":"https://api.github.com/repos/ManageIQ/manageiq/issues/comments/220103016","html_url":"https://github.com/ManageIQ/manageiq/pull/8259#issuecomment-220103016","issue_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/8259","id":220103016,"user":{"login":"miq-bot","id":7806257,"avatar_url":"https://avatars.githubusercontent.com/u/7806257?v=3","gravatar_id":"","url":"https://api.github.com/users/miq-bot","html_url":"https://github.com/miq-bot","followers_url":"https://api.github.com/users/miq-bot/followers","following_url":"https://api.github.com/users/miq-bot/following{/other_user}","gists_url":"https://api.github.com/users/miq-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/miq-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miq-bot/subscriptions","organizations_url":"https://api.github.com/users/miq-bot/orgs","repos_url":"https://api.github.com/users/miq-bot/repos","events_url":"https://api.github.com/users/miq-bot/events{/privacy}","received_events_url":"https://api.github.com/users/miq-bot/received_events","type":"User","site_admin":false},"created_at":"2016-05-18T17:40:30Z","updated_at":"2016-05-18T17:40:30Z","body":"<rubocop />Checked commit https://github.com/bronaghs/manageiq/commit/414ec3f2bb98b696231ab4a89a6afbd3b1d279a0 with ruby 2.2.3, rubocop 0.37.2, and haml-lint 0.16.1\n1 file checked, 0 offenses detected\nEverything looks good. :trophy:\n"}}