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

Azure table storage 403 #29

Open lindhard opened 11 years ago

lindhard commented 11 years ago

I have a ruby script that pulls out statistics from Azure table storage.

Once in a while i get a 403 Forbidden (RestClient::Forbidden) The line that always fails is: mbData = service.query('DataAzureTable', {:expression => "(AuthToken eq '"+customer[:AuthToken]+"')"} )

I'am running the waz-storage 1.3.3

My question is this: I noticed there was a new option called retry_count. Would this be the right strategy to use, since its probably an azure random glitch. How to use the option is not in the documentation yet, would be helpful.

Thanks for a great piece of software!

johnnyhalife commented 11 years ago

Hi @lindhard,

That particular option was introduced by @masahiro-nakajima. He can give you a deeper insight on what does it mean.

masahiro-nakajima commented 11 years ago

Hello @lindhard,

The option 'retry_count' which I added is to retry one request to Azure when an error below happens.

Errno::ETIMEDOUT, Errno::ECONNREFUSED, Errno::ECONNRESET

If one of these errors happens when you are sending a big file to Azure Storage, one request is only a chunk of a file, so it doesn't mean to retry from the beginning.

Would this help you?

lindhard commented 11 years ago

Hello @masahiro-nakajima

Thanks for taking the time to help out.

I'm not sending nor getting files at all, only retrieving basic information from a table.

Where does the argument go e.g.: mbData = service.query('DataAzureTable', {:retry_count => 5, :expression => "(AuthToken eq '"+customer[:AuthToken]+"')"} )

?