Subject: | put() method hangs while putting a file to a Tectia SFTP server |
I found a good description of my problem here:
http://www.cpanforum.com/threads/2092
My script using Net::SFTP connects but hangs trying to upload the file.
When I use the psftp script included in eg/, it hangs until I hit Enter
a couple of times, and then it seems to work but it .
Show quoted text
sftp> put data/file_to_upload xfer/incoming/test2
Uploading data/nco_20090410 to xfer/incoming/test2
myhost: sftp: Sent SSH2_FXP_OPEN I:10 P:xfer/incoming/test2
myhost: sftp: Sent message SSH2_FXP_WRITE I:11 O:0
myhost: sftp: In write loop, got 8192 offset 0
myhost: sftp: Sent message SSH2_FXP_WRITE I:12 O:8192
myhost: channel 1: rcvd eof
myhost: channel 1: output open -> drain
myhost: channel 1: obuf empty
myhost: channel 1: output drain -> closed
myhost: channel 1: close_write
myhost: channel 1: rcvd close
myhost: channel 1: input open -> closed
myhost: channel 1: close_read
myhost: channel 1: send close
myhost: channel 1: full closed
Connection closed at ./psftp line 137
This is the info for the server to which I'm trying to upload the file:
myhost: Reading configuration data /etc/ssh_config
myhost: Connecting to xxxx.xxxxxxxxx.com, port 22.
myhost: Remote protocol version 2.0, remote software version 5.3.1.40
SSH Tectia Server
myhost: Net::SSH::Perl Version 1.34, protocol version 2.0.
myhost: No compat match: 5.3.1.40 SSH Tectia Server
When I lower the COPY_SIZE constant in SFTP.pm (suggested in the
cpanforum thread above), I get more debug lines from the write loop, but
it aborts and I am disconnected:
myhost: sftp: Sent message SSH2_FXP_WRITE I:509 O:129280
myhost: sftp: In write loop, got 256 offset 129280
myhost: sftp: Sent message SSH2_FXP_WRITE I:510 O:129536
myhost: sftp: In write loop, got 224 offset 129536
myhost: sftp: Sent message T:10 I:511
Couldn't fsetstat: Failure at ./psftp line 137
myhost: sftp: Sent message T:4 I:512
Show quoted textsftp> ls -l
myhost: sftp: Sent message T:11 I:513
Couldn't get handle: No such file or directory at ./psftp line 144
By comparison, it works with two RedHat/OpenSSH servers I tried.
Apparently a Tectia/Net::SFTP incompatibility?
I don't understand what's going on but I am willing to answer additional
questions if it will help.
In the meantime... I'd prefer to use Net::SFTP, but I guess I will be
scripting 'sftp' or something.