Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Net::SSH2::Channel with exec, reads 0 bytes on suse while works fine on ubuntu

by Illuminatus (Curate)
on Apr 03, 2011 at 00:32 UTC ( [id://897130]=note: print w/replies, xml ) Need Help??


in reply to Net::SSH2::Channel with exec, reads 0 bytes on suse while works fine on ubuntu

I have not personally used Net::SSH2:Channel, and the cpan documentation does not make it clear what the flag means for blocking. I would assume that 1 means blocking, but are you sure? You are not checking the results of any of the methods after the connect. However, if the auth was failing, I'm pretty sure the channel would return undef, so your first use of it would fail in an obvious way.

Your example program is not displaying $len, so I'm assuming that in some previous incarnation, you printed it out. If you did not, and are going by the print statement for $output, then the read method could have failed.

Have you compared the ssh2 library versions for the 2 remote systems? I would make sure I was using the same lib version on both before I checked anything else.

fnord

  • Comment on Re: Net::SSH2::Channel with exec, reads 0 bytes on suse while works fine on ubuntu

Replies are listed 'Best First'.
Re^2: Net::SSH2::Channel with exec, reads 0 bytes on suse while works fine on ubuntu
by madhurikl (Novice) on Apr 03, 2011 at 11:58 UTC
    Hi fnord,

    I just didnt include the error handling stuff to make the question and the code simple to understand.

    a) The channel is successfully created.

    b) I tried with both blocking(0) and blocking(1). However, I need a blocking call, and as per my knowledge, blocking(1) sets the blocking.

    c) $len returns 0. I can see the number of bytes read because I have debug enabled.

    d) Yes. ssh2 library versions are same on both the ubuntu machine and the opensuse machine. I am also connecting to the same remote machine from both the systems.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://897130]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-04-24 06:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found