iron-io / iron_worker_ruby_ng

Next Gen Ruby gem for IronWorker
www.iron.io
BSD 2-Clause "Simplified" License
58 stars 22 forks source link

IronCore::Error: Expecting 24 symbol project_id string #112

Closed chrisvariety closed 12 years ago

chrisvariety commented 12 years ago

I have an initializer set up like so:

if Rails.env.development?
  ENV['IRON_WORKER_TOKEN'] = 'xxx'
  ENV['IRON_WORKER_PROJECT_ID'] = 'yyy'
end
IronCore::Logger.logger.level = ::Logger::DEBUG

Whenever I try to create a new client, I'm getting the error message IronCore::Error: Expecting 24 symbol project_id string

Here's my full backtrace:

$ rails c
Expecting 24 symbol project_id strinLoading development environment (Rails 3.2.8)
1.9.3-p194-fast :001 > IronWorkerNG::Client.new
Setting project_id to 'yyy' from environment variable
Setting token to 'xxx' from environment variable
Setting scheme to 'https' from defaults
Setting host to 'worker-aws-us-east-1.iron.io' from defaults
Setting port to '443' from defaults
Setting user_agent to 'iron_worker_ruby_ng-0.9.6 (iron_core_ruby-0.3.3)' from defaults
Setting api_version to '2' from defaults
Expecting 24 symbol project_id string
IronCore::Error: Expecting 24 symbol project_id string
    from /Users/chrismcc/.rvm/gems/ruby-1.9.3-p194-fast@amanda/gems/iron_core-0.3.3/lib/iron_core/logger.rb:50:in `raise_exception'
    from /Users/chrismcc/.rvm/gems/ruby-1.9.3-p194-fast@amanda/gems/iron_core-0.3.3/lib/iron_core/logger.rb:27:in `error'
    from /Users/chrismcc/.rvm/gems/ruby-1.9.3-p194-fast@amanda/gems/iron_core-0.3.3/lib/iron_core/client.rb:225:in `check_id'
    from /Users/chrismcc/.rvm/gems/ruby-1.9.3-p194-fast@amanda/gems/iron_worker_ng-0.9.6/lib/iron_worker_ng/api_client.rb:22:in `initialize'
    from /Users/chrismcc/.rvm/gems/ruby-1.9.3-p194-fast@amanda/gems/iron_worker_ng-0.9.6/lib/iron_worker_ng/client.rb:28:in `new'
    from /Users/chrismcc/.rvm/gems/ruby-1.9.3-p194-fast@amanda/gems/iron_worker_ng-0.9.6/lib/iron_worker_ng/client.rb:28:in `initialize'
    from (irb):1:in `new'
    from (irb):1
    from /Users/chrismcc/.rvm/gems/ruby-1.9.3-p194-fast@amanda/gems/railties-3.2.8/lib/rails/commands/console.rb:47:in `start'
    from /Users/chrismcc/.rvm/gems/ruby-1.9.3-p194-fast@amanda/gems/railties-3.2.8/lib/rails/commands/console.rb:8:in `start'
    from /Users/chrismcc/.rvm/gems/ruby-1.9.3-p194-fast@amanda/gems/railties-3.2.8/lib/rails/commands.rb:41:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

As you can see, the debug messages say it is setting the project_id properly, so I don't understand why I am getting this error. :(

I did a little more digging and added a puts id in check_id and it is just returning nil, so I don't think it is a length issue. I've confirmed that the project_id I am providing is 24 characters long.

Help please? Thanks!

chrisvariety commented 12 years ago

Nevermind... I got the project_id and token confused... long day. Thanks anyhow. IronWorker looks great.

adelevie commented 11 years ago

Maybe the error could kindly suggest the possible reason eg ("check to make sure you didn't reverse your token and project_id).