johnnyhalife / waz-storage

A simple implementation of Windows Azure Storage API for Ruby, inspired by the S3 gems and self experience of dealing with queues. The major goal of the whole gem is to enable ruby developers [like me =)] to leverage Windows Azure Storage features and have another option for cloud storage.
http://waz-storage.heroku.com
MIT License
40 stars 21 forks source link

SocketError - getaddrinfo: Name or service not known #35

Closed cometbalan closed 11 years ago

cometbalan commented 11 years ago

Hi,

I am trying to use WAZ-Storage gem to upload blob files into Windows Azure Storage. Below is the code i am using (Rails)

my_options = {}

my_options[:account_name] = 'testaccount'
my_options[:access_key] = 'primary_access_key'
my_options[:use_devenv] = false
my_options[:base_url] = 'http://testaccount.blob.core.windows.net/'
WAZ::Storage::Base.establish_connection(my_options) 
WAZ::Blobs::Container.find("test-container")  <<i get the below error in this line>>

but when executing the above code, i get the error

SocketError - getaddrinfo: Name or service not known

Note

1) I have created a storage named 'testaccount' in windows azure account 2) I have created a container named 'test-container'

not sure what i am doing wrong.. it would be helpful if i have some sample to run and test..

johnnyhalife commented 11 years ago

hi @cometbalan,

If you aren't using the local storage simulator, try not setting the :base_url, do something like

WAZ::Storage::Base.establish_connection!({:access_key => 'key', :account_name => 'youraccount'}) 
cometbalan commented 11 years ago

I tried connecting the Azure storage with below, and tried to find a Container named 'facontainer' which i have created in my windows azure account. But it shows RestClient::Forbidden - 403 Forbidden

WAZ::Storage::Base.establish_connection({:account_name => account_name, :access_key => access_key})

WAZ::Blobs::Container.find("facontainer")

Also i am using correct account name and key i obtained by logging into Windows Azure Storage account.

NOTE: WAZ::Storage::Base.connected? returns true, but any operation like container find, list etc., returns forbidden.