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
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)
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
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!