Subject: | TCP RST Issue using Net::Cmd / Net::FTP / Net::FTP::AutoReconnect |
Date: | Wed, 20 Jul 2016 15:21:07 -0400 |
To: | bug-libnet [...] rt.cpan.org |
From: | Chris Autry <chris [...] neadwerx.com> |
Greeting, we recently pulled the 3.09 update for Net::Cmd and began
experiencing failures to transfer and receive files using Net::FTP and
Net::FTP::AutoReconnect.
After a little debugging, we found the issue to be caused in Net::Cmd:
-our $VERSION = "3.08";
+our $VERSION = "3.09";
our @ISA = qw(Exporter);
our @EXPORT = qw(CMD_INFO CMD_OK CMD_MORE CMD_REJECT CMD_ERROR
CMD_PENDING);
@@ -190,6 +190,8 @@
1;
}
+sub timeout { 0 }
+
sub _syswrite_with_timeout {
my $cmd = shift;
my $line = shift;
@@ -748,6 +750,12 @@
Removal of sub timeout { 0 } resolved the issue.
This can be reproduced by:
- Initiating an FTP connection with a remote host in passive mode
(suggested setting the Debug => 1, Passive => 1 in Net::FTP constructor ).
- Running a LIST / NLST / etc command (something that requires the
opening of a second connection ), Net::FTP::ls() would work here.
- Command will 'hang'. ( Command channel still active however ).
Symptoms of the problem include the following:
Error message (in Debug mode):
Net::FTP: Net::Cmd::getline(): unexpected EOF on command channel: at
/usr/share/perl5/vendor_perl/Net/FTP/AutoReconnect.pm line 328.
Net::FTP::AutoReconnect Reconnecting to FTP server <redacted>
tcpdump shows the SYN, SYN-ACK, followed by RST instead of ACK.
netstat -tp | grep <remote peer> shows only command channel is active
Server was ruled out by executing commands using telnet on the remote host.
The following is our configuration and versions for OS, Perl, and
supporting libs:
- Linux 3.10.0-327.4.4.el7.x86_64 (CentOS 7)
- Perl 5.16
- Net::Cmd version 3.09
- Net::FTP version 2.27
- Net::FTP::AutoReconnect version 0.3
Thank you
*___________________________________Chris Autry*
Nead Werx, Inc. | Senior Database Engineer
2323 Cumberland Parkway | Suite 201 | Atlanta, GA 30339
*T <redacted>*
chris@neadwerx.com | http://www.neadwerx.com