Discuss (FTP), (FTP on .NET CF) and (FTPS, SFTP and SCP).
no avatar
User

Liglio

Posts

4

Joined

Wed Feb 24, 2010 4:26 am

Location

Brazil

Connect error - Control channel unexpectedly closed

by Liglio » Wed Feb 24, 2010 9:02 am

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)
no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

Re: Connect error - Control channel unexpectedly closed

by support2 » Thu Feb 25, 2010 11:01 pm

Does it work if it is not running as a service?
no avatar
User

Liglio

Posts

4

Joined

Wed Feb 24, 2010 4:26 am

Location

Brazil

by Liglio » Fri Feb 26, 2010 12:07 am

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.
no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

by support2 » Fri Feb 26, 2010 7:41 am

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?
no avatar
User

Liglio

Posts

4

Joined

Wed Feb 24, 2010 4:26 am

Location

Brazil

by Liglio » Sat Feb 27, 2010 12:19 am

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 ?
no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

by support2 » Mon Mar 01, 2010 11:35 pm

What happens in a DOS prompt when you go 'nslookup hostname'?
no avatar
User

Liglio

Posts

4

Joined

Wed Feb 24, 2010 4:26 am

Location

Brazil

by Liglio » Thu Mar 04, 2010 5:04 am

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

Who is online

Users browsing this forum: No registered users and 42 guests

Powered by phpBB ® | phpBB3 Style by KomiDesign
cron