fog / fog-openstack

Fog for OpenStack Platform
MIT License
69 stars 130 forks source link

openstack compute returns getaddrinfo: No such host is known. (SocketError) #451

Closed joyal-ks closed 6 years ago

joyal-ks commented 6 years ago

Hi

I am trying to connect with openstack pike version using fog-openstack version 0.1.20 (due to a project dependency) , even though the connection is successful when I am trying to access flavors or images it throws error :

require 'fog/openstack'

@connection_params = {
  openstack_auth_url:     "http://myip:5000/v2.0/tokens",
  openstack_username:     "admin",
  openstack_api_key:      "mypassword",
  openstack_project_name: "admin"
}
#It's creating the compute object
compute = Fog::Compute::OpenStack.new(@connection_params)
compute.flavors

Error: Traceback (most recent call last): 16: from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/fog-openstack-0.1.20/lib/fog/compute/openstack/models/flavors.rb:11:in all' 15: from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/fog-openstack-0.1.20/lib/fog/compute/openstack/requests/list_flavors_detail.rb:6:inlist_flavors_detail' 14: from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/fog-openstack-0.1.20/lib/fog/openstack/core.rb:81:in request' 13: from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/fog-core-2.1.2/lib/fog/core/connection.rb:79:inrequest' 12: from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/excon-0.62.0/lib/excon/connection.rb:260:in request' 11: from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/excon-0.62.0/lib/excon/middlewares/base.rb:16:inrequest_call' 10: from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/excon-0.62.0/lib/excon/middlewares/base.rb:16:in request_call' 9: from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/excon-0.62.0/lib/excon/middlewares/base.rb:16:inrequest_call' 8: from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/excon-0.62.0/lib/excon/middlewares/instrumentor.rb:26:in request_call' 7: from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/excon-0.62.0/lib/excon/middlewares/mock.rb:48:inrequest_call' 6: from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/excon-0.62.0/lib/excon/connection.rb:111:in request_call' 5: from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/excon-0.62.0/lib/excon/connection.rb:431:insocket' 4: from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/excon-0.62.0/lib/excon/connection.rb:431:in new' 3: from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/excon-0.62.0/lib/excon/socket.rb:30:ininitialize' 2: from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/excon-0.62.0/lib/excon/socket.rb:102:in connect' 1: from C:/tools/ruby25/lib/ruby/gems/2.5.0/gems/excon-0.62.0/lib/excon/socket.rb:102:ingetaddrinfo' Excon::Error::Socket (getaddrinfo: No such host is known. (SocketError))

Has anyone got this issue before ?

Thanks in advance

gildub commented 6 years ago

@joyal-ks, I can't reproduce such getaddrinfo error using fog-openstack 0.1.20 against Pike. That said you're going to need at least fog-openstack 0.1.22 to work with Pike, mainly because of obsolete json format in the requests (See https://github.com/fog/fog-openstack/commit/c6906abf357180dfb81a94f3c345393d63da0f33 for more details.)

joyal-ks commented 6 years ago

@gildub Thanks for prompt response ,is there anywhere it's documented which openstack versions each version fog-openstack supports ? (I know API version support is documented ) cause I would rather not bug you on these version errors :)

gildub commented 6 years ago

@joyal-ks, that's a good point, unfortunately there isn't such compatibility matrix. The main reason is likely the SDK has always tried to be backward compatible by supporting new and old versions of API for each service type. The latest version of fog-openstack should be compatible with current and previous releases of Openstack (in some case a specific version of the API might have to be called).

What you're facing is different as you're trying to use an older version of fog-openstack for a specific Openstack version (Pike). What I would recommend is to use the latest one and take it from there.