Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

net::sftp dies in the middle

by david2008 (Scribe)
on Feb 03, 2013 at 14:14 UTC ( #1016825=perlquestion: print w/ replies, xml ) Need Help??
david2008 has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,

I have a problem with net::sftp.
It dies in the middle.
I send the command

my %args = (user=>'x', password=>'y', debug=>'1'); ##The ftp modules my $sftp = new Net::SFTP('x.y.z',%args); my $put_code = $sftp->put($local_file, $remote_file); print "hi"

and it dies in the middle
i get the following debug log
sftp: Sent SSH2_FXP_OPEN I:0 P:<file_name>
Connection closed at x.pl line 26
It does not get to the print.
I use Net::SFTP 0.10.
I don't have an idea how to continue to debug this issue.

Thanks, David

Comment on net::sftp dies in the middle
Download Code
Re: net::sftp dies in the middle
by salva (Abbot) on Feb 04, 2013 at 08:50 UTC

      I concur with the esteemed poster above, if only because Net::SFTP::Foreign seems to have more troubleshooting capabilities.

      Other than that, from glancing at the perldoc for Net::SFTP, it may be worth doing an $sftp->status after the open? Lastly, what sftp server software is used on the other side? From some summary googling it would look that some servers (Tectia amongst others) has problems with Net::SFTP.

Re: net::sftp dies in the middle
by Illuminatus (Curate) on Feb 04, 2013 at 18:13 UTC
    The first thing I would do is make sure that you can do an sftp from the command line of $local_file to $remote_file. Since you didn't show the code that sets these variables, I can't be sure they're set the way you expect. Since it's an open problem, the first thing i would verify that this user can write this file in this location. If you have access to the server, you can usually restart it with debugging turned on. It will probably log open/write errors on its side

    fnord

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1016825]
Front-paged by Arunbear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2014-12-26 09:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (171 votes), past polls