Skip Menu |

This queue is for tickets about the Perl-Dist-Strawberry CPAN distribution.

Report information
The Basics
Id: 80011
Status: resolved
Priority: 0/
Queue: Perl-Dist-Strawberry

People
Owner: Nobody in particular
Requestors: chris [...] mcroberts.co
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: But Report: SP 5.16 and Net::SSH2 scp_get
Date: Thu, 04 Oct 2012 10:29:32 -0700
To: bug-Perl-Dist-Strawberry [...] rt.cpan.org
From: <chris [...] mcroberts.co>
Hi,

My apologies in advance if this is in some way user error.

While trying to upgrade from Strawberry Perl 5.12 to 5.16, I found that scp_get in Net:SSH2 has stopped working.  General Channel functions work, and scp_put works, but scp_get does not.  It is claiming to only download 1 byte, almost as if its skipping the actual file download and going straight to closing the Channel activity.

To create the problem, I simply unzipped the distributions, launched the portableshell.bat for each one, navigated to my script directory and tried to run it.

Perl Versions:
    strawberry-perl-5.12.3.0-portable (Works)
    strawberry-perl-5.16.1.1-32bit-portable (Fails)
    strawberry-perl-5.16.1.1-64bit-portable (Fails)

Windows Host 1 Version:  Windows 7 Enterprise, Version 6.1, Build 7600, 64-bit
Windows Host 2 Version:  Windows 7 Enterprise, Version 6.1, Build 7601, SP1, 64-bit
SSH2 Destination Host Version:  Red Hat Enterprise Linux AS release 4 (Nahant Update 8)

UserName, Password, Destination Host, and File Name have been blanked out.

Please let me know if I can provide any additional information.

Code:
use Net::SSH2;

my ($User, $PW) = ('[UserName]', '[Password]');

