Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ironfan 4.12.3 || 5.0.0 = cluster_ssh = undefined method `length' for nil:NilClass (NoMethodError) #350

Open
moogoos opened this issue Apr 28, 2014 · 8 comments

Comments

@moogoos
Copy link

moogoos commented Apr 28, 2014

4.12.2 does not exhibit this behavior but 4.12.3 and 5.0.0 does. Not sure how to get around it.

Env
centos 6.5 64bit
chef 10.32.2
ruby 1.9.3-p545
rubygems 2.2.2
ironfan 4.12.3 || 5.0.0
ohai 6.22.0

/Users/christian/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/ironfan-5.0.0/lib/chef/knife/cluster_ssh.rb:75:in print_data': undefined methodlength' for nil:NilClass (NoMethodError)
from /Users/christian/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/ironfan-5.0.0/lib/chef/knife/cluster_ssh.rb:73:in block in print_data' from /Users/christian/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/ironfan-5.0.0/lib/chef/knife/cluster_ssh.rb:73:ineach'
from /Users/christian/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/ironfan-5.0.0/lib/chef/knife/cluster_ssh.rb:73:in print_data' from /Users/christian/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/ironfan-5.0.0/lib/chef/knife/cluster_ssh.rb:96:inblock (3 levels) in ssh_command'
from /Users/christian/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/net-ssh-2.8.0/lib/net/ssh/connection/channel.rb:569:in call' from /Users/christian/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/net-ssh-2.8.0/lib/net/ssh/connection/channel.rb:569:indo_data'
from /Users/christian/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:566:in channel_data' from /Users/christian/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:465:indispatch_incoming_packets'
from /Users/christian/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:221:in preprocess' from /Users/christian/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/net-ssh-multi-1.1/lib/net/ssh/multi/server.rb:204:inpreprocess'
from /Users/christian/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/net-ssh-multi-1.1/lib/net/ssh/multi/session.rb:449:in block in preprocess' from /Users/christian/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/net-ssh-multi-1.1/lib/net/ssh/multi/server_list.rb:47:inblock in each'
from /Users/christian/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/net-ssh-multi-1.1/lib/net/ssh/multi/server_list.rb:45:in each' from /Users/christian/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/net-ssh-multi-1.1/lib/net/ssh/multi/server_list.rb:45:ineach'
from /Users/christian/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/net-ssh-multi-1.1/lib/net/ssh/multi/session.rb:449:in preprocess' from /Users/christian/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/net-ssh-multi-1.1/lib/net/ssh/multi/session.rb:430:inprocess'
from /Users/christian/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/net-ssh-multi-1.1/lib/net/ssh/multi/session.rb:417:in block in loop' from /Users/christian/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/net-ssh-multi-1.1/lib/net/ssh/multi/session.rb:417:inloop'
from /Users/christian/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/net-ssh-multi-1.1/lib/net/ssh/multi/session.rb:417:in loop' from /Users/christian/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/ironfan-5.0.0/lib/chef/knife/cluster_ssh.rb:110:inssh_command'
from /Users/christian/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/ironfan-5.0.0/lib/chef/knife/cluster_ssh.rb:132:in _run' from /Users/christian/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/ironfan-5.0.0/lib/chef/knife/ironfan_knife_common.rb:32:inrun'
from /Users/christian/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/ironfan-5.0.0/lib/chef/knife/cluster_kick.rb:55:in run' from /Users/christian/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/chef-10.32.2/lib/chef/knife.rb:408:inrun_with_pretty_exceptions'
from /Users/christian/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/chef-10.32.2/lib/chef/knife.rb:168:in run' from /Users/christian/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/chef-10.32.2/lib/chef/application/knife.rb:125:inrun'
from /Users/christian/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/chef-10.32.2/bin/knife:25:in <top (required)>' from /Users/christian/.rbenv/versions/1.9.3-p545/bin/knife:23:inload'
from /Users/christian/.rbenv/versions/1.9.3-p545/bin/knife:23:in `

'

@nickmarden
Copy link
Contributor

What command results in this error?

@moogoos
Copy link
Author

moogoos commented Apr 30, 2014

knife cluster kick foo. Let me switch to 4.12.3 and get a little more detail.

@nickmarden
Copy link
Contributor

What happens if you replace

display_hostname = @hostname_to_ironfan_hostname[host]

with

display_hostname = @hostname_to_ironfan_hostname[host] || host

?

@moogoos
Copy link
Author

moogoos commented Apr 30, 2014

let me give er a go. queue elevator music

@nickmarden
Copy link
Contributor

@meekmichael, can you think of a case where @hostname_to_ironfan_hostname would not include the/a host that is being knife cluster kick'ed?

@moogoos
Copy link
Author

moogoos commented Apr 30, 2014

  #  display_hostname = @hostname_to_ironfan_hostname[host]
  display_hostname = @hostname_to_ironfan_hostname[host] || host
      if data =~ /\n/
      data.split(/\n/).each { |d| print_data(host, d, err) }
    else
      padding = @longest_ironfan_hostname - display_hostname.length
      str = ui.color(display_hostname, :cyan) + (" " * (padding + 1)) + (err ? ui.color(data, :red) : data)
      ui.msg(str)

/Users/christian/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/ironfan-4.12.3/lib/chef/knife/cluster_ssh.rb:77:in `*': negative argument (ArgumentError)

@nickmarden
Copy link
Contributor

so after this line:

display_hostname = @hostname_to_ironfan_hostname[host] || host

add this:

@longest_ironfan_hostname = [ @longest_ironfan_hostname, display_hostname.length ].compact.max

@moogoos
Copy link
Author

moogoos commented Apr 30, 2014

Good. Too. Go. from some brief testing... Thank you again.

I imagine this will get to HEAD at some point of which I am having issues testing in regards to realms, which are required in 6.x I believe. I will submit an issue to that as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants