azure-sdk-for-ruby icon indicating copy to clipboard operation
azure-sdk-for-ruby copied to clipboard

require azure_sdk 0.31 fails in network_profile_module.rb

Open tbugfinder opened this issue 6 years ago • 13 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.

tbugfinder avatar Jul 30 '19 05:07 tbugfinder

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

mmyyrroonn avatar Jul 30 '19 05:07 mmyyrroonn

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.

mmyyrroonn avatar Jul 30 '19 05:07 mmyyrroonn

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.

tbugfinder avatar Jul 31 '19 11:07 tbugfinder

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.

mmyyrroonn avatar Aug 06 '19 02:08 mmyyrroonn

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.

tbugfinder avatar Aug 06 '19 15:08 tbugfinder

I'm using rbenv & bundler.

tbugfinder avatar Aug 06 '19 15:08 tbugfinder

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 avatar Aug 06 '19 15:08 tbugfinder

@tbugfinder Thanks. I will fix this one.

mmyyrroonn avatar Aug 07 '19 01:08 mmyyrroonn

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

anatol avatar Aug 13 '19 19:08 anatol

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.

mmyyrroonn avatar Aug 14 '19 01:08 mmyyrroonn

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 avatar Aug 17 '19 17:08 anatol

@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.

mmyyrroonn avatar Aug 19 '19 08:08 mmyyrroonn

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

nickzhums avatar Jan 21 '20 09:01 nickzhums

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

kurtzeborn avatar Jan 11 '23 03:01 kurtzeborn