my $SSH2 = Net::SSH2->new();
if ($SSH2->connect('[HostName]')) {
    if ($SSH2->auth_password($User, $PW)) {
    my $Chan = $SSH2->channel();
    $Chan->blocking(1);
    my $TmpOutFile = "[FileName]";

    $SSH2->debug(1);
    use IO::Scalar;
    my $FileData = IO::Scalar->new;
    $SSH2->scp_get($TmpOutFile, $FileData);
    print "SSH2 Error: ",$SSH2->error(),"\n";
    my @Data = split(/\n/, $FileData);
    print "Number of Lines:  ",($#Data+1),"\n";

    $Chan->close;
    } else { print "2_Login",join("|",$SSH2->error()), "\n"; }
} else { print "1_Connect",join("|",$SSH2->error()), "\n"; }

$SSH2->disconnect();


FAILED OUTPUT:  strawberry-perl-5.16.1.1-32bit-portable
libssh2_scp_recv(ss->session, path, &st) -> 0x2e68cf4
Net::SSH2::Channel::read(size = 1, ext = 0)
- read 1 bytes
- read 1 total
Net::SSH2::Channel::DESTROY
SSH2 Error: 0
Number of Lines:  0
Net::SSH2::Channel::DESTROY
Net::SSH2::DESTROY object 0x22d838c


FAILED OUTPUT:  strawberry-perl-5.16.1.1-64bit-portable
libssh2_scp_recv(ss->session, path, &st) -> 0x26545d8
Net::SSH2::Channel::read(size = 1, ext = 0)
- read 1 bytes
- read 1 total
Net::SSH2::Channel::DESTROY
SSH2 Error: 0
Number of Lines:  0
Net::SSH2::Channel::DESTROY
Net::SSH2::DESTROY object 0x25968f8


SUCCESSFUL OUTPUT:  strawberry-perl-5.12.3.0-portable
libssh2_scp_recv(ss->session, path, &st) -> 0x2dfa7a4
Net::SSH2::Channel::read(size = 8192, ext = 0)
- read 8192 bytes
- read 8192 total
Net::SSH2::Channel::read(size = 8192, ext = 0)
- read 8192 bytes
- read 8192 total
Net::SSH2::Channel::read(size = 8192, ext = 0)
- read 8192 bytes
- read 8192 total
Net::SSH2::Channel::read(size = 8192, ext = 0)
- read 8192 bytes
- read 8192 total
Net::SSH2::Channel::read(size = 8192, ext = 0)
- read 8192 bytes
- read 8192 total
Net::SSH2::Channel::read(size = 8192, ext = 0)
- read 8192 bytes
- read 8192 total
Net::SSH2::Channel::read(size = 8192, ext = 0)
- read 8192 bytes
- read 8192 total
Net::SSH2::Channel::read(size = 8192, ext = 0)
- read 8192 bytes
- read 8192 total
Net::SSH2::Channel::read(size = 8192, ext = 0)
- read 8192 bytes
- read 8192 total
Net::SSH2::Channel::read(size = 8192, ext = 0)
- read 8192 bytes
- read 8192 total
Net::SSH2::Channel::read(size = 8192, ext = 0)
- read 8192 bytes
- read 8192 total
Net::SSH2::Channel::read(size = 8192, ext = 0)
- read 8192 bytes
- read 8192 total
Net::SSH2::Channel::read(size = 8192, ext = 0)
- read 8192 bytes
- read 8192 total
Net::SSH2::Channel::read(size = 8192, ext = 0)
- read 8192 bytes
- read 8192 total
Net::SSH2::Channel::read(size = 8192, ext = 0)
- read 8192 bytes
- read 8192 total
Net::SSH2::Channel::read(size = 8192, ext = 0)
- read 8192 bytes
- read 8192 total
Net::SSH2::Channel::read(size = 8192, ext = 0)
- read 8192 bytes
- read 8192 total
Net::SSH2::Channel::read(size = 8192, ext = 0)
- read 8192 bytes
- read 8192 total
Net::SSH2::Channel::read(size = 8192, ext = 0)
- read 8192 bytes
- read 8192 total
Net::SSH2::Channel::read(size = 8192, ext = 0)
- read 8192 bytes
- read 8192 total
Net::SSH2::Channel::read(size = 8192, ext = 0)
- read 8192 bytes
- read 8192 total
Net::SSH2::Channel::read(size = 1589, ext = 0)
- read 1589 bytes
- read 1589 total
Net::SSH2::Channel::read(size = 1, ext = 0)
- read 1 bytes
- read 1 total
Net::SSH2::Channel::DESTROY
SSH2 Error: -37LIBSSH2_ERROR_EAGAINWould block waiting for SCP response
Number of Lines:  3164
Net::SSH2::Channel::DESTROY
Net::SSH2::DESTROY object 0x1f9ae7c


Thanks!

Chris McRoberts
Email chris@mcroberts.co
Subject: Re: [rt.cpan.org #80011] But Report: SP 5.16 and Net::SSH2 scp_get
Date: Fri, 05 Oct 2012 02:14:29 +0200
To: bug-Perl-Dist-Strawberry [...] rt.cpan.org
From: kmx <kmx [...] volny.cz>
Could you please post the output of: perl -MNet::SSH2 -e "print join(' ', Net::SSH2->version, $Net::SSH2::VERSION)" -- kmx
Subject: RE: [rt.cpan.org #80011] Bug Report: SP 5.16 and Net::SSH2 scp_get
Date: Fri, 05 Oct 2012 08:24:38 -0700
To: bug-Perl-Dist-Strawberry [...] rt.cpan.org
From: <chris [...] mcroberts.co>
Here it is:

strawberry-perl-5.16.1.1-32bit-portable (Fails)
1.4.1 66561 SSH-2.0-libssh2_1.4.1 0.45

strawberry-perl-5.16.1.1-64bit-portable (Fails)
1.4.1 66561 SSH-2.0-libssh2_1.4.1 0.45

strawberry-perl-5.12.3.0-portable (Works)
1.2.5 66053 SSH-2.0-libssh2_1.2.5 0.33

These are the default modules that came with those distributions, at least when I downloaded them.

Thanks,

Chris McRoberts

Show quoted text
Subject: Re: [rt.cpan.org #80011] Bug Report: SP 5.16 and Net::SSH2 scp_get
Date: Sat, 06 Oct 2012 21:19:42 +0200
To: bug-Perl-Dist-Strawberry [...] rt.cpan.org
From: kmx <kmx [...] volny.cz>
Hi Chris, according my testing: perl-5.16.1 + libssh2_1.4.1 + Net-SSH2-0.45 - FAILS perl-5.16.1 + libssh2_1.4.1 + Net-SSH2-0.33 - FAILS perl-5.16.1 + libssh2_1.2.8 + Net-SSH2-0.33 - WORKS perl-5.16.1 + libssh2_1.2.8 + Net-SSH2-0.45 - WORKS so it seems to be a bug in Net::SSH2 that does not play well with libssh2_1.4.1 As a workaround I can offer: 1/ get and unzip the following ZIP into you strawberry perl directory: http://strawberryperl.com/package/kmx/32_libs/gcc44-2011/32bit_libssh2-1.2.8-bin_20110506.zip or for 64bit http://strawberryperl.com/package/kmx/64_libs/gcc44-2011/64bit_libssh2-1.2.8-bin_20110506.zip 2/ run: cpan -f Net::SSH2 Please consider creating a bug report for Net::SSH2, I guess it should go to: https://github.com/rkitover/net-ssh2/issues -- kmx
Subject: RE: [rt.cpan.org #80011] Bug Report: SP 5.16 and Net::SSH2 scp_get
Date: Wed, 10 Oct 2012 14:57:11 -0700
To: bug-Perl-Dist-Strawberry [...] rt.cpan.org
From: <chris [...] mcroberts.co>
Many thanks, kmx.  That did the trick.

Bug reported:


Thanks again,

Chris McRoberts

Show quoted text