fog / fog-openstack

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

Fog::Image::OpenStack.new gives connection_write timeout #154

Open daibhidh opened 8 years ago

daibhidh commented 8 years ago

I am not sure if I am just doing something wrong, but every time I try to connect to Glance through fog I get connection_write timeouts. Identity, compute, etc work fine. The 'python' api's work from the same system, just not Fog::Image::OpenStack.new.

Example of what I am doing and getting:

irb(main):002:0> require 'fog'
irb(main):002:0> @c = { :openstack_username => 'my-username', :openstack_tenant => 'my-tenant',  :openstack_api_key => 'my-secret-password', :openstack_auth_url => 'https://my-keystone- server:5000/v2.0/tokens' }
irb(main):003:0> image = Fog::Image::OpenStack.new @c
Excon::Error::Timeout: connect_write timeout reached
from /users/davros/.gem/ruby/gems/excon-0.50.1/lib/excon/socket.rb:266:in `select_with_timeout'
from /users/davros/.gem/ruby/gems/excon-0.50.1/lib/excon/socket.rb:130:in `rescue in block in connect'
from /users/davros/.gem/ruby/gems/excon-0.50.1/lib/excon/socket.rb:111:in `block in connect'
from /users/davros/.gem/ruby/gems/excon-0.50.1/lib/excon/socket.rb:102:in `each'
from /users/davros/.gem/ruby/gems/excon-0.50.1/lib/excon/socket.rb:102:in `connect'
from /users/davros/.gem/ruby/gems/excon-0.50.1/lib/excon/socket.rb:28:in `initialize'
from /users/davros/.gem/ruby/gems/excon-0.50.1/lib/excon/connection.rb:406:in `new'
from /users/davros/.gem/ruby/gems/excon-0.50.1/lib/excon/connection.rb:406:in `socket'
from /users/davros/.gem/ruby/gems/excon-0.50.1/lib/excon/connection.rb:106:in `request_call'
from /users/davros/.gem/ruby/gems/excon-0.50.1/lib/excon/middlewares/mock.rb:47:in `request_call'
from /users/davros/.gem/ruby/gems/excon-0.50.1/lib/excon/middlewares/instrumentor.rb:25:in `request_call'
from /users/davros/.gem/ruby/gems/excon-0.50.1/lib/excon/middlewares/base.rb:15:in `request_call'
from /users/davros/.gem/ruby/gems/excon-0.50.1/lib/excon/middlewares/base.rb:15:in `request_call'
from /users/davros/.gem/ruby/gems/excon-0.50.1/lib/excon/middlewares/base.rb:15:in `request_call'
from /users/davros/.gem/ruby/gems/excon-0.50.1/lib/excon/connection.rb:250:in `request'
from /users/davros/.gem/ruby/gems/fog-core-1.42.0/lib/fog/core/connection.rb:81:in `request'
from /users/davros/.gem/ruby/gems/fog-openstack-0.1.7/lib/fog/openstack.rb:516:in `get_supported_version_path'
from /users/davros/.gem/ruby/gems/fog-openstack-0.1.7/lib/fog/openstack/image_v2.rb:127:in `initialize'
from /users/davros/.gem/ruby/gems/fog-core-1.42.0/lib/fog/core/service.rb:115:in `new'
from /users/davros/.gem/ruby/gems/fog-core-1.42.0/lib/fog/core/service.rb:115:in `new'
from /users/davros/.gem/ruby/gems/fog-openstack-0.1.7/lib/fog/openstack/image.rb:12:in `new'
from (irb):13
from /usr/bin/irb:12:in `<main>'irb(main):004:0> 

Seeing as All other calls with Fog work, and the python api's work for glance from the same system I am at a loss as to what the actual problem is.

Ladas commented 8 years ago

weird, seems the same as the updated sample, that was tested just days ago https://github.com/fog/fog-openstack/blob/master/examples/image/upload-test-image.rb

Seems like a valid timeout when trying to talk to glance endpoint. Can you check if python CLI works for you from the same place?

shaneboulden commented 7 years ago

I realise this is an older issue, but I just ran into the exact problem today with Glance. The issue was that I was trying to communicate on 'adminURL' when it wasn't available - setting the :openstack_endpoint_type to an available endpoint (in this case 'publicURL') solved the issue.