I have a strange crash in a very simple program which fetches the
configuration of an HP Procurve switch using SFTP.
The program is here:
#!/usr/bin/env ruby
require ''rubygems''
require ''net/sftp''
Net::SFTP.start(''10.0.6.1'', ''root'') { |sftp|
data = nil
sftp.open_handle("/cfg/startup-config") do |handle|
data = sftp.read(handle)
end
puts data
}
When run, I get this:
[output deleted]
ip ssh
ip ssh filetransfer
password manager
password operator
/usr/lib/ruby/gems/1.8/gems/net-ssh-1.1.2/lib/net/ssh/transport/packet-stream.rb:202:in
`<<'': can''t convert nil into String (TypeError)
from
/usr/lib/ruby/gems/1.8/gems/net-ssh-1.1.2/lib/net/ssh/transport/packet-stream.rb:202:in
`read''
from
/usr/lib/ruby/gems/1.8/gems/net-ssh-1.1.2/lib/net/ssh/transport/packet-stream.rb:153:in
`get''
from
/usr/lib/ruby/gems/1.8/gems/net-ssh-1.1.2/lib/net/ssh/transport/packet-stream.rb:147:in
`synchronize''
from
/usr/lib/ruby/gems/1.8/gems/net-ssh-1.1.2/lib/net/ssh/transport/packet-stream.rb:147:in
`get''
from
/usr/lib/ruby/gems/1.8/gems/needle-1.3.0/lib/needle/lifecycle/proxy.rb:60:in
`__send__''
from
/usr/lib/ruby/gems/1.8/gems/needle-1.3.0/lib/needle/lifecycle/proxy.rb:60:in
`method_missing''
from
/usr/lib/ruby/gems/1.8/gems/net-ssh-1.1.2/lib/net/ssh/transport/session.rb:263:in
`wait_for_message''
from
/usr/lib/ruby/gems/1.8/gems/net-ssh-1.1.2/lib/net/ssh/transport/session.rb:258:in
`loop''
from
/usr/lib/ruby/gems/1.8/gems/net-ssh-1.1.2/lib/net/ssh/transport/session.rb:258:in
`wait_for_message''
from
/usr/lib/ruby/gems/1.8/gems/net-ssh-1.1.2/lib/net/ssh/connection/driver.rb:151:in
`process''
from
/usr/lib/ruby/gems/1.8/gems/net-ssh-1.1.2/lib/net/ssh/connection/driver.rb:141:in
`loop''
from
/usr/lib/ruby/gems/1.8/gems/net-ssh-1.1.2/lib/net/ssh/session.rb:186:in
`loop''
from
/usr/lib/ruby/gems/1.8/gems/net-sftp-1.1.0/lib/net/sftp/session.rb:70:in
`initialize''
from /usr/lib/ruby/gems/1.8/gems/net-sftp-1.1.0/lib/net/sftp.rb:29:in
`new''
from /usr/lib/ruby/gems/1.8/gems/net-sftp-1.1.0/lib/net/sftp.rb:29:in
`start''
from ./check_router.rb:5
I''m running with net-sftp-1.1.0 and net-ssh-1.1.2 Thanks in advance for
any hints!
/Benny