This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 1302786 - Azure api version issue - The resource type 'locations/vmSizes' could not be found in the namespace
Azure api version issue - The resource type 'locations/vmSizes' could not be...
Status: CLOSED ERRATA
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Providers (Show other bugs)
5.5.0
All All
high Severity urgent
: GA
: 5.6.0
Assigned To: Bronagh Sorota
Jeff Teehan
provider:azure
: ZStream
Depends On:
Blocks: 1303122
  Show dependency treegraph
 
Reported: 2016-01-28 10:55 EST by Felix Dewaleyne
Modified: 2017-07-14 10:52 EDT (History)
12 users (show)

See Also:
Fixed In Version: 5.6.0.0
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1303122 (view as bug list)
Environment:
Last Closed: 2016-06-29 11:34:30 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 2158851 None None None 2016-03-09 07:03 EST

  None (edit)
Description Felix Dewaleyne 2016-01-28 10:55:49 EST
Description of problem:
since the 25th of January 2016 at 03:00 an error is raised for a missing api ressource 'locations/vmSizes'

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

How reproducible:
all the time

Steps to Reproduce:
1. refresh an azure worker
2.
3.

Actual results:
[----] I, [2016-01-28T03:34:13.533473 #24071:a1d998]  INFO -- : MIQ(ManageIQ::Providers::Azure::CloudManager::Refresher#refresh) Refreshing all targets...
[----] I, [2016-01-28T03:34:13.533708 #24071:a1d998]  INFO -- : MIQ(ManageIQ::Providers::Azure::CloudManager::Refresher#refresh) EMS: [MCI], id: [4201000000000014] Refreshing targets for EMS: [MCI], id: [4201000000000014]...
[----] I, [2016-01-28T03:34:13.533848 #24071:a1d998]  INFO -- : MIQ(ManageIQ::Providers::Azure::CloudManager::Refresher#refresh) EMS: [MCI], id: [4201000000000014]   ManageIQ::Providers::Azure::CloudManager [MCI] id [4201000000000014]
[----] I, [2016-01-28T03:34:13.816147 #2889:563998]  INFO -- : MIQ(ManageIQ::Providers::Vmware::InfraManager::EventCatcher::Runner#process_event) EMS [vma4207.rwegroup.cz] as [rwegroup\svc_CldForms_vmware_f] Skipping caught event [UserLogoutSessionEvent] chainId [71841308]
[----] I, [2016-01-28T03:34:14.232655 #24071:a1d998]  INFO -- : MIQ(ManageIQ::Providers::Azure::CloudManager::RefreshParser#ems_inv_to_hashes) Collecting data for EMS : [MCI] id: [4201000000000014]...
[----] E, [2016-01-28T03:34:14.841992 #24071:a1d998] ERROR -- : MIQ(ManageIQ::Providers::Azure::CloudManager::Refresher#refresh) EMS: [MCI], id: [4201000000000014] Refresh failed
[----] E, [2016-01-28T03:34:14.842401 #24071:a1d998] ERROR -- : [Azure::Armrest::ResourceNotFoundException]: The resource type 'locations/vmSizes' could not be found in the namespace 'Microsoft.Compute' for api version '2016-04-30-preview'. The supported api-versions are '2015-05-01-preview,2015-06-15'.  Method:[rescue in block in refresh]
[----] E, [2016-01-28T03:34:14.842694 #24071:a1d998] ERROR -- : /opt/rh/cfme-gemset/gems/azure-armrest-0.0.8/lib/azure/armrest/armrest_service.rb:337:in `raise_api_exception'
/opt/rh/cfme-gemset/gems/azure-armrest-0.0.8/lib/azure/armrest/armrest_service.rb:285:in `rescue in rest_get'
/opt/rh/cfme-gemset/gems/azure-armrest-0.0.8/lib/azure/armrest/armrest_service.rb:283:in `rest_get'
/opt/rh/cfme-gemset/gems/azure-armrest-0.0.8/lib/azure/armrest/armrest_service.rb:346:in `rest_get'
/opt/rh/cfme-gemset/gems/azure-armrest-0.0.8/lib/azure/armrest/virtual_machine_service.rb:50:in `series'
/var/www/miq/vmdb/app/models/manageiq/providers/azure/cloud_manager/refresh_parser.rb:60:in `get_series'
/var/www/miq/vmdb/app/models/manageiq/providers/azure/cloud_manager/refresh_parser.rb:35:in `ems_inv_to_hashes'
/var/www/miq/vmdb/app/models/manageiq/providers/azure/cloud_manager/refresh_parser.rb:10:in `ems_inv_to_hashes'
/var/www/miq/vmdb/app/models/manageiq/providers/azure/cloud_manager/refresher.rb:6:in `parse_inventory'
/var/www/miq/vmdb/app/models/ems_refresh/refreshers/ems_refresher_mixin.rb:19:in `block in refresh'
/var/www/miq/vmdb/app/models/ems_refresh/refreshers/ems_refresher_mixin.rb:7:in `each'
/var/www/miq/vmdb/app/models/ems_refresh/refreshers/ems_refresher_mixin.rb:7:in `refresh'
/var/www/miq/vmdb/app/models/manageiq/providers/base_manager/refresher.rb:10:in `refresh'
/var/www/miq/vmdb/app/models/ems_refresh.rb:77:in `block in refresh'
/var/www/miq/vmdb/app/models/ems_refresh.rb:76:in `each'
/var/www/miq/vmdb/app/models/ems_refresh.rb:76:in `refresh'
/var/www/miq/vmdb/app/models/miq_queue.rb:345:in `block in deliver'
/opt/rh/rh-ruby22/root/usr/share/ruby/timeout.rb:89:in `block in timeout'
/opt/rh/rh-ruby22/root/usr/share/ruby/timeout.rb:34:in `block in catch'
/opt/rh/rh-ruby22/root/usr/share/ruby/timeout.rb:34:in `catch'
/opt/rh/rh-ruby22/root/usr/share/ruby/timeout.rb:34:in `catch'
/opt/rh/rh-ruby22/root/usr/share/ruby/timeout.rb:104:in `timeout'
/var/www/miq/vmdb/app/models/miq_queue.rb:341:in `deliver'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:106:in `deliver_queue_message'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:134:in `deliver_message'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:151:in `block in do_work'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:145:in `loop'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:145:in `do_work'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:334:in `block in do_work_loop'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:331:in `loop'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:331:in `do_work_loop'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:153:in `run'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:128:in `start'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:29:in `start_worker'
/var/www/miq/vmdb/lib/workers/bin/worker.rb:2:in `<top (required)>'
/opt/rh/cfme-gemset/gems/railties-4.2.5/lib/rails/commands/runner.rb:60:in `load'
/opt/rh/cfme-gemset/gems/railties-4.2.5/lib/rails/commands/runner.rb:60:in `<top (required)>'
/opt/rh/cfme-gemset/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:123:in `require'
/opt/rh/cfme-gemset/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:123:in `require_command!'
/opt/rh/cfme-gemset/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:90:in `runner'
/opt/rh/cfme-gemset/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
/opt/rh/cfme-gemset/gems/railties-4.2.5/lib/rails/commands.rb:17:in `<top (required)>'
/var/www/miq/vmdb/bin/rails:4:in `require'
/var/www/miq/vmdb/bin/rails:4:in `<main>'
[----] E, [2016-01-28T03:34:14.842833 #24071:a1d998] ERROR -- : MIQ(ManageIQ::Providers::Azure::CloudManager::Refresher#refresh) EMS: [MCI], id: [4201000000000014] Unable to perform refresh for the following targets:
[----] E, [2016-01-28T03:34:14.843116 #24071:a1d998] ERROR -- : MIQ(ManageIQ::Providers::Azure::CloudManager::Refresher#refresh)  --- ManageIQ::Providers::Azure::CloudManager [MCI] id [4201000000000014]
[----] I, [2016-01-28T03:34:14.982554 #2640:937998]  INFO -- : MIQ(MiqServer#populate_queue_messages) Fetched 1 miq_queue rows for queue_name=ems_4201000000000007, wcount=2, priority=200
[----] I, [2016-01-28T03:34:15.002732 #24071:a1d998]  INFO -- : MIQ(ManageIQ::Providers::Azure::CloudManager::Refresher#refresh) Refreshing all targets...Complete


Expected results:
refresh continues without error

Additional info:
- customer is using the new portal
- if you list available apis, it is OK:
PS C:\Users\afbenda> (Get-AzureRmResourceProvider -ProviderNamespace Microsoft.Compute).ResourceTypes|select resourcetypename,apiversions,Locations

ResourceTypeName                                          ApiVersions                      Locations
----------------                                          -----------                      ---------
availabilitySets                                          {2015-06-15, 2015-05-01-preview} {East US, East US 2, West US, Central US...}
virtualMachines                                           {2015-06-15, 2015-05-01-preview} {East US, East US 2, West US, Central US...}
virtualMachines/extensions                                {2015-06-15, 2015-05-01-preview} {East US, East US 2, West US, Central US...}
virtualMachines/diagnosticSettings                        {2014-04-01}                     {East US, East US 2, West US, Central US...}
virtualMachines/metricDefinitions                         {2014-04-01}                     {East US, East US 2, West US, Central US...}
virtualMachineScaleSets                                   {2015-06-15, 2015-05-01-preview} {East US, East US 2, West US, Central US...}
virtualMachineScaleSets/extensions                        {2015-06-15, 2015-05-01-preview} {East US, East US 2, West US, Central US...}
virtualMachineScaleSets/virtualMachines                   {2015-06-15, 2015-05-01-preview} {East US, East US 2, West US, Central US...}
virtualMachineScaleSets/networkInterfaces                 {2015-06-15, 2015-05-01-preview} {East US, East US 2, West US, Central US...}
virtualMachineScaleSets/virtualMachines/networkInterfaces {2015-06-15, 2015-05-01-preview} {East US, East US 2, West US, Central US...}
locations                                                 {2015-06-15, 2015-05-01-preview} {}
locations/operations                                      {2015-06-15, 2015-05-01-preview} {East US, East US 2, West US, Central US...}
locations/vmSizes                                         {2015-06-15, 2015-05-01-preview} {East US, East US 2, West US, Central US...}
locations/usages                                          {2015-06-15, 2015-05-01-preview} {East US, East US 2, West US, Central US...}
locations/publishers                                      {2015-06-15, 2015-05-01-preview} {East US, East US 2, West US, Central US...}
operations                                                {2015-06-15, 2015-05-01-preview} {East US, East US 2, West US, Central US...}
Comment 3 Bronagh Sorota 2016-01-29 10:46:41 EST
Fixed this upstream:
https://github.com/ManageIQ/azure-armrest/pull/120
Comment 13 Jeff Teehan 2016-02-15 12:48:33 EST
Patch is confirmed by CFME-QE as well.  Been using it for several days.
Comment 15 Colin Arnott 2016-03-02 09:56:04 EST
I am working with a client for whom this patch worked initially, but has recently ceased.

Their error output this second time around, is mostly the same as the above logs however the api version is '2016-03-30', not '2016-04-30-preview' as above.

I can provide logs if requested.
Comment 16 Bronagh Sorota 2016-03-02 14:09:39 EST
Here is a fix for this issue. Its ignores any ARM API versions that are dated in the future. Note, we already ignore all preview versions of the ARM API:

- Locate the Azure-armrest files on the appliance. 
- Open the file: lib/azure/armrest/armrest_service.rb
- Refer to:  https://github.com/ManageIQ/azure-armrest/pull/130/files
- Remove the lines marked with a minus
- Add the lines marked with a plus
Comment 17 Felix Dewaleyne 2016-03-03 06:19:12 EST
::Providers::Amazon::CloudManager", 4253000000000001]]], Dequeued in: [10.172265537] seconds
[----] I, [2016-03-03T11:14:24.458086 #6638:86b988]  INFO -- : MIQ(MiqQueue#deliver) Message id: [4253000000029871], Delivering...
[----] I, [2016-03-03T11:14:24.475704 #6638:86b988]  INFO -- : MIQ(ManageIQ::Providers::Amazon::CloudManager::Refresher#refresh) Refreshing all targets...
[----] I, [2016-03-03T11:14:24.475921 #6638:86b988]  INFO -- : MIQ(ManageIQ::Providers::Amazon::CloudManager::Refresher#refresh) EMS: [ACI], id: [4253000000000001] Refreshing targets for EMS: [ACI], id: [4253000000000001]...
[----] I, [2016-03-03T11:14:24.476053 #6638:86b988]  INFO -- : MIQ(ManageIQ::Providers::Amazon::CloudManager::Refresher#refresh) EMS: [ACI], id: [4253000000000001]   ManageIQ::Providers::Amazon::CloudManager [ACI] id [4253000000000001]
[----] E, [2016-03-03T11:14:24.882577 #6635:b2d98c] ERROR -- : MIQ(ManageIQ::Providers::Azure::CloudManager::Refresher#refresh) EMS: [MCI-Test], id: [4253000000000002] Refresh failed
[----] E, [2016-03-03T11:14:24.882821 #6635:b2d98c] ERROR -- : [NoMethodError]: undefined method `[]' for nil:NilClass  Method:[rescue in block in refresh]
[----] E, [2016-03-03T11:14:24.882972 #6635:b2d98c] ERROR -- : /opt/rh/cfme-gemset/gems/azure-armrest-0.0.8/lib/azure/armrest/armrest_service.rb:444:in `set_service_api_version'
/opt/rh/cfme-gemset/gems/azure-armrest-0.0.8/lib/azure/armrest/virtual_machine_service.rb:23:in `initialize'
/var/www/miq/vmdb/app/models/manageiq/providers/azure/cloud_manager/refresh_parser.rb:17:in `new'
/var/www/miq/vmdb/app/models/manageiq/providers/azure/cloud_manager/refresh_parser.rb:17:in `initialize'
/var/www/miq/vmdb/app/models/manageiq/providers/azure/cloud_manager/refresh_parser.rb:10:in `new'
/var/www/miq/vmdb/app/models/manageiq/providers/azure/cloud_manager/refresh_parser.rb:10:in `ems_inv_to_hashes'
/var/www/miq/vmdb/app/models/manageiq/providers/azure/cloud_manager/refresher.rb:6:in `parse_inventory'
/var/www/miq/vmdb/app/models/ems_refresh/refreshers/ems_refresher_mixin.rb:19:in `block in refresh'
/var/www/miq/vmdb/app/models/ems_refresh/refreshers/ems_refresher_mixin.rb:7:in `each'
/var/www/miq/vmdb/app/models/ems_refresh/refreshers/ems_refresher_mixin.rb:7:in `refresh'
/var/www/miq/vmdb/app/models/manageiq/providers/base_manager/refresher.rb:10:in `refresh'
/var/www/miq/vmdb/app/models/ems_refresh.rb:77:in `block in refresh'
/var/www/miq/vmdb/app/models/ems_refresh.rb:76:in `each'
/var/www/miq/vmdb/app/models/ems_refresh.rb:76:in `refresh'
/var/www/miq/vmdb/app/models/miq_queue.rb:345:in `block in deliver'
/opt/rh/rh-ruby22/root/usr/share/ruby/timeout.rb:89:in `block in timeout'
/opt/rh/rh-ruby22/root/usr/share/ruby/timeout.rb:34:in `block in catch'
/opt/rh/rh-ruby22/root/usr/share/ruby/timeout.rb:34:in `catch'
/opt/rh/rh-ruby22/root/usr/share/ruby/timeout.rb:34:in `catch'
/opt/rh/rh-ruby22/root/usr/share/ruby/timeout.rb:104:in `timeout'
/var/www/miq/vmdb/app/models/miq_queue.rb:341:in `deliver'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:106:in `deliver_queue_message'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:134:in `deliver_message'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:151:in `block in do_work'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:145:in `loop'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:145:in `do_work'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:334:in `block in do_work_loop'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:331:in `loop'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:331:in `do_work_loop'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:153:in `run'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:128:in `start'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:29:in `start_worker'
/var/www/miq/vmdb/lib/workers/bin/worker.rb:2:in `<top (required)>'
/opt/rh/cfme-gemset/gems/railties-4.2.5.1/lib/rails/commands/runner.rb:60:in `load'
/opt/rh/cfme-gemset/gems/railties-4.2.5.1/lib/rails/commands/runner.rb:60:in `<top (required)>'
/opt/rh/cfme-gemset/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:123:in `require'
/opt/rh/cfme-gemset/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:123:in `require_command!'
/opt/rh/cfme-gemset/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:90:in `runner'
/opt/rh/cfme-gemset/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
/opt/rh/cfme-gemset/gems/railties-4.2.5.1/lib/rails/commands.rb:17:in `<top (required)>'
/var/www/miq/vmdb/bin/rails:4:in `require'
/var/www/miq/vmdb/bin/rails:4:in `<main>'


the suggested change filters out all the api versions
Comment 19 Felix Dewaleyne 2016-03-04 11:03:41 EST
I noticed that I missed the "require 'time'" segment after quadruple-checking.
Comment 23 Jeff Teehan 2016-03-28 12:54:37 EDT
No more workarounds are required for 5.5.3 and 5.6.0  Both of these are connecting to and updating Azure out of the box.

Moving to verified.
Comment 25 errata-xmlrpc 2016-06-29 11:34:30 EDT
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
Comment 26 Bronagh Sorota 2016-09-12 13:07:23 EDT
No need for information since this BZ is closed

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