Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
12k views
in .NET FTP by (240 points)
Hello,

I made a windows service .net to download files from a ftp server.
In a windows XP machine it works fine, but in a virtual machine with windows 2003 server it fails in the Connect.

I tried to connect using ftp DOS and make a dir command and it worked fine in the fail machine.

here is the log of the fail machine:

DEBUG [FTPClient] 23 Feb 2010 19:28:42.236 : Connecting to ftpbsb.ons.org.br:21
DEBUG [HostNameResolver] 23 Feb 2010 19:28:42.236 : ftpbsb.ons.org.br resolved to 10.107.1.65
DEBUG [FTPControlSocket] 23 Feb 2010 19:28:42.276 : Setting socket timeout=120000
DEBUG [FTPControlSocket] 23 Feb 2010 19:28:42.276 : Command encoding=System.Text.ASCIIEncoding
DEBUG [FTPControlSocket] 23 Feb 2010 19:28:42.276 : StrictReturnCodes=False
ERROR [FTPControlSocket] 23 Feb 2010 19:28:42.306 : Control channel unexpectedly closed ('' read so far)
DEBUG [FTPConnection] 23 Feb 2010 19:28:42.406 : Closing connection (instance=0)
DEBUG [FTPFileFactory] 23 Feb 2010 19:28:42.406 : Defaulting to Unix parsing
DEBUG [FTPControlSocket] 23 Feb 2010 19:28:42.406 : ---> QUIT
ERROR [FTPControlSocket] 23 Feb 2010 19:28:42.406 : Control channel unexpectedly closed ('' read so far)
ERROR [FTPControlSocket] 23 Feb 2010 19:28:42.406 : Exception in SendCommand
ERROR [FTPControlSocket] 23 Feb 2010 19:28:42.406 : EnterpriseDT.Net.Ftp.ControlChannelIOException: Control channel unexpectedly closed ('' read so far)
ERROR [FTPControlSocket] 23 Feb 2010 19:28:42.406 : at EnterpriseDT.Net.Ftp.FTPControlSocket.ReadLine()
ERROR [FTPControlSocket] 23 Feb 2010 19:28:42.406 : at EnterpriseDT.Net.Ftp.FTPControlSocket.ReadReply()
ERROR [FTPControlSocket] 23 Feb 2010 19:28:42.406 : at EnterpriseDT.Net.Ftp.FTPControlSocket.SendCommand(String command)

6 Answers

0 votes
by (162k points)
Does it work if it is not running as a service?
0 votes
by (240 points)
I tested as a console application, and I got the same error. In this same machine, I have other two services downloading from diferents FTPs and it is working fine using edtFTPnet.
0 votes
by (162k points)
Can you use ftp.exe from the same machine the service is running on? Is the IP address correct that is resolved from the hostname?
0 votes
by (240 points)
Hi,

the ftp.exe is working fine in the same machine where the error occurs. In both machines XP (no error) and 2003 server (error occurs) the IP of the FTP server obitained using PING is 10.107.1.9, but in the edtNET log file of the 2003 server machine (error occurs) the resolved IP is 10.107.1.65. In the XP machine (no error) the IP is the same of the PING, 10.107.1.9.

The FTP server is a proxy reverse of an outside FTP server. But I have in the 2003 server machine (error occurs) a service downloading froman other proxy reverse FTP and it is working fine. It seems that this particular FTP server ftpsbsb.ons.org.br is NOT beeing resolved correct.

I USED THE IP ADDRESS INSTEAD OF THE FTP SERVER NAME AND IT WORKED.

Why the IP is not being resolved correct in the windows 2003 server machine to this particular FTP proxy reverse server ? Maybe it has two network cards ?

Can we fix it to use server name ?
0 votes
by (162k points)
What happens in a DOS prompt when you go 'nslookup hostname'?
0 votes
by (240 points)
using hostname the ftp server name

it appears in the screen:

>nslookup ftpsbsb.ons.org.br

DNS Request timed out.
time out was 2 seconds
**** Can't find server name for address 10.181.5.2: Timed out
Server: Unknown
Address: 10.181.5.2

DNS request timed out.
time out was 2 seconds.
DNS request timed out.
time out was 2 seconds.
**** Request to Unknown timed-out

Categories

...