Skip Menu |

This queue is for tickets about the Net-SFTP-Foreign CPAN distribution.

Report information
The Basics
Id: 43788
Status: resolved
Worked: 25 min
Priority: 0/
Queue: Net-SFTP-Foreign

People
Owner: salva [...] cpan.org
Requestors: toddr [...] cpanel.net
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.48_03
Fixed in: (no value)



Subject: failure on $sftp->stat using openssh for initial connection
Hi, I'm opening my connection using Net::OpenSSH and then connecting to sftp via $sftp = $ssh->sftp(); This works fine now. The problem is when I do $sftp->stat, the connection is lost. the SFTP code is a little thick, but from what I can determine, the failure is happening as a result of calling syswrite inside _do_io_unix it's returning undef. From Dumper, I can tell the glob it's writing to is this: 'ssh_out' => \*{'Net::OpenSSH::$w'} Any advice on how I can further debug this problem? Thanks,
Subject: Re: [rt.cpan.org #43788] failure on $sftp->stat using openssh for initial connection
Date: Tue, 3 Mar 2009 01:01:05 -0800 (PST)
To: bug-Net-SFTP-Foreign [...] rt.cpan.org
From: Salvador Fandino <sfandino [...] yahoo.com>
Show quoted text
----- Original Message ----
> From: Todd E. Rinaldo via RT <bug-Net-SFTP-Foreign@rt.cpan.org> > Sent: Monday, March 2, 2009 11:40:08 PM > Subject: [rt.cpan.org #43788] failure on $sftp->stat using openssh for initial connection > > Mon Mar 02 17:40:07 2009: Request 43788 was acted upon. > Transaction: Ticket created by todd_rinaldo > Queue: Net-SFTP-Foreign > Subject: failure on $sftp->stat using openssh for initial connection > Broken in: 1.48_03 > Severity: Normal > Owner: Nobody > Requestors: todd.e.rinaldo@jpmorgan.com > Status: new > Ticket > > > Hi, > > I'm opening my connection using Net::OpenSSH and then connecting to > sftp via $sftp = $ssh->sftp(); > > This works fine now. > > The problem is when I do $sftp->stat, the connection is lost. > > the SFTP code is a little thick, but from what I can determine, the > failure is happening as a result of calling syswrite inside _do_io_unix > it's returning undef. > > From Dumper, I can tell the glob it's writing to is this: > 'ssh_out' => \*{'Net::OpenSSH::$w'} > > Any advice on how I can further debug this problem?
Yes, both Net::SFTP::Foreign and Net::OpenSSH have a debug mode that you can activate as follows: $Net::SFTP::Foreign::debug = -1; $Net::OpenSSH::debug = -1; An strace (or your OS equivalent) capture would also help. I am unable to reproduce the problem myself. Which version of Net::OpenSSH are you using? Some servers disallow the stat command, though usually, they don't drop the connection but just say that the command is unsupported. Cheers, - Salva
From: todd.e.rinaldo [...] jpmorgan.com
I went to pure Net::SFTP::Foreign login and the problem did not manifest. I'll try the debug mode with a test case and get back to you.
no further feedback from the OP
From: todd.e.rinaldo [...] jpmorgan.com
On Tue Apr 07 06:58:54 2009, SALVA wrote: Show quoted text
> no further feedback from the OP
Sorry for the slow reply. The problem turned out to be that I was using Net::SFTP::Attributes instead of Net::SFTP::Foreign::Attributes. This was causing the blow up. If you want N:S:F to be extra nice, I'd suggest a check in the code to validate the object is correct when using this object? Thanks, Todd
Next version will check the validity of the attribute arguments