reset / ridley-connectors

A Connector API for talking to nodes managed by Chef
Other
6 stars 6 forks source link

NoMethod error when running ridley.node.bootstrap #5

Closed elmundio87 closed 10 years ago

elmundio87 commented 10 years ago

I'm having an issue when trying to run the ridley-connectors bootstrap method on a node, the method doesn't seem to exist.

I have installed ridley (2.1.0) and ridley-connectors (1.1.0) using Rubygems. This issue is happening on my windows and OSX environments.

Is there something I'm missing here?

My code:

require 'ridley'

ridley =  Ridley.new(
  server_url: "https://api.opscode.com/organizations/elmundio87",
  client_name: "elmundio87-validator",
  client_key: "/Users/edmundd/.chef/elmundio87-validator.pem",
  winrm: {
    user: "user",
    password: "password"
  }
)

ridley.node.bootstrap("127.0.0.1") #Error happens here

The error:

NoMethodError: E, [2014-01-07T11:58:59.678797 #8204] ERROR -- : Ridley::NodeResource crashed!
Celluloid::DeadTaskError: cannot resume a dead task (dead fiber called)
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/tasks/task_fiber.rb:27:in `rescue in deliver'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/tasks/task_fiber.rb:23:in `deliver'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/tasks.rb:98:in `resume'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/responses.rb:11:in `dispatch'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/actor.rb:327:in `handle_message'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/actor.rb:174:in `run'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/actor.rb:157:in `block in initialize'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/thread_handle.rb:13:in `block in initialize'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/internal_pool.rb:100:in `call'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/internal_pool.rb:100:in `block in create'
undefined method `bootstrap' for #<Ridley::NodeResource:0x2c23068>
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/calls.rb:25:in `public_send'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/calls.rb:25:in `dispatch'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/calls.rb:67:in `dispatch'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/actor.rb:322:in `block in handle_message'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/actor.rb:416:in `block in task'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/tasks.rb:55:in `block in initialize'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/tasks/task_fiber.rb:13:in `block in create'
        from (celluloid):0:in `remote procedure call'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/calls.rb:92:in `value'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/proxies/sync_proxy.rb:33:in `method_missing'
        from (irb):14
        from C:/Ruby193/bin/irb:12:in `<main>'
KAllan357 commented 10 years ago

I believe the error might be in your first line of your gist there. You'll want to require "ridley-connectors" over plain old ridley.

elmundio87 commented 10 years ago

Unfortunately that didn't work, I'm getting the same error even if I add require "ridley-connectors"

elmundio87 commented 10 years ago

Correction, there are some references to ridley-connectors in the stack trace that weren't there before

E, [2014-01-07T19:19:16.804349 #7644] ERROR -- : Ridley::HostCommander crashed!
NoMethodError: undefined method `[]' for nil:NilClass
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/ridley-connectors-1.1.0/lib/ridley-connectors/host_commander.rb:174:in `connector_for'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/ridley-connectors-1.1.0/lib/ridley-connectors/host_commander.rb:193:in `execute'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/ridley-connectors-1.1.0/lib/ridley-connectors/host_commander.rb:64:in `bootstrap'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/calls.rb:25:in `public_send'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/calls.rb:25:in `dispatch'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/calls.rb:67:in `dispatch'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/actor.rb:322:in `block in handle_message'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/actor.rb:416:in `block in task'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/tasks.rb:55:in `block in initialize'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/tasks/task_fiber.rb:13:in `block in create'
E, [2014-01-07T19:19:16.805349 #7644] ERROR -- : Ridley::NodeResource crashed!
NoMethodError: undefined method `[]' for nil:NilClass
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/ridley-connectors-1.1.0/lib/ridley-connectors/host_commander.rb:174:in `connector_for'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/ridley-connectors-1.1.0/lib/ridley-connectors/host_commander.rb:193:in `execute'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/ridley-connectors-1.1.0/lib/ridley-connectors/host_commander.rb:64:in `bootstrap'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/calls.rb:25:in `public_send'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/calls.rb:25:in `dispatch'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/calls.rb:67:in `dispatch'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/actor.rb:322:in `block in handle_message'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/actor.rb:416:in `block in task'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/tasks.rb:55:in `block in initialize'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/tasks/task_fiber.rb:13:in `block in create'
        (celluloid):0:in `remote procedure call'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/calls.rb:92:in `value'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/proxies/sync_proxy.rb:33:in `method_missing'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/ridley-connectors-1.1.0/lib/ridley-connectors/resources/node_resource.rb:91:in `bootstr
ap'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/calls.rb:25:in `public_send'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/calls.rb:25:in `dispatch'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/calls.rb:67:in `dispatch'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/actor.rb:322:in `block in handle_message'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/actor.rb:416:in `block in task'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/tasks.rb:55:in `block in initialize'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/tasks/task_fiber.rb:13:in `block in create'
NoMethodError: undefined method `[]' for nil:NilClass
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ridley-connectors-1.1.0/lib/ridley-connectors/host_commander.rb:174:in `connector_
for'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ridley-connectors-1.1.0/lib/ridley-connectors/host_commander.rb:193:in `execute'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ridley-connectors-1.1.0/lib/ridley-connectors/host_commander.rb:64:in `bootstrap'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/calls.rb:25:in `public_send'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/calls.rb:25:in `dispatch'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/calls.rb:67:in `dispatch'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/actor.rb:322:in `block in handle_message'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/actor.rb:416:in `block in task'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/tasks.rb:55:in `block in initialize'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/tasks/task_fiber.rb:13:in `block in create'
        from (celluloid):0:in `remote procedure call'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/calls.rb:92:in `value'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/proxies/sync_proxy.rb:33:in `method_missing'
from (irb):14
        from C:/Ruby193/bin/irb:12:in `<main>'irb(main):015:0> E, [2014-01-07T19:19:16.811350 #7644] ERROR -- : Ridley::ConnectorSupervisor crashed!
RuntimeError: a group member went missing. This shouldn't be!
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/supervision_group.rb:103:in `restart_actor'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/actor.rb:357:in `handle_exit_event'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/actor.rb:340:in `block in handle_system_event'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/actor.rb:416:in `block in task'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/tasks.rb:55:in `block in initialize'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/tasks/task_fiber.rb:13:in `block in create'
KAllan357 commented 10 years ago

This seems to make a bit more sense now. So you no longer get the "method undefined" error and now it is a different one. Progress!

The error you are receiving could be because of a bad configuration. The line in the error here makes me think that the "ssh" Hash is nil for some reason.

This could be a bug, but maybe its worth trying to define an ssh Hash in your config as a workaround.

elmundio87 commented 10 years ago

Seems that adding the SSH hash into the ridley config did the trick. I'm no longer getting the "method undefined" error - thanks a lot for your help!

KAllan357 commented 10 years ago

You are welcome! I will file a bug and post it here to double check this error case.