Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
7.8k views
in .NET FTP by (300 points)
I have a simple program that sends and retrieves files via FTP using edtFtpnet/PRO(.NET). The programs run on a schedule and run fine on my current production server running Windows Server 2003. I am in the process of setting up another server (Windows Server 2008 R2) and have move these programs over. I have run the program and found I am not connecting to the FTP sites and I am getting the following error:


ERROR [ExFTPControlSocket] 25 Mar 2011 15:26:38.781 : Failed to create connecting socket
ERROR [ExFTPControlSocket] 25 Mar 2011 15:26:38.781 : System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 167.212.0.145:58889
ERROR [ExFTPControlSocket] 25 Mar 2011 15:26:38.781 : at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
ERROR [ExFTPControlSocket] 25 Mar 2011 15:26:38.781 : at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
ERROR [ExFTPControlSocket] 25 Mar 2011 15:26:38.781 : at ll4TsQwXf2LtQmEp8YX.FQ1evSwO89w8nBa7acu.Connect(EndPoint )
ERROR [ExFTPControlSocket] 25 Mar 2011 15:26:38.781 : at HHBMX9FXeN0mKe9Ia0b.tHUv9PFOCbaWLfi7Gew.pkHfMtkh0s(BaseSocket , String , Int32 )
ERROR [ExFTPControlSocket] 25 Mar 2011 15:26:38.781 : at r7yDNBIT58VB7HDnNDu.efZrAqIPfN459K81Gcm.pkHfMtkh0s(BaseSocket , String , Int32 )
ERROR [ExFTPControlSocket] 25 Mar 2011 15:26:38.781 : at HHBMX9FXeN0mKe9Ia0b.tHUv9PFOCbaWLfi7Gew.mec1HP4oQ(String , Int32 , BaseSocket )


Does anybody know if there is a server setting to allow these outbound requests or do I need to set a property in the FTP class to get this to work in Windows Server 2008?

Thanks in advance for any help.

Bob

6 Answers

0 votes
by (51.6k points)
Hi Bob

It seems to me that if you are getting a timeout then the connection is probably not being blocked. If you post a little more of the log preceding the error then we'll be able to see how long the error takes to occur after the connection request is made. Also, have you set the timeout? If so, what is its value?

- Hans (EnterpriseDT)
0 votes
by (300 points)
Hans,

Here is more of the log starting from the beginning of the process:

