Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

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

Replies are listed 'Best First'.
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


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1016825]
Front-paged by Arunbear
NodeReaper selects a flavor of Kool-Aid

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2018-01-21 23:39 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (230 votes). Check out past polls.