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

Some questions:
1) Do the opensuse and ubuntu systems both execute commands on the *same* remote machine ?
2) Do the opensuse and ubuntu systems run the same version of Net::SSH2 ?
3) Is Net::SSH2 built against the same version of the libssh2 library ?
4) Do the opensuse and ubuntu systems both run the same version of perl ?

On my Win32 machine (perl-5.12.0, Net-SSH2-0.33, libssh2-1.2.7) connecting to a linux server, your script runs fine.
It also runs fine if I remove the ext_data() call - so try removing that line of code from your script and see if that makes any difference.

Cheers,
Rob
  • 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 12:04 UTC
    Hi Rob,

    1) Yes. Both execute same commands on the same remote machine.

    2) Yes. Both run the same version of Net::SSH2

    3) Yes. Both have the same libssh2

    4) Yes. Both run the same perl 5.10.0

    This is the debug output of my script : ------------
    libssh2_channel_open_ex(ss->session, pv_channel_type, len_channel_type +, window_size, packet_size, ((void *)0) , 0 ) -> 0x844420c Net::SSH2::Channel::read(size = 8192, ext = 0) - read 0 bytes - read 0 total output is status is 0 Net::SSH2::Channel::DESTROY Net::SSH2::DESTROY object 0x83aaa3c
      Sorry - only other idea I've got is to update the "problem" box to the latest Net::SSH2 and libssh2 (if that's not already the case) and hope that fixes it.

      And just try doing stuff until something happens that makes sense. Do you know if the sent command gets executed on the remote machine ? (I would guess that it does, and that it's only the output that gets lost, but it's something that should be verified.)

      Cheers,
      Rob