-
-
Notifications
You must be signed in to change notification settings - Fork 659
Troubleshooting
Very Common Issues
- Unable to read data from the transport connection : An existing connection was forcibly closed by the remote host
- Timed out trying to read data from the socket stream!
- FTPS not working on Linux since SSL session resumption is not supported
Common Issues
- I'm getting login errors but I can login fine in Firefox/Filezilla
- FluentFTP fails to install in Visual Studio 2010 : 'System.Runtime' already has a dependency defined for 'FluentFTP'.
- After uploading a file with special characters like "Caffè.png" it appears as "Caff?.bmp" on the FTP server. The server supports only ASCII but "è" is ASCII. FileZilla can upload this file without problems.
- I cannot delete a file if the filename contains Russian letters. FileZilla can delete this file without problems.
- I keep getting TimeoutException's in my Azure WebApp
- Many commands don't work on Windows CE
- After successfully transfering a single file with OpenWrite/OpenAppend, the subsequent files fail with some random error, like "Malformed PASV response"
- SSL Negotiation is very slow during FTPS login
- Full paths cause trouble in API calls on special servers
FluentFTP fails to install in Visual Studio 2010 (VS2010) > 'System.Runtime' already has a dependency defined for 'FluentFTP'.
Your VS has an older version of nuget.exe
so it cannot properly install the latest FluentFTP. You must download nuget.exe` manually and run these commands:
cd D:\Projects\MyProjectDir
C:\Nuget\nuget.exe install FluentFTP
After uploading a file with special characters like "Caffè.png" it appears as "Caff?.bmp" on the FTP server. The server supports only ASCII but "è" is ASCII. FileZilla can upload this file without problems.
Set the connection encoding manually to ensure that special characters work properly.
The default codepage that you should use is 1252 Windows Western
. It has support for English + European characters (accented characters).
client.Encoding = System.Text.Encoding.GetEncoding(1252); // ANSI codepage 1252 (Windows Western)
I cannot delete a file if the filename contains Russian letters. FileZilla can delete this file without problems.
Set the connection encoding manually to ensure that special characters work properly.
For Russian you need to use the codepage 1251 Windows Cyrillic
client.Encoding = System.Text.Encoding.GetEncoding(1251); // ANSI codepage 1251 (Windows Cyrillic)
I keep getting TimeoutException's in my Azure WebApp
First try reducing the socket polling interval, which Azure needs.
client.SocketPollInterval = 1000;
If that doesn't work then try reducing the timeouts too.
client.SocketPollInterval = 1000;
client.ConnectTimeout = 2000;
client.ReadTimeout = 2000;
client.DataConnectionConnectTimeout = 2000;
client.DataConnectionReadTimeout = 2000;
If none of these work, remember that Azure has in intermittent bug wherein it changes the IP-address during a FTP request. The connection is established with IP-address A and for the data transfer Azure uses IP-address B and this isn't allowed on many firewalls. This is a known Azure bug.
Many commands don't work on Windows CE
According to this from MSDN the Windows CE implementation of FTP is the bare minimum, and open to customization via source code. Many advanced commands such as CHMOD are unsupported.
After successfully transfering a single file with OpenWrite/OpenAppend, the subsequent files fail with some random error, like "Malformed PASV response"
You need to call FtpReply status = GetReply()
after you finish transfering a file to ensure no stale data is left over, which can mess up subsequent commands.
SSL Negotiation is very slow during FTPS login
FluentFTP uses SslStream
under the hood which is part of the .NET framework. SslStream
uses a feature of windows for updating root CA's on the fly, which can cause a long delay in the certificate authentication process. This can cause issues in FluentFTP related to the SocketPollInterval
property used for checking for ungraceful disconnections between the client and server. This MSDN Blog covers the issue with SslStream
and talks about how to disable the auto-updating of the root CA's.
FluentFTP logs the time it takes to authenticate. If you think you are suffering from this problem then have a look at Examples\Debug.cs for information on retrieving debug information.
Unable to read data from the transport connection : An existing connection was forcibly closed by the remote host
This means that on the server the [FTP daemon] service isn't running (probably not the case) or the service is currently still busy performing another operation. It almost sounds like the server is returning a message indicating it is still performing the last operation.
Try reducing the polling interval to ensure that the connection does not time-out.
client.SocketPollInterval = 1000;
Path, (file)Name, Fullname problems
In general, if you are having problems with using paths in the API calls (which then use these paths in various FTP subcommands to the server), the problems could by caused by
- the server encountering difficulties parsing the path or
- FluentFTP encountering difficulties parsing the path or the returned information.
In most cases, you can use the following technique as a workaround, but we encourage you to report these cases so the we can evaluate handling them in a special way.
Always try: (example uses a really truly horrible path)
string path = "/home/mike/test/[].folder/diag rams/old"
FTP_Sess.SetWorkingDirectory(path);
This will get you to the place where you want to work. If even that fails, report it. Then you do the listing. Once again, if that does not produce the desired information, please report.
FtpListItem[] items = FTP_Sess.GetListing("", FtpListOption.ForceList | FtpListOption.NoPath);
You will see (if you turn on logging):
> SetWorkingDirectory("/home/mike/[].folder/dia grams/old")
CWD /home/mike/[].folder/dia grams/old
250 CWD command successful
> GetListing("", ForceList, NoPath)
PWD
257 "/home/mike/[].folder/dia grams/old" is the current directory
TYPE I
200 Type set to I
EPSV
229 Entering Extended Passive Mode (|||4058|)
LIST
150 Opening BINARY mode data connection for file list
+---------------------------------------+
-rw-r--r-- 1 mike mike 132480 Sep 19 12:04 test1
-rw-r--r-- 1 mike mike 132480 Sep 19 12:04 test2
-rw-r--r-- 1 mike mike 132480 Sep 19 12:04 test3
-rw-r--r-- 1 root root 6 Sep 18 15:17 te st.bin
-----------------------------------------
226 Transfer complete
items.Name
and items.Fullname
should be correct.
- Auto Connection
- Auto Reconnection
- FTP(S) Connection
- FTP(S) Connection using GnuTLS
- FTPS Proxies
- Custom Servers
- Custom Commands
- v40 Migration Guide