Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
12.6k views
in .NET FTP by (400 points)
My application downloads a number of files on startup. I am using edtFTPnet (free) V1.3.0. The vast majority of users (98%+) connect to the server and download without issue. However, this is not the case for 2 or 3 individuals.

Extract from the monitor file follows:
DEBUG [FTPControlSocket] 25 Oct 2008 17:54:49.547 : 425 Sorry, invalid address given
INFO [FTPControlSocket] 25 Oct 2008 17:54:49.547 : Expected reply codes = [220,230] (strict=False)
DEBUG [FTPControlSocket] 25 Oct 2008 17:54:49.627 : ---> SIZE ./htdocs/fymfiles_2/FYMYards.ini
ERROR [FTPControlSocket] 25 Oct 2008 17:54:49.757 : Exception in SendCommand : System.IO.IOException: Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.
System.IO.IOException: Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.
at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)

Is there some setting on their local machines which is causing this problem? Any suggestions would be most welcome.

thanks,
Jim

8 Answers

0 votes
by (162k points)
What did the client send prior to your log excerpt , i.e. what did it send for the server to respond with "425 Sorry, invalid address given"?
0 votes
by (400 points)
This is the start of the log file
DEBUG [FTPConnection] 25 Oct 2008 17:54:47.794 : Set LocalDirectory='C:\FYM'
DEBUG [HostNameResolver] 25 Oct 2008 17:54:48.986 : ftp.fymanager.co.uk resolved to 213.171.193.5
DEBUG [FTPClient] 25 Oct 2008 17:54:48.986 : Connecting to 213.171.193.5:21
DEBUG [FTPControlSocket] 25 Oct 2008 17:54:49.006 : Setting socket timeout=120000
DEBUG [FTPControlSocket] 25 Oct 2008 17:54:49.146 : Command encoding=System.Text.ASCIIEncoding
DEBUG [FTPControlSocket] 25 Oct 2008 17:54:49.156 : StrictReturnCodes=False
DEBUG [FTPControlSocket] 25 Oct 2008 17:54:49.547 : 425 Sorry, invalid address given

which is exactly the same for a successful connection (apart from a different local directory) e.g.
DEBUG [FTPConnection] 25 Oct 2008 10:42:34.968 : Set LocalDirectory='H:\Documents and Settings\James Hill\My Documents\Visual Studio 2008\Projects\ftptest\ftptest\bin\Debug'
DEBUG [HostNameResolver] 25 Oct 2008 10:42:35.000 : ftp.fymanager.co.uk resolved to 213.171.193.5
DEBUG [FTPClient] 25 Oct 2008 10:42:35.015 : Connecting to 213.171.193.5:21
DEBUG [FTPControlSocket] 25 Oct 2008 10:42:35.609 : Setting socket timeout=120000
DEBUG [FTPControlSocket] 25 Oct 2008 10:42:35.609 : Command encoding=System.Text.ASCIIEncoding
DEBUG [FTPControlSocket] 25 Oct 2008 10:42:35.609 : StrictReturnCodes=False
DEBUG [FTPControlSocket] 25 Oct 2008 10:42:35.656 : 220-Matrix FTP server ready.
DEBUG [FTPControlSocket] 25 Oct 2008 10:42:35.656 : 220-This is a private system - No anonymous login

Data from different users - the 1st fails to connect the 2nd successfully connects.

Jim
0 votes
by (162k points)
This is an unusual problem - it looks like it is a PureFTPD message. Various threads around the Internet claim that it is a server problem (e.g. http://forums.techguy.org/web-email/762 ... valid.html).

I don't find that explanation totally convincing (although it is definitely a message coming from the server when the client first connects - very unusual).

My best guess is that the server does a reverse DNS lookup on the IP address of the client, and returns this error if the client's IP address can't be resolved. Perhaps to ensure that only IP addresses that have valid DNS records can connect to the server.

I suspect the solution will be (if you have control over the FTP server) to run PureFTPD in a mode that doesn't try to resolve the IP addresses of clients. This is normally done using the '-H' flag.
0 votes
by (400 points)
Thanks for yoru help - I have written to the server Hosts to see if they will/can run PureFTPD with the -H flag.

I do have the option of switching from the Unix based to a Windows based server - would this make any difference?

thanks,
Jim
0 votes
by (51.6k points)
This behavior is specific to this particular server software, so you are unlikely to see it if you another server. There doesn't appear to be a windows version of PureFTPD so it's very unlikely that you'd see this behavior if you switch to another server.

- Hans (EnterpriseDT)
0 votes
by (400 points)
I had the Domain moved from a Linux to a Windows based server but unfortunately the user concerned still gets the same error. :(

Could this be something to do with his Internet Service Provider?

Jim
0 votes
by (162k points)
Can you email us the full log file (zipped).

This message is coming from the FTP server, and as far as I can tell pureftpd is the only server that produces this message, so I'm not sure how a Windows FTP server could produce it. I doubt pureftpd is being used on Windows.
0 votes
by (162k points)
We've gone through the logs you emailed us, and the problem seems to be the same. On Windows you now seem to be using Matrix FTP server, about which I can found out very little. It is possible that it is based on PureFTPD source code.

Again, I suspect (guess?) the problem is caused by the client's IP address not resolving on the server. If this is the case you should get the same error from these clients if you use command line FTP.

Interestingly, this link (http://forums.techguy.org/web-email/736 ... ie6-8.html) is also experiencing the problem using Matrix FTP server.

If you get the same error with other FTP clients, you'll need to talk to whoever is hosting the server and find a techie who can look at the FTP logs and figure out why this is happening.

Categories

...