Em uma máquina com Windows Server 2008 R2 Standard, estou tendo problemas para conectar e baixar um arquivo de um servidor FTP do Windows.
O tamanho do arquivo é de ~ 3KB a 6KB. Muito raramente ~ 100KB a ~ 500KB, mas o servidor tem muito espaço no disco.
Eu tentei uma conexão passiva:
Response: 220-Microsoft FTP Service
Response: 220 Regal Logistics
Command: USER ********
Response: 331 Password required for ********.
Command: PASS ********
Response: 230 User ******** logged in.
Status: Connected
Status: Starting download of /********/PO/201405130227.xml
Command: CWD /********/PO
Response: 250 CWD command successful.
Command: TYPE A
Response: 200 Type set to A.
Command: PASV
Response: 227 Entering Passive Mode (***,***,***,**,19,64)
Command: RETR 201405130227.xml
Response: 125 Data connection already open; Transfer starting.
Response: 426 Data connection closed. Error scanning content
Error: File transfer failed after transferring 3,465 bytes in 1 second
O mais estranho é que o arquivo tem 3.465 bytes, então o arquivo inteiro está passando, ele não está terminando corretamente.
E eu tentei uma conexão ativa:
Response: 220-Microsoft FTP Service
Response: 220 Regal Logistics
Command: USER ********
Response: 331 Password required for ********.
Command: PASS ********
Response: 230 User ******** logged in.
Command: PORT 10,0,0,114,214,65
Response: 200 PORT command successful.
Command: RETR 201405130227.xml
Response: 150 Opening ASCII mode data connection for 201405130227.xml(3465 bytes).
Response: 426 Data connection closed. Error scanning content
Eu tentei de dois clientes FTP diferentes no mesmo servidor (Filezilla e cliente CLI FTP) e recebo a mesma resposta:
125 Data connection already open; Transfer starting.
426 Data connection closed. Error scanning content
Eu tentei fazer o download de arquivos com sucesso de uma rede separada, por isso é exclusivo para a localização do servidor.
Entrei em contato com os administradores do sistema / rede onde o servidor está localizado e tenho certeza de que as portas necessárias para o funcionamento do FTP estão abertas. (Meu palpite é que eles abriram 21, eu não tenho certeza sobre quaisquer outros.) Existe um firewall físico que está na rede deles, mas novamente, eu não tenho acesso a ele infelizmente. O Firewall do Windows está desativado no servidor.
O que mais eu poderia dar uma olhada para ver se está realmente falhando?
Aqui está um log de pacote da solicitação pouco antes de falhar:
No. Time Source Destination Protocol Length Info
39 6.878855000 LOCAL-IP EXTERNAL-FTP-SERVER-IP FTP 77 Request: RETR 201405130227.xml
Frame 39: 77 bytes on wire (616 bits), 77 bytes captured (616 bits) on interface 0
Ethernet II, Src: Hewlett-_ab:cd:ef (00:1e:a1:ab:cd:ef), Dst: Watchgua_12:34:56 (ab:cd:7f:12:34:56)
Internet Protocol Version 4, Src: LOCAL-IP (LOCAL-IP), Dst: EXTERNAL-FTP-SERVER-IP (EXTERNAL-FTP-SERVER-IP)
Transmission Control Protocol, Src Port: 56623 (56623), Dst Port: ftp (21), Seq: 55, Ack: 207, Len: 23
File Transfer Protocol (FTP)
No. Time Source Destination Protocol Length Info
40 6.893662000 EXTERNAL-FTP-SERVER-IP LOCAL-IP TCP 60 ftp > 56623 [ACK] Seq=207 Ack=78 Win=93362 Len=0
Frame 40: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0
Ethernet II, Src: Watchgua_12:34:56 (ab:cd:7f:12:34:56), Dst: Hewlett-_ab:cd:ef (00:1e:a1:ab:cd:ef)
Internet Protocol Version 4, Src: EXTERNAL-FTP-SERVER-IP (EXTERNAL-FTP-SERVER-IP), Dst: LOCAL-IP (LOCAL-IP)
Transmission Control Protocol, Src Port: ftp (21), Dst Port: 56623 (56623), Seq: 207, Ack: 78, Len: 0
No. Time Source Destination Protocol Length Info
41 6.957666000 EXTERNAL-FTP-SERVER-IP LOCAL-IP FTP 108 Response: 125 Data connection already open; Transfer starting.
Frame 41: 108 bytes on wire (864 bits), 108 bytes captured (864 bits) on interface 0
Ethernet II, Src: Watchgua_12:34:56 (ab:cd:7f:12:34:56), Dst: Hewlett-_ab:cd:ef (00:1e:a1:ab:cd:ef)
Internet Protocol Version 4, Src: EXTERNAL-FTP-SERVER-IP (EXTERNAL-FTP-SERVER-IP), Dst: LOCAL-IP (LOCAL-IP)
Transmission Control Protocol, Src Port: ftp (21), Dst Port: 56623 (56623), Seq: 207, Ack: 78, Len: 54
File Transfer Protocol (FTP)
No. Time Source Destination Protocol Length Info
42 6.986757000 EXTERNAL-FTP-SERVER-IP LOCAL-IP FTP 106 Response: 426 Data connection closed. Error scanning content
Frame 42: 106 bytes on wire (848 bits), 106 bytes captured (848 bits) on interface 0
Ethernet II, Src: Watchgua_12:34:56 (ab:cd:7f:12:34:56), Dst: Hewlett-_ab:cd:ef (00:1e:a1:ab:cd:ef)
Internet Protocol Version 4, Src: EXTERNAL-FTP-SERVER-IP (EXTERNAL-FTP-SERVER-IP), Dst: LOCAL-IP (LOCAL-IP)
Transmission Control Protocol, Src Port: ftp (21), Dst Port: 56623 (56623), Seq: 261, Ack: 78, Len: 52
File Transfer Protocol (FTP)
No. Time Source Destination Protocol Length Info
43 6.986768000 LOCAL-IP EXTERNAL-FTP-SERVER-IP TCP 54 56623 > ftp [ACK] Seq=78 Ack=313 Win=65280 Len=0
Frame 43: 54 bytes on wire (432 bits), 54 bytes captured (432 bits) on interface 0
Ethernet II, Src: Hewlett-_ab:cd:ef (00:1e:a1:ab:cd:ef), Dst: Watchgua_12:34:56 (ab:cd:7f:12:34:56)
Internet Protocol Version 4, Src: LOCAL-IP (LOCAL-IP), Dst: EXTERNAL-FTP-SERVER-IP (EXTERNAL-FTP-SERVER-IP)
Transmission Control Protocol, Src Port: 56623 (56623), Dst Port: ftp (21), Seq: 78, Ack: 313, Len: 0
Eu coletei mais alguns logs - desta vez eu assisti mais que as portas 21 e 22 - eu assisti os IPs da conexão FTP:
No. Time Source Destination Protocol Length Info
2607 11.440148000 __REMOTE__IP__ _LOCAL_IP_ FTP 105 Response: 227 Entering Passive Mode (198,104,198,16,17,233)
Frame 2607: 105 bytes on wire (840 bits), 105 bytes captured (840 bits) on interface 0
Ethernet II, Src: Watchgua_LOCALMAC (AA:BB:CC:LOCALMAC), Dst: Hewlett-_SUB_MAC (11:22:33:SUB_MAC)
Internet Protocol Version 4, Src: __REMOTE__IP__ (__REMOTE__IP__), Dst: _LOCAL_IP_ (_LOCAL_IP_)
Transmission Control Protocol, Src Port: ftp (21), Dst Port: 54613 (54613), Seq: 195, Ack: 60, Len: 51
File Transfer Protocol (FTP)
No. Time Source Destination Protocol Length Info
2608 11.440763000 _LOCAL_IP_ __REMOTE__IP__ FTP 74 Request: RETR testthing.txt
Frame 2608: 74 bytes on wire (592 bits), 74 bytes captured (592 bits) on interface 0
Ethernet II, Src: Hewlett-_SUB_MAC (11:22:33:SUB_MAC), Dst: Watchgua_LOCALMAC (AA:BB:CC:LOCALMAC)
Internet Protocol Version 4, Src: _LOCAL_IP_ (_LOCAL_IP_), Dst: __REMOTE__IP__ (__REMOTE__IP__)
Transmission Control Protocol, Src Port: 54613 (54613), Dst Port: ftp (21), Seq: 60, Ack: 246, Len: 20
File Transfer Protocol (FTP)
No. Time Source Destination Protocol Length Info
2609 11.441029000 _LOCAL_IP_ __REMOTE__IP__ TCP 66 54617 > 4585 [SYN] Seq=0 Win=65535 Len=0 MSS=1460 WS=128 SACK_PERM=1
Frame 2609: 66 bytes on wire (528 bits), 66 bytes captured (528 bits) on interface 0
Ethernet II, Src: Hewlett-_SUB_MAC (11:22:33:SUB_MAC), Dst: Watchgua_LOCALMAC (AA:BB:CC:LOCALMAC)
Internet Protocol Version 4, Src: _LOCAL_IP_ (_LOCAL_IP_), Dst: __REMOTE__IP__ (__REMOTE__IP__)
Transmission Control Protocol, Src Port: 54617 (54617), Dst Port: 4585 (4585), Seq: 0, Len: 0
No. Time Source Destination Protocol Length Info
2610 11.442013000 __REMOTE__IP__ _LOCAL_IP_ TCP 60 ftp > 54613 [ACK] Seq=246 Ack=80 Win=93360 Len=0
Frame 2610: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0
Ethernet II, Src: Watchgua_LOCALMAC (AA:BB:CC:LOCALMAC), Dst: Hewlett-_SUB_MAC (11:22:33:SUB_MAC)
Internet Protocol Version 4, Src: __REMOTE__IP__ (__REMOTE__IP__), Dst: _LOCAL_IP_ (_LOCAL_IP_)
Transmission Control Protocol, Src Port: ftp (21), Dst Port: 54613 (54613), Seq: 246, Ack: 80, Len: 0
No. Time Source Destination Protocol Length Info
2622 11.459434000 __REMOTE__IP__ _LOCAL_IP_ TCP 66 4585 > 54617 [SYN, ACK] Seq=0 Ack=1 Win=65535 Len=0 WS=2 MSS=1400 SACK_PERM=1
Frame 2622: 66 bytes on wire (528 bits), 66 bytes captured (528 bits) on interface 0
Ethernet II, Src: Watchgua_LOCALMAC (AA:BB:CC:LOCALMAC), Dst: Hewlett-_SUB_MAC (11:22:33:SUB_MAC)
Internet Protocol Version 4, Src: __REMOTE__IP__ (__REMOTE__IP__), Dst: _LOCAL_IP_ (_LOCAL_IP_)
Transmission Control Protocol, Src Port: 4585 (4585), Dst Port: 54617 (54617), Seq: 0, Ack: 1, Len: 0
No. Time Source Destination Protocol Length Info
2623 11.459475000 _LOCAL_IP_ __REMOTE__IP__ TCP 54 54617 > 4585 [ACK] Seq=1 Ack=1 Win=4194304 Len=0
Frame 2623: 54 bytes on wire (432 bits), 54 bytes captured (432 bits) on interface 0
Ethernet II, Src: Hewlett-_SUB_MAC (11:22:33:SUB_MAC), Dst: Watchgua_LOCALMAC (AA:BB:CC:LOCALMAC)
Internet Protocol Version 4, Src: _LOCAL_IP_ (_LOCAL_IP_), Dst: __REMOTE__IP__ (__REMOTE__IP__)
Transmission Control Protocol, Src Port: 54617 (54617), Dst Port: 4585 (4585), Seq: 1, Ack: 1, Len: 0
No. Time Source Destination Protocol Length Info
2634 11.482207000 __REMOTE__IP__ _LOCAL_IP_ FTP 108 Response: 125 Data connection already open; Transfer starting.
Frame 2634: 108 bytes on wire (864 bits), 108 bytes captured (864 bits) on interface 0
Ethernet II, Src: Watchgua_LOCALMAC (AA:BB:CC:LOCALMAC), Dst: Hewlett-_SUB_MAC (11:22:33:SUB_MAC)
Internet Protocol Version 4, Src: __REMOTE__IP__ (__REMOTE__IP__), Dst: _LOCAL_IP_ (_LOCAL_IP_)
Transmission Control Protocol, Src Port: ftp (21), Dst Port: 54613 (54613), Seq: 246, Ack: 80, Len: 54
File Transfer Protocol (FTP)
No. Time Source Destination Protocol Length Info
2635 11.483996000 __REMOTE__IP__ _LOCAL_IP_ FTP-DATA 60 FTP Data: 4 bytes
Frame 2635: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0
Ethernet II, Src: Watchgua_LOCALMAC (AA:BB:CC:LOCALMAC), Dst: Hewlett-_SUB_MAC (11:22:33:SUB_MAC)
Internet Protocol Version 4, Src: __REMOTE__IP__ (__REMOTE__IP__), Dst: _LOCAL_IP_ (_LOCAL_IP_)
Transmission Control Protocol, Src Port: 4585 (4585), Dst Port: 54617 (54617), Seq: 1, Ack: 1, Len: 4
FTP Data (test)
No. Time Source Destination Protocol Length Info
2636 11.484173000 __REMOTE__IP__ _LOCAL_IP_ FTP 106 Response: 426 Data connection closed. Error scanning content
Frame 2636: 106 bytes on wire (848 bits), 106 bytes captured (848 bits) on interface 0
Ethernet II, Src: Watchgua_LOCALMAC (AA:BB:CC:LOCALMAC), Dst: Hewlett-_SUB_MAC (11:22:33:SUB_MAC)
Internet Protocol Version 4, Src: __REMOTE__IP__ (__REMOTE__IP__), Dst: _LOCAL_IP_ (_LOCAL_IP_)
Transmission Control Protocol, Src Port: ftp (21), Dst Port: 54613 (54613), Seq: 300, Ack: 80, Len: 52
File Transfer Protocol (FTP)
Ah - então testamos a conexão a um servidor FTP que usava uma porta de controle fora do padrão e a transferência de arquivos funcionou corretamente.
Somente quando nos conectamos a um servidor FTP que usa a porta de controle padrão de 21, a transferência tem problemas.
Limpamos as configurações do firewall, reconstruímos e redefinimos as configurações no firewall. O problema foi corrigido.
As configurações aplicadas foram idênticas às configurações que existiam anteriormente. As configurações do firewall de alguma forma se tornaram corruptas. Isso é tudo que ela escreveu, realmente.