INFO [Bpit.TradeMgmt.Business.FileUtility] 25 Mar 2011 15:26:16.546 : ********************* Start of Import Process *********************
INFO [LicenseProperties] 25 Mar 2011 15:26:16.875 : Licence expiry date: 12/31/9999
INFO [LicenseProperties] 25 Mar 2011 15:26:16.875 : Production license
INFO [LicenseProperties] 25 Mar 2011 15:26:16.890 : Licence expiry date: 12/31/9999
INFO [LicenseProperties] 25 Mar 2011 15:26:16.890 : Production license
ERROR [ExFTPControlSocket] 25 Mar 2011 15:26:38.781 : Failed to create connecting socket
ERROR [ExFTPControlSocket] 25 Mar 2011 15:26:38.781 : System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 167.212.0.145:58889
ERROR [ExFTPControlSocket] 25 Mar 2011 15:26:38.781 : at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
ERROR [ExFTPControlSocket] 25 Mar 2011 15:26:38.781 : at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
ERROR [ExFTPControlSocket] 25 Mar 2011 15:26:38.781 : at ll4TsQwXf2LtQmEp8YX.FQ1evSwO89w8nBa7acu.Connect(EndPoint )
ERROR [ExFTPControlSocket] 25 Mar 2011 15:26:38.781 : at HHBMX9FXeN0mKe9Ia0b.tHUv9PFOCbaWLfi7Gew.pkHfMtkh0s(BaseSocket , String , Int32 )
ERROR [ExFTPControlSocket] 25 Mar 2011 15:26:38.781 : at r7yDNBIT58VB7HDnNDu.efZrAqIPfN459K81Gcm.pkHfMtkh0s(BaseSocket , String , Int32 )
ERROR [ExFTPControlSocket] 25 Mar 2011 15:26:38.781 : at HHBMX9FXeN0mKe9Ia0b.tHUv9PFOCbaWLfi7Gew.mec1HP4oQ(String , Int32 , BaseSocket )
ERROR [FTPClient] 25 Mar 2011 15:26:38.781 : Caught exception
ERROR [FTPClient] 25 Mar 2011 15:26:38.781 : System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 167.212.0.145:58889
ERROR [FTPClient] 25 Mar 2011 15:26:38.781 : at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
ERROR [FTPClient] 25 Mar 2011 15:26:38.781 : at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
ERROR [FTPClient] 25 Mar 2011 15:26:38.781 : at ll4TsQwXf2LtQmEp8YX.FQ1evSwO89w8nBa7acu.Connect(EndPoint )
ERROR [FTPClient] 25 Mar 2011 15:26:38.781 : at HHBMX9FXeN0mKe9Ia0b.tHUv9PFOCbaWLfi7Gew.pkHfMtkh0s(BaseSocket , String , Int32 )
ERROR [FTPClient] 25 Mar 2011 15:26:38.781 : at r7yDNBIT58VB7HDnNDu.efZrAqIPfN459K81Gcm.pkHfMtkh0s(BaseSocket , String , Int32 )
ERROR [FTPClient] 25 Mar 2011 15:26:38.781 : at HHBMX9FXeN0mKe9Ia0b.tHUv9PFOCbaWLfi7Gew.mec1HP4oQ(String , Int32 , BaseSocket )
ERROR [FTPClient] 25 Mar 2011 15:26:38.781 : at r7yDNBIT58VB7HDnNDu.efZrAqIPfN459K81Gcm.QlBfkysDWT(String , Int32 )
ERROR [FTPClient] 25 Mar 2011 15:26:38.781 : at EnterpriseDT.Net.Ftp.FTPControlSocket.eyU9bUJij4()
ERROR [FTPClient] 25 Mar 2011 15:26:38.781 : at EnterpriseDT.Net.Ftp.FTPClient.upbcHZnIi(String )
ERROR [FTPClient] 25 Mar 2011 15:26:38.781 : at EnterpriseDT.Net.Ftp.FTPClient.8EbuoLNQa(String , String )
ERROR [SecureNetworkStream] 25 Mar 2011 15:26:39.812 : Socket.Receive() failed
ERROR [SecureNetworkStream] 25 Mar 2011 15:26:39.812 : System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
ERROR [SecureNetworkStream] 25 Mar 2011 15:26:39.812 : at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
ERROR [SecureNetworkStream] 25 Mar 2011 15:26:39.812 : at ll4TsQwXf2LtQmEp8YX.FQ1evSwO89w8nBa7acu.Receive(Byte[] , Int32 , Int32 , SocketFlags )
ERROR [SecureNetworkStream] 25 Mar 2011 15:26:39.812 : at wi7QZAwvr7c0xG3ysaW.G50OIwwBWkYnRNmlLKO.Read(Byte[] , Int32 , Int32 )
ERROR [FTPControlSocket] 25 Mar 2011 15:26:39.812 : Read failed ('' read so far)
WARN [FTPClient] 25 Mar 2011 15:26:39.812 : ReadReply failed
WARN [FTPClient] 25 Mar 2011 15:26:39.812 : EnterpriseDT.Net.Ftp.ControlChannelIOException: An I/O exception occurred.
WARN [FTPClient] 25 Mar 2011 15:26:39.812 : at EnterpriseDT.Net.Ftp.FTPControlSocket.jxFNUh1KA()
WARN [FTPClient] 25 Mar 2011 15:26:39.812 : at EnterpriseDT.Net.Ftp.FTPControlSocket.j2d91gHU21()
WARN [FTPClient] 25 Mar 2011 15:26:39.812 : at EnterpriseDT.Net.Ftp.FTPClient.ValidateTransfer()
ERROR [FTPClient] 25 Mar 2011 15:26:39.812 : Exception in ValidateTransferOnError())
ERROR [FTPClient] 25 Mar 2011 15:26:39.812 : EnterpriseDT.Net.Ftp.ControlChannelIOException: An I/O exception occurred.
ERROR [FTPClient] 25 Mar 2011 15:26:39.812 : at EnterpriseDT.Net.Ftp.FTPClient.ValidateTransfer()
ERROR [FTPClient] 25 Mar 2011 15:26:39.812 : at EnterpriseDT.Net.Ftp.FTPClient.ValidateTransferOnError()
ERROR [FTPClient] 25 Mar 2011 15:26:39.812 : SystemException in Get(string,string)
ERROR [FTPClient] 25 Mar 2011 15:26:39.812 : System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 167.212.0.145:58889
ERROR [FTPClient] 25 Mar 2011 15:26:39.812 : at EnterpriseDT.Net.Ftp.FTPClient.8EbuoLNQa(String , String )
ERROR [FTPClient] 25 Mar 2011 15:26:39.812 : at EnterpriseDT.Net.Ftp.FTPClient.Get(String localPath, String remoteFile)
ERROR [ExFTPConnection] 25 Mar 2011 15:26:44.812 : Transfer error on attempt #1 retrying:
ERROR [ExFTPConnection] 25 Mar 2011 15:26:44.812 : System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 167.212.0.145:58889
ERROR [ExFTPConnection] 25 Mar 2011 15:26:44.812 : at EnterpriseDT.Net.Ftp.FTPClient.8EbuoLNQa(String , String )
ERROR [ExFTPConnection] 25 Mar 2011 15:26:44.812 : at EnterpriseDT.Net.Ftp.FTPClient.Get(String localPath, String remoteFile)
ERROR [ExFTPConnection] 25 Mar 2011 15:26:44.812 : at EnterpriseDT.Net.Ftp.FTPConnection.DownloadFile(String localPath, String remoteFile)
ERROR [ExFTPConnection] 25 Mar 2011 15:26:44.812 : at EnterpriseDT.Net.Ftp.ExFTPConnection.SyncDownloadFile(String localPath, String remoteFile)
ERROR [ExFTPConnection] 25 Mar 2011 15:26:44.812 : Connection test failed. Closing...
ERROR [ExFTPConnection] 25 Mar 2011 15:26:44.812 : EnterpriseDT.Net.Ftp.FTPException: The FTP client has not yet connected to the server. The requested action cannot be performed until after a connection has been established.
ERROR [ExFTPConnection] 25 Mar 2011 15:26:44.812 : at EnterpriseDT.Net.Ftp.FTPClient.cRd1ycfkT(Boolean )
ERROR [ExFTPConnection] 25 Mar 2011 15:26:44.812 : at EnterpriseDT.Net.Ftp.FTPClient.Pwd()
ERROR [ExFTPConnection] 25 Mar 2011 15:26:44.812 : at EnterpriseDT.Net.Ftp.ExFTPConnection.TestConnection()
INFO [FTPControlSocket] 25 Mar 2011 15:26:44.828 : Killed control socket
WARN [ExFTPConnection] 25 Mar 2011 15:26:44.843 : Connection broken - attempting reconnect
INFO [LicenseProperties] 25 Mar 2011 15:26:44.843 : Licence expiry date: 12/31/9999
INFO [LicenseProperties] 25 Mar 2011 15:26:44.843 : Production license
INFO [LicenseProperties] 25 Mar 2011 15:26:44.843 : Licence expiry date: 12/31/9999
INFO [LicenseProperties] 25 Mar 2011 15:26:44.843 : Produc
0 votes
by (162k points)
It looks from the log that you are connecting in PASV mode. It seems that your firewall is blocking the data transfer as a socket can't be created connecting to the server.

Try doing the same thing with Filezilla to see if that works. Also try active mode instead of passive (PASV).

And finally, please enable logging at the Debug level and post the log (looks like it is at Info level).
0 votes
by (300 points)
OK, I set to debug level and I also set the connect mode to Active (oFTP.ConnectMode = FTPConnectMode.ACTIVE;) however it looks like in the log that it is still connecting using PASV. How do I set to active mode?

Also, I tested using Active mode on Internet Explorer and that allowed me to connect so I think your suggestion of active mode is the right path.


INFO [Bpit.TradeMgmt.Business.FileUtility] 28 Mar 2011 09:41:04.921 : ********************* Start of Import Process *********************
DEBUG [LicenseProperties] 28 Mar 2011 09:41:05.109 : Looking for subkey Software\Enterprise Distributed Technologies\edtFTPnet PRO (fallback )
DEBUG [LicenseProperties] 28 Mar 2011 09:41:05.109 : Found license subkey Software\Enterprise Distributed Technologies\edtFTPnet PRO
DEBUG [LicenseProperties] 28 Mar 2011 09:41:05.109 : Did not find license subkeys Software\Enterprise Distributed Technologies\edtFTPnet PRO or in registry
DEBUG [LicenseProperties] 28 Mar 2011 09:41:05.125 : Looking for subkey Software\Enterprise Distributed Technologies\edtFTPnet PRO (fallback )
DEBUG [LicenseProperties] 28 Mar 2011 09:41:05.125 : Found license subkey Software\Enterprise Distributed Technologies\edtFTPnet PRO
DEBUG [LicenseProperties] 28 Mar 2011 09:41:05.125 : Did not find license subkeys Software\Enterprise Distributed Technologies\edtFTPnet PRO or in registry
DEBUG [LicenseProperties] 28 Mar 2011 09:41:05.140 : Looking for subkey Software\Enterprise Distributed Technologies\edtFTPnet PRO (fallback )
DEBUG [LicenseProperties] 28 Mar 2011 09:41:05.140 : Found license subkey Software\Enterprise Distributed Technologies\edtFTPnet PRO
DEBUG [LicenseProperties] 28 Mar 2011 09:41:05.140 : Did not find license subkeys Software\Enterprise Distributed Technologies\edtFTPnet PRO or in registry
DEBUG [LicenseProperties] 28 Mar 2011 09:41:05.156 : Looking for subkey Software\Enterprise Distributed Technologies\edtFTPnet PRO (fallback )
DEBUG [LicenseProperties] 28 Mar 2011 09:41:05.156 : Found license subkey Software\Enterprise Distributed Technologies\edtFTPnet PRO
DEBUG [LicenseProperties] 28 Mar 2011 09:41:05.156 : Did not find license subkeys Software\Enterprise Distributed Technologies\edtFTPnet PRO or in registry
INFO [LicenseProperties] 28 Mar 2011 09:41:05.218 : Licence expiry date: 12/31/9999
INFO [LicenseProperties] 28 Mar 2011 09:41:05.218 : Production license
DEBUG [FTPConnection] 28 Mar 2011 09:41:05.234 : Set LocalDirectory='C:\Windows\system32'
DEBUG [SecureFTPConnection] 28 Mar 2011 09:41:05.234 : Set LocalDirectory to C:\Windows\system32
INFO [LicenseProperties] 28 Mar 2011 09:41:05.234 : Licence expiry date: 12/31/9999
INFO [LicenseProperties] 28 Mar 2011 09:41:05.234 : Production license
DEBUG [SSLFTPClient] 28 Mar 2011 09:41:05.234 : Connecting to ftp.ridgeclearing.com:21
DEBUG [SSLFTPControlSocket] 28 Mar 2011 09:41:05.250 : waitOnShutdownSSL=True
DEBUG [HostNameResolver] 28 Mar 2011 09:41:05.406 : ftp.ridgeclearing.com resolved to 167.212.0.145
DEBUG [ExFTPControlSocket] 28 Mar 2011 09:41:05.406 : Connecting directly to ftp-server ftp.ridgeclearing.com:21
DEBUG [FTPControlSocket] 28 Mar 2011 09:41:05.453 : Setting socket timeout=120000
DEBUG [FTPControlSocket] 28 Mar 2011 09:41:05.453 : Command encoding=System.Text.ASCIIEncoding
DEBUG [ExFTPControlSocket] 28 Mar 2011 09:41:05.453 : Created control-socket: SocksContext=, ProxySettings=NoProxy, RemoteHost=ftp.ridgeclearing.com, controlPort=21, timeout=120000
DEBUG [FTPControlSocket] 28 Mar 2011 09:41:05.468 : StrictReturnCodes=False
DEBUG [FTPControlSocket] 28 Mar 2011 09:41:05.500 : 220 cosftpp1 NcFTPd Server (licensed copy) ready.
DEBUG [FTPControlSocket] 28 Mar 2011 09:41:05.515 : ---> USER #######
DEBUG [FTPControlSocket] 28 Mar 2011 09:41:05.562 : 331 User ####### okay, need password.
DEBUG [FTPControlSocket] 28 Mar 2011 09:41:05.562 : ---> PASS ********
DEBUG [FTPControlSocket] 28 Mar 2011 09:41:05.609 : 230-You are user #3 of 50 simultaneous users allowed.
DEBUG [FTPControlSocket] 28 Mar 2011 09:41:05.859 : 230-
DEBUG [FTPControlSocket] 28 Mar 2011 09:41:05.859 : 230 Restricted user logged in.
DEBUG [FTPConnection] 28 Mar 2011 09:41:05.859 : Successfully logged in
DEBUG [ExFTPConnection] 28 Mar 2011 09:41:05.875 : Starting KeepAlive thread with period 30s
DEBUG [FTPControlSocket] 28 Mar 2011 09:41:05.890 : ---> TYPE I
DEBUG [FTPControlSocket] 28 Mar 2011 09:41:05.937 : 200 Type okay.
DEBUG [FTPControlSocket] 28 Mar 2011 09:41:05.937 : ---> PWD
DEBUG [FTPControlSocket] 28 Mar 2011 09:41:05.968 : 257 "/" is cwd.
DEBUG [FTPControlSocket] 28 Mar 2011 09:41:05.984 : ---> TYPE I
DEBUG [FTPControlSocket] 28 Mar 2011 09:41:06.031 : 200 Type okay.
DEBUG [ExFTPConnection] 28 Mar 2011 09:41:06.031 : Attempt #1
DEBUG [FTPConnection] 28 Mar 2011 09:41:06.031 : DownloadFile(c:\mmapps\files\,std_msd_v81_3298.dat.pgp)
DEBUG [FTPConnection] 28 Mar 2011 09:41:06.046 : Combining absolute path 'C:\Windows\system32' with relative path 'c:\mmapps\files\'
DEBUG [FTPClient] 28 Mar 2011 09:41:06.046 : Setting local path to c:\mmapps\files\std_msd_v81_3298.dat.pgp
DEBUG [FTPControlSocket] 28 Mar 2011 09:41:06.078 : ---> PASV
DEBUG [FTPControlSocket] 28 Mar 2011 09:41:06.125 : 227 Entering Passive Mode (167,212,0,145,148,234)
DEBUG [FTPControlSocket] 28 Mar 2011 09:41:06.125 : Server supplied address=167.212.0.145
DEBUG [FTPControlSocket] 28 Mar 2011 09:41:06.125 : Server supplied port=38122
DEBUG [FTPControlSocket] 28 Mar 2011 09:41:06.125 : Substituting server supplied IP (167.212.0.145) with remote host IP (167.212.0.145)
DEBUG [HostNameResolver] 28 Mar 2011 09:41:06.125 : 167.212.0.145 resolved to 167.212.0.145
DEBUG [ExFTPControlSocket] 28 Mar 2011 09:41:06.125 : Connecting directly to ftp-server 167.212.0.145:38122
ERROR [ExFTPControlSocket] 28 Mar 2011 09:41:27.140 : Failed to create connecting socket
ERROR [ExFTPControlSocket] 28 Mar 2011 09:41:27.140 : System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 167.212.0.145:38122
ERROR [ExFTPControlSocket] 28 Mar 2011 09:41:27.140 : at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
ERROR [ExFTPControlSocket] 28 Mar 2011 09:41:27.140 : at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
ERROR [ExFTPControlSocket] 28 Mar 2011 09:41:27.140 : at ll4TsQwXf2LtQmEp8YX.FQ1evSwO89w8nBa7acu.Connect(EndPoint )
ERROR [ExFTPControlSocket] 28 Mar 2011 09:41:27.140 : at HHBMX9FXeN0mKe9Ia0b.tHUv9PFOCbaWLfi7Gew.pkHfMtkh0s(BaseSocket , String , Int32 )
ERROR [ExFTPControlSocket] 28 Mar 2011 09:41:27.140 : at r7yDNBIT58VB7HDnNDu.efZrAqIPfN459K81Gcm.pkHfMtkh0s(BaseSocket , String , Int32 )
ERROR [ExFTPControlSocket] 28 Mar 2011 09:41:27.140 : at HHBMX9FXeN0mKe9Ia0b.tHUv9PFOCbaWLfi7Gew.mec1HP4oQ(String , Int32 , BaseSocket )
ERROR [FTPClient] 28 Mar 2011 09:41:27.140 : Caught exception
0 votes
by (162k points)
Make sure you set the ConnectMode to ACTIVE prior to connecting.
0 votes
by (300 points)
OK, I got it to work. I have multiple retrieve methods for getting files and did not set the connect mode on the one that was being called.

This is resolved. Thanks for your help.

Bob

Categories

...