Azure Subscription error - Wrong Constant Name $ default


#1

Greetings ,

We have installed a shiny EVM appliance on a Container .We are able to successfully add Azure cloud provider . But we are unable to view any of the instances running on Azure .There is an Error under subscription summary table "Error - 1 Minute Ago wrong constant name $default ". Can you please help ?

I am also share the log output as well :-

Use Ctrl-C to stop
=> Booting Puma
=> Rails 5.0.3 application starting in production on http://127.0.0.1:4000
=> Run rails server -h for more startup options
Puma starting in single mode…

  • Version 3.3.0 (ruby 2.3.1-p112), codename: Jovial Platypus
  • Min threads: 5, max threads: 5
  • Environment: production
  • Listening on tcp://127.0.0.1:4000
    Use Ctrl-C to stop
    Cookie#domain returns dot-less domain name now. Use Cookie#dot_domain if you need “.” at the beginning.
    which: no prince in (/opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/bin:/opt/rh/rh-postgresql95/root/usr/bin:/sbin:/bin:/usr
    /sbin:/usr/bin:/usr/local:/usr/local/sbin:/usr/local/bin:/opt/rubies/ruby-2.3.1/bin)
    [----] E, [2017-07-12T10:59:47.566350 #387:3fac7f829130] ERROR – : MIQ(ManageIQ::Providers::Azure::CloudManager::Refres
    her#refresh) EMS: [COEAzure Subscription], id: [10] Refresh failed
    [----] E, [2017-07-12T10:59:47.569803 #387:3fac7f829130] ERROR – : [NameError]: wrong constant name $default Method:[r
    escue in block in refresh]
    [----] E, [2017-07-12T10:59:47.570006 #387:3fac7f829130] ERROR – : /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/azure-armrest-0.7.0/lib/azure/armrest/model/base_model.rb:166:in const_defined?' /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/azure-armrest-0.7.0/lib/azure/armrest/model/base_model.rb:166:innested
    _object’
    /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/azure-armrest-0.7.0/lib/azure/armrest/model/base_model.rb:157:in `block

#2

As discussed on gitter, I’m pretty sure this was the result of an older version of the azure-armrest gem.


#3

For anyone else who runs across this, it appears in Azure whenever an IoT Hub is created, a storageEndpoints object with a property of $default is present in the template of the hub. The Armrest gem that the Azure provider relies on, until now, did not handle input with dollar signs when doing model generation, as it would try to make a key with a dollar sign.

$ az iot hub list | grep 'storageEndpoints' -A6
      "storageEndpoints": {
        "$default": {
          "connectionString": "",
          "containerName": "",
          "sasTtlAsIso8601": "1:00:00"
        }
      }

Daniel fixed this in the currently-pending PR here. Note so far I can only find the occurrence of a dollar sign in Iot Hubs but it might be elsewhere and I just haven’t found it.