Azure/azure-sdk-for-ruby

require azure_sdk 0.31 fails in network_profile_module.rb

Closed this issue · 14 comments

Hello,

if azure_sdk (latest or version 0.31) is rquired within my test ruby file it fails on executing it due to the following error:

$ bundle exec ruby azure-sdk.rb
Traceback (most recent call last):
        10: from azure-sdk.rb:1:in `<main>'
         9: from azure-sdk.rb:1:in `require'
         8: from /azure_sdk_test/azure-ruby/vendor/bundle/ruby/2.6.0/gems/azure_sdk-0.28.0/lib/azure_sdk.rb:9:in `<top (required)>'
         7: from /azure_sdk_test/azure-ruby/vendor/bundle/ruby/2.6.0/gems/azure_sdk-0.28.0/lib/azure_sdk.rb:9:in `require'
         6: from /azure_sdk_test/azure-ruby/vendor/bundle/ruby/2.6.0/gems/azure_sdk-0.28.0/lib/v2018_03_01/v2018_03_01_profile_client.rb:11:in `<top (required)>'
         5: from /azure_sdk_test/azure-ruby/vendor/bundle/ruby/2.6.0/gems/azure_sdk-0.28.0/lib/v2018_03_01/v2018_03_01_profile_client.rb:11:in `require'
         4: from /azure_sdk_test/azure-ruby/vendor/bundle/ruby/2.6.0/gems/azure_sdk-0.28.0/lib/v2018_03_01/modules/network_profile_module.rb:7:in `<top (required)>'
         3: from /azure_sdk_test/azure-ruby/vendor/bundle/ruby/2.6.0/gems/azure_sdk-0.28.0/lib/v2018_03_01/modules/network_profile_module.rb:8:in `<module:V2018_03_01>'
         2: from /azure_sdk_test/azure-ruby/vendor/bundle/ruby/2.6.0/gems/azure_sdk-0.28.0/lib/v2018_03_01/modules/network_profile_module.rb:9:in `<module:Network>'
         1: from /azure_sdk_test/azure-ruby/vendor/bundle/ruby/2.6.0/gems/azure_sdk-0.28.0/lib/v2018_03_01/modules/network_profile_module.rb:48:in `<module:Mgmt>'
/azure_sdk_test/azure-ruby/vendor/bundle/ruby/2.6.0/gems/azure_sdk-0.28.0/lib/v2018_03_01/modules/network_profile_module.rb:50:in `<module:Models>': uninitialized constant Azure::Network::Mgmt::V2017_03_30::Models::EndpointService (NameError)

My ruby-test:

require 'azure_sdk'

# Provide credentials
options = {
  tenant_id: ENV['AZURE_TENANT_ID'],
  client_id: ENV['AZURE_CLIENT_ID'],
  client_secret: ENV['AZURE_CLIENT_SECRET'],
  subscription_id: ENV['AZURE_SUBSCRIPTION_ID']
}

# Target profile built for Latest Compute
profile_client = Azure::Compute::Profiles::Latest::Mgmt::Client.new(options)
pp profile_client

There was a similar issue solved in #2387.

Hello. It seems that you are using azure-sdk-28.0

There may be some breaking change happened in the azure_mgmt_network. The EndpointService has been removed. While, you install the new version of azure_mgmt_network.

I cleaned up my vendor directory and Gembile.lock.
Now the installation fails with:

]$ bundle install --path ./vendor/bundle --jobs=8
Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
Bundler could not find compatible versions for gem "azure_mgmt_cosmosdb":
  In Gemfile:
    azure_sdk (~> 0.31) was resolved to 0.31.1, which depends on
      azure_mgmt_cosmosdb (~> 0.18.0)

Could not find gem 'azure_mgmt_cosmosdb (~> 0.18.0)', which is required by gem 'azure_sdk (~> 0.31)', in any of the sources.

sorry for the delay due to quite low bandwidth. Usually it's env problem. The azure_sdk will require azure_mgmt_cosmosdb 0.18.0. My suggestion is to use rvm.

my assumption is that require 'azure_sdk' will get whatever is required.

It failed for 0.31.1 but it loaded all required packages for version 0.27.1.

I'm using rbenv & bundler.

sorry for the delay due to quite low bandwidth. Usually it's env problem. The azure_sdk will require azure_mgmt_cosmosdb 0.18.0. My suggestion is to use rvm.

azure_mgmt_cosmosdb 0.18.0 isn't available yet on rubygems.org.
https://rubygems.org/gems/azure_mgmt_cosmosdb

@tbugfinder Thanks. I will fix this one.

I see the same dependency issue. There is no azure_mgmt_cosmosdb (~> 0.18.0) at rubygems.

I see the same dependency issue. There is no azure_mgmt_cosmosdb (~> 0.18.0) at rubygems.

Hello. I will temporarily decrease the dependency version. The previous maintainer used his own key to upload the azure_mgmt_cosmodb 0.17.0 so that I cannot upload the 0.18.0. I'm discussing with him. I will make a workaround today.

It is still broken. azure_sdk depends on azure_mgmt_policy ~> 0.17.5. But rubygems has 0.17.4 only.

Please change the dependency requirement to azure_mgmt_policy ~> 0.17.4.

@anatol truly thanks. Fixed https://rubygems.org/gems/azure_mgmt_policy/versions/0.17.5. I have talked with previous owner and he has transferred the ownership to the Azure account. I will fix the issue about cosmosdb in the next version.

@anatol let us know if you are still experiencing the issue

Thank you for your interest in Azure SDKs. As detailed in this retirement announcement, this repo is no longer supported as of December 31st 2021. Please find the up-to-date list of languages and services supported with Azure SDKs here: https://aka.ms/azsdk