Net::SSH Failure Vs. 0.6.0

O

otaku

Code Producing Errors
==============
require 'needle'
require 'net/ssh'

Net::SSH.start( 'system.domain.com', 9090, 'username', 'password' )
do |session|

session.process.open( "bc" ) do |bc|
dialog = [ "5+5", "7*12", "sqrt(2.000000)", "quit" ]

bc.on_success do |p|
puts "requesting result of #{dialog.first}"
p.puts dialog.shift
end

bc.on_stdout do |p,data|
puts "--> #{data}"
unless dialog.empty?
puts "requesting result of #{dialog.first}"
p.puts dialog.shift
end
end

bc.on_exit do |p, status|
puts "process finished with exit status: #{status}"
end
end

end
==============

SSHD Server Running on Port 9090

===============

Ruby Version:
ruby 1.8.2 (2004-12-25) [powerpc-darwin7.7.0]

===============
OpenSSL Version:
Openssl 0.9.7e
================
ERRORS
======
/usr/local/lib/ruby/site_ruby/1.8/net/ssh/userauth/agent.rb:70:in
`initialize': cannot convert nil into String (TypeError)
from /usr/local/lib/ruby/site_ruby/1.8/net/ssh/userauth/agent.rb:70:in
`open'
from /usr/local/lib/ruby/site_ruby/1.8/net/ssh/userauth/agent.rb:70:in
`connect!'
from
/usr/local/lib/ruby/site_ruby/1.8/net/ssh/userauth/services.rb:51:in
`register_services'
from
/usr/local/lib/ruby/site_ruby/1.8/net/ssh/userauth/services.rb:40:in
`call'
from /usr/local/lib/ruby/site_ruby/1.8/needle/service-point.rb:117:in
`instance'
from /usr/local/lib/ruby/site_ruby/1.8/needle/container.rb:308:in `[]'
from
/usr/local/lib/ruby/site_ruby/1.8/net/ssh/userauth/services.rb:60:in
`open'
from
/usr/local/lib/ruby/site_ruby/1.8/net/ssh/userauth/services.rb:60:in
`open'
.... 6 levels...
from /usr/local/lib/ruby/site_ruby/1.8/net/ssh/session.rb:114:in
`initialize'
from /usr/local/lib/ruby/site_ruby/1.8/net/ssh.rb:47:in `new'
from /usr/local/lib/ruby/site_ruby/1.8/net/ssh.rb:47:in `start'
from /Applications/Downloads2/eclipse/workspace/System/ssh.rb:4

=======
END ERRORS

NOTE OpenSSL Patch Not Applied
assume openssl patch was merged into Ruby 1.8.2 stable
Please Advise:

Otaku.
 
O

otaku

Update Added the openssl-snapshot-20040726.tar.bz2 path to Ruby 1.8.2
stable
and I still get the same errors as listed above

using Net::SSH 0.1.0 the above example works

However the above example code does not work with Net::SSH 0.6.0
the above example code is straight out of the Net::SSH documentation
by the maintainer of the project Jamis Buck
any ideas anyone ???......

Otaku
 
J

Jamis Buck

Update Added the openssl-snapshot-20040726.tar.bz2 path to Ruby 1.8.2
stable
and I still get the same errors as listed above

using Net::SSH 0.1.0 the above example works

However the above example code does not work with Net::SSH 0.6.0
the above example code is straight out of the Net::SSH documentation
by the maintainer of the project Jamis Buck
any ideas anyone ???......

Yup, this is a bug that has been fixed and will be rolled out in the
upcoming 0.9 release.

The bug occurs because the code always tries to use the agent, even
when no agent is running (or, in your case, when no agent is
needed--you're giving the password explicitly). You can work around
this by doing the following:

Net::SSH.start( 'host', port, 'user', 'password',
:auth_methods => "password"
) do |session|
...
end

In other words, if you explicitly specify the authentication method
you want to use, the agent will never be attempted.

The next release should (hopefully) be ready by late next week, or the
week after that at the VERY latest. (I'm going to be pretty busy this
week, so we'll see what happens.)

Incidentally, if you want to play with the latest version of the code,
it is now being hosted in a subversion repository:

http://www.jamisbuck.org/svn/net-ssh

- Jamis
 
O

otaku

Jamis,

thank you for the detailed response
and thank you for the code work around

i will checkout the latest version and test that

i utilize your net-ssh module in a production env to automate a
bazillion tasks and to monitor various
systems

currently i reverted to past known working version of the module
so my scripts still function
your work is greatly appreciated on this project!!!

Otaku
 
J

Jamis Buck

Jamis,

thank you for the detailed response
and thank you for the code work around

i will checkout the latest version and test that

i utilize your net-ssh module in a production env to automate a
bazillion tasks and to monitor various
systems

Ah, a guinea pig! :) I would certainly appreciate your continued bug
reporting, in that case. You can always ask questions to this list,
but bugs for Net::SSH should also be reported to the bug tracker at
http://rubyforge.org/projects/net-ssh so that they don't get missed.
currently i reverted to past known working version of the module
so my scripts still function

Good plan. Not that 0.1 is any more stable, in general, than 0.6, but
hopefully the upcoming 0.9 will be more stable than either of those
releases.
your work is greatly appreciated on this project!!!

Thanks!

- Jamis
 
O

otaku

Jamis,

noted on the bug tracking
i will report any future bugs i run into to
the above defined URL

Otaku
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top