0

I have a vsftpd server running on a RedHat host, and an application that uses FTP to transfer files to and from the server.

Some transfers are done without problem, but for some files it fails with error 426. I tried transferring the files using FileZilla instead of the other application (same files, same client computer, same destination, same user), and it works.

I don't have control over the client application, so I used WireShark to try to understand what's happening.

No.     Time           Source                Destination           Protocol Length Info
  59945 53.762728      [client ip]         [ftp server]         FTP      71     Request: RETR Batch.func
  59950 53.763219      [ftp server]         [client ip]         TCP      74     20→52604 [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM=1 TSval=2261468899 TSecr=0 WS=128
  59951 53.763284      [client ip]         [ftp server]         TCP      74     52604→20 [SYN, ACK] Seq=0 Ack=1 Win=8192 Len=0 MSS=1460 WS=256 SACK_PERM=1 TSval=54157713 TSecr=2261468899
  59957 53.763868      [ftp server]         [client ip]         TCP      66     20→52604 [ACK] Seq=1 Ack=1 Win=29312 Len=0 TSval=2261468900 TSecr=54157713
  59958 53.763868      [ftp server]         [client ip]         FTP      126    Response: 150 Opening BINARY mode data connection for Batch.func (305415 bytes).
  59959 53.763904      [ftp server]         [client ip]         FTP-DATA 1514   FTP Data: 1448 bytes
  59960 53.763936      [ftp server]         [client ip]         FTP-DATA 1514   FTP Data: 1448 bytes
  59961 53.763951      [client ip]         [ftp server]         TCP      66     52604→20 [ACK] Seq=1 Ack=2897 Win=131584 Len=0 TSval=54157713 TSecr=2261468900
  59963 53.764080      [ftp server]         [client ip]         FTP-DATA 1514   FTP Data: 1448 bytes
  59964 53.764208      [ftp server]         [client ip]         FTP-DATA 1514   FTP Data: 1448 bytes
  59965 53.764230      [client ip]         [ftp server]         TCP      66     52604→20 [ACK] Seq=1 Ack=5793 Win=131584 Len=0 TSval=54157713 TSecr=2261468900
  59966 53.764354      [ftp server]         [client ip]         FTP-DATA 1514   FTP Data: 1448 bytes
  59967 53.764492      [ftp server]         [client ip]         FTP-DATA 1018   FTP Data: 952 bytes
  59968 53.764494      [ftp server]         [client ip]         FTP-DATA 1514   FTP Data: 1448 bytes
  59969 53.764516      [client ip]         [ftp server]         TCP      66     52604→20 [ACK] Seq=1 Ack=9641 Win=131584 Len=0 TSval=54157713 TSecr=2261468900
  59970 53.764524      [ftp server]         [client ip]         FTP-DATA 1514   FTP Data: 1448 bytes
  59971 53.764526      [ftp server]         [client ip]         FTP-DATA 1514   FTP Data: 1448 bytes
  59972 53.764527      [ftp server]         [client ip]         FTP-DATA 1514   FTP Data: 1448 bytes
  59973 53.764541      [client ip]         [ftp server]         TCP      66     52604→20 [ACK] Seq=1 Ack=13985 Win=131584 Len=0 TSval=54157713 TSecr=2261468900
  59977 53.764651      [client ip]         [ftp server]         TCP      66     52604→20 [FIN, ACK] Seq=1 Ack=13985 Win=131584 Len=0 TSval=54157713 TSecr=2261468900
  59978 53.764705      [client ip]         [ftp server]         TCP      54     52604→20 [RST, ACK] Seq=2 Ack=13985 Win=0 Len=0
  59980 53.764720      [ftp server]         [client ip]         FTP-DATA 1514   FTP Data: 1448 bytes
  59981 53.764734      [client ip]         [ftp server]         TCP      54     52604→20 [RST] Seq=1 Win=0 Len=0
  59982 53.764752      [ftp server]         [client ip]         FTP-DATA 1514   FTP Data: 1448 bytes
  59983 53.764760      [client ip]         [ftp server]         TCP      54     52604→20 [RST] Seq=1 Win=0 Len=0
  59984 53.764766      [ftp server]         [client ip]         FTP-DATA 1514   FTP Data: 1448 bytes
  59985 53.764774      [client ip]         [ftp server]         TCP      54     52604→20 [RST] Seq=1 Win=0 Len=0
  59986 53.764780      [ftp server]         [client ip]         FTP-DATA 1514   FTP Data: 1448 bytes
  59987 53.764788      [client ip]         [ftp server]         TCP      54     52604→20 [RST] Seq=1 Win=0 Len=0
  59988 53.764795      [ftp server]         [client ip]         FTP-DATA 1514   FTP Data: 1448 bytes
  59989 53.764802      [client ip]         [ftp server]         TCP      54     52604→20 [RST] Seq=1 Win=0 Len=0
  59991 53.764985      [ftp server]         [client ip]         FTP-DATA 1514   FTP Data: 1448 bytes
  59992 53.764987      [ftp server]         [client ip]         FTP-DATA 1514   FTP Data: 1448 bytes
  59993 53.765008      [client ip]         [ftp server]         TCP      54     52604→20 [RST] Seq=1 Win=0 Len=0
  59994 53.765015      [client ip]         [ftp server]         TCP      54     52604→20 [RST] Seq=1 Win=0 Len=0
  59995 53.765157      [ftp server]         [client ip]         FTP-DATA 1514   FTP Data: 1448 bytes
  59996 53.765173      [client ip]         [ftp server]         TCP      54     52604→20 [RST] Seq=1 Win=0 Len=0
  59997 53.765186      [ftp server]         [client ip]         FTP-DATA 1514   FTP Data: 1448 bytes
  59998 53.765194      [client ip]         [ftp server]         TCP      54     52604→20 [RST] Seq=1 Win=0 Len=0
  59999 53.765200      [ftp server]         [client ip]         FTP-DATA 1514   FTP Data: 1448 bytes
  60000 53.765212      [client ip]         [ftp server]         TCP      54     52604→20 [RST] Seq=1 Win=0 Len=0
  60001 53.765225      [ftp server]         [client ip]         FTP-DATA 1514   FTP Data: 1448 bytes
  60002 53.765227      [ftp server]         [client ip]         FTP-DATA 1514   FTP Data: 1448 bytes
  60003 53.765228      [ftp server]         [client ip]         FTP-DATA 1514   FTP Data: 1448 bytes
  60004 53.765229      [ftp server]         [client ip]         FTP-DATA 1514   FTP Data: 1448 bytes
  60005 53.765238      [client ip]         [ftp server]         TCP      54     52604→20 [RST] Seq=1 Win=0 Len=0
  60006 53.765244      [client ip]         [ftp server]         TCP      54     52604→20 [RST] Seq=1 Win=0 Len=0
  60007 53.765250      [client ip]         [ftp server]         TCP      54     52604→20 [RST] Seq=1 Win=0 Len=0
  60008 53.765255      [client ip]         [ftp server]         TCP      54     52604→20 [RST] Seq=1 Win=0 Len=0
  60009 53.765261      [ftp server]         [client ip]         FTP-DATA 1514   FTP Data: 1448 bytes
  60010 53.765269      [client ip]         [ftp server]         TCP      54     52604→20 [RST] Seq=1 Win=0 Len=0
  60015 53.765465      [ftp server]         [client ip]         FTP-DATA 1514   FTP Data: 1448 bytes
  60016 53.765476      [client ip]         [ftp server]         TCP      54     52604→20 [RST] Seq=1 Win=0 Len=0
  60017 53.765484      [ftp server]         [client ip]         FTP      91     Response: 426 Failure writing network stream.
  60018 53.765504      [client ip]         [ftp server]         TCP      54     52602→21 [ACK] Seq=292 Ack=531 Win=130816 Len=0
  60030 53.768012      [client ip]         [ftp server]         FTP      60     Request: QUIT
  60036 53.768691      [ftp server]         [client ip]         FTP      68     Response: 221 Goodbye.
  60037 53.768692      [ftp server]         [client ip]         TCP      60     21→52602 [FIN, ACK] Seq=545 Ack=298 Win=29312 Len=0
  60038 53.768732      [client ip]         [ftp server]         TCP      54     52602→21 [ACK] Seq=298 Ack=546 Win=130816 Len=0
  60042 53.768875      [client ip]         [ftp server]         TCP      54     52602→21 [FIN, ACK] Seq=298 Ack=546 Win=130816 Len=0
  60045 53.769297      [ftp server]         [client ip]         TCP      60     21→52602 [ACK] Seq=546 Ack=299 Win=29312 Len=0

Apparently the server starts to send data to the client, but after a few packets the client ends the transfer.

Is there some setting in vsftp that I could change to fix this?

Thanks.

FileZilla log for the same file transfer:

2017-09-29 08:22:15 9980 3 Command: TYPE I
2017-09-29 08:22:15 9980 3 Response: 200 Switching to Binary mode.
2017-09-29 08:22:15 9980 3 Command: PASV
2017-09-29 08:22:15 9980 3 Response: 227 Entering Passive Mode (172,16,10,192,218,176).
2017-09-29 08:22:15 9980 3 Command: RETR Batch.func
2017-09-29 08:22:15 9980 3 Response: 150 Opening BINARY mode data connection for Batch.func (305415 bytes).
2017-09-29 08:22:15 9980 3 Response: 226 Transfer complete.
2017-09-29 08:22:15 9980 3 Status: File transfer successful, transferred 305,415 bytes in 1 second
  • Show us a log file of FileZilla and, if you have one, also log file of the application. – Martin Prikryl Sep 27 '17 at 15:06
  • All I have in the application's log is this: Error while completing FTP command. FTP error : 426 Failure writing network stream. I added the FileZilla logs to my question. – user630729 Sep 29 '17 at 6:32
  • perhaps something with ascii vs binary transfer mode? stackoverflow.com/questions/6155905/… – chloesoe Sep 29 '17 at 6:42
  • @chloesoe Why? How would transfer mode cause this kind of problem. I find it unlikely. It's rather about active/passive mode. Or misconfiguration of FTP server passive mode. – Martin Prikryl Sep 29 '17 at 7:04
  • @Martin Prikyl; It was a wild guess, I had strange behaviours in my with transfer mode. If I have a FTP problem, I always think first about problems like that. – chloesoe Sep 29 '17 at 7:24

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.