pcorliss / ruby_route_53

Ruby gem and command line tool for Amazon's Route 53 service.
blog.50projects.com
GNU General Public License v3.0
172 stars 32 forks source link

RuntimeError: The underlying hash algorithm has not yet been initialized. #10

Closed twhaples closed 10 years ago

twhaples commented 13 years ago

I've got a script which looks something like this; it's about as simple as I could come up with.

def shakedown
    conn = Route53::Connection.new(@key, @secret)
    puts conn.get_zones.inspect
end

It results in a backtrace like the following.`` RuntimeError: The underlying hash algorithm has not yet been initialized. /Users/me/.rvm/gems/ruby-1.9.2-p180@snet/gems/ruby-hmac-0.4.0/lib/hmac.rb:36:incheck_status' /Users/me/.rvm/gems/ruby-1.9.2-p180@snet/gems/ruby-hmac-0.4.0/lib/hmac.rb:68:in update' /Users/me/.rvm/gems/ruby-1.9.2-p180@snet/gems/route53-0.2.1/lib/route53.rb:41:inrequest' /Users/me/.rvm/gems/ruby-1.9.2-p180@snet/gems/route53-0.2.1/lib/route53.rb:63:in get_zones' /Users/me/git/ops/dns.rb:19:inshakedown'

noeticpenguin commented 13 years ago

I'm having the exact same issue. -- on OSX: Lion Using this version of hmac.rb, however, fixes the issue. http://code.google.com/p/cloudcache-ruby/source/browse/trunk/lib/hmac.rb?r=10

pcorliss commented 10 years ago

Sorry for the long-long delay on this. But I'm having trouble reproing your issue. Presumably you've moved onto another problem or solved this one already. Please reopen if you're still encountering the error.

pcorliss commented 10 years ago

FYI, I was able to repro this by passing in nil in. Double check that @key and @secret are filled in.

2.0.0-p353 :003 > conn = Route53::Connection.new(nil, nil)
 => #<Route53::Connection:0x00000102323770 @accesskey=nil, @secret=nil, @api="2012-12-12", @endpoint="https://route53.amazonaws.com/", @base_url="https://route53.amazonaws.com/2012-12-12", @verbose=false, @ssl_no_verify=false> 
2.0.0-p353 :004 > conn.get_zones
RuntimeError: The underlying hash algorithm has not yet been initialized.
    from /Users/pcorliss/.rvm/gems/ruby-2.0.0-p353@route53/gems/ruby-hmac-0.4.0/lib/hmac.rb:36:in `check_status'
    from /Users/pcorliss/.rvm/gems/ruby-2.0.0-p353@route53/gems/ruby-hmac-0.4.0/lib/hmac.rb:68:in `update'
    from /Users/pcorliss/git/ruby_route_53/lib/route53/connection.rb:28:in `request'
    from /Users/pcorliss/git/ruby_route_53/lib/route53/connection.rb:50:in `get_zones'
    from (irb):4
    from /Users/pcorliss/.rvm/rubies/ruby-2.0.0-p353/bin/irb:12:in `<main>'
recurser commented 9 years ago

Thanks @pcorliss - I had the same issue, and it turned out that key and secret were blank.