Subject: | Newer libssh2 version causes "resource not available" on scp_put |
Net::SSH2 fails during scp_put, but not for all target servers.
I had a vendor's server and an in house test server setup. Same authorized keys. Testing from the command line is
successful to both using the BSD's scp, but fails during Net::SSH's put to just one (the vendor). This failure is
dependent on two things:
(1) Some undetermined remote server or network condition, possibly performance or implementation.
(2) Version of libssh2 installed when Net::SSH2 is built. 0.17-1 works, 1.2.6-1 doesn't.
Fixing it required rolling back libssh2 (and devel) AND rebuilding Net::SSH2 v0.33 with the addition of two recent commits
from the git repo:
http://github.com/rkitover/net-ssh2/commit/d053f28a35d1f0454d2155145d54c600a2f41447
http://github.com/rkitover/net-ssh2/commit/9c9ced9984ce7891a1a001b84c846d2425137049
Side note: attempting to build directly from the git repo failed during make.
For concreteness, I wrote a script use Net:SSH2 to auth, read out an "ls" of a directory and then attempt a put.
====================================
$ ./remote_acct_test.pl myuser@myserver
[INFO:25211:RemoteAccount.pm:458:] *** attempting ls ('incoming') with ssh keys
[2010-09-24 10:56:05] ./remote_acct_test.pl [INFO:25211:RemoteAccount.pm:382:] Successful ssh2->auth by keypair for
myserver using /home/opensrf/.ssh/id_rsa_ums
ls ('incoming'):
incoming/.
incoming/..
incoming/xxx_testfile
[2010-09-24 10:56:05] ./remote_acct_test.pl [INFO:25211:RemoteAccount.pm:382:] Successful ssh2->auth by keypair for
myserver using /home/opensrf/.ssh/id_rsa_ums
[2010-09-24 10:56:05] ./remote_acct_test.pl [INFO:25211:RemoteAccount.pm:177:] OpenILS::Utils::RemoteAccount : using
tempfile /tmp/OGw8BrP3mi
[2010-09-24 10:56:05] ./remote_acct_test.pl [INFO:25211:RemoteAccount.pm:415:] *** attempting put (/tmp/OGw8BrP3mi,
incoming/zzz_test.19442.txt) with ssh keys
[2010-09-24 10:56:06] ./remote_acct_test.pl [INFO:25211:RemoteAccount.pm:419:] OpenILS::Utils::RemoteAccount :
successfully sent myserver /tmp/OGw8BrP3mi --> incoming/zzz_test.19442.txt
************ put returned: incoming/zzz_test.19442.txt ***************
$ ./remote_acct_test.pl theiruser@theirserver
[2010-09-24 11:21:06] ./remote_acct_test.pl [INFO:26445:RemoteAccount.pm:458:] *** attempting ls ('incoming') with ssh
keys
[2010-09-24 11:21:07] ./remote_acct_test.pl [INFO:26445:RemoteAccount.pm:382:] Successful ssh2->auth by keypair for
theirserver using /home/opensrf/.ssh/id_rsa_ums
ls ('incoming'):
incoming/.
incoming/..
incoming/atz_2.txt
incoming/atz_3.txt
incoming/atz_test_scp.txt
incoming/atz_zzz.txt
incoming/bar
incoming/foo
incoming/sample.xml
incoming/test
[2010-09-24 11:21:09] ./remote_acct_test.pl [INFO:26445:RemoteAccount.pm:177:] OpenILS::Utils::RemoteAccount : using
tempfile /tmp/ZXmmYOJ7XK
[2010-09-24 11:21:09] ./remote_acct_test.pl [INFO:26445:RemoteAccount.pm:415:] *** attempting put (/tmp/ZXmmYOJ7XK,
incoming/zzz_test.19442.txt) with ssh keys
[2010-09-24 11:21:10] ./remote_acct_test.pl [ERR :26445:RemoteAccount.pm:422:] OpenILS::Utils::RemoteAccount : put with
keys to theirserver failed with error: Resource temporarily unavailable
=====================================================================
So our interface was able to connect, retrieve and display the contents of an "ls" command, but gets "Resource temporarily
unavailable" during a "put" attempt.
PS: I think that several of the other bugs reported that reference "perl 5.10" may actually be caused by the presence of a
newer libssh2 and not anything inherent to 5.8 vs 5.10. That is to say, a distro that has 5.10 as the default is new
enough to also have a newer libssh2 packaged. Systems tested by me were RedHat EL 2.6.18-194.8.1.el5 x86_64, so they had
the libssh2 1.2.6-1 and the older perl 5.8.8. Thankfully, not all of them had libssh2 updated, or else I never would have
found the fix to this problem.
Please package a bugfix release with those two commits included.