Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect directory listing on "Failed to connect to host" exception #723

Closed
pdavis86 opened this issue May 19, 2021 · 3 comments
Closed
Labels

Comments

@pdavis86
Copy link

FTP OS: Windows

FTP Server: Azure Web App

Computer OS: Windows

FluentFTP Version: 34.0.0

When running a lot of operations I have found that sometimes the connection drops so a new IOException("Failed to connect to host.") is thrown on line 919 of FtpSocketStream.cs. That exception is then caught and ignored by line 608 of FtpClient_Listing.cs with the comment "// suppress all other types of exceptions". The result is that there is a silent failure and FluentFTP incorrectly returns that the directory contains no files.

@jsantos74
Copy link

jsantos74 commented Jul 19, 2021

I have the same problem in version 34.0.1.

I think I found the problem in my case. Azure Web App have multiple IP's for the same host and the list always failed when the IP changed suddenly from one to another:

Example:

  • List Folder 1 on SERVER_1:
    • GetHostAddresses for SERVER_1 returns IP_1 , IP_2, IP_3
    • Connect to IP_1:21 of SERVER_1
    • Enter Entering Extended Passive PORT_1
    • GetHostAddresses for SERVER_1 returns IP_1 , IP_2, IP_3
    • Connect to IP_1:PORT_1
    • OK. List
  • List Folder 2 on SERVER_1:
    • GetHostAddresses for SERVER_1 returns IP_1 , IP_2, IP_3
    • Connect to IP_1:21 of SERVER_1
    • Enter Entering Extended Passive PORT_2
    • GetHostAddresses for SERVER_1 returns IP_2, IP_3 , IP_1
    • Connect to IP_2:PORT_2
    • Not OK - Connection Failed...

I've Changed the code and tested and it's startted to work fine.

@pdavis86
Copy link
Author

pdavis86 commented Aug 4, 2021

Looks like the change in 34.0.2 had decreased the frequency of the issue but I am still sometimes seeing empty enumerable on calling GetListing() but a second attempt does retrieve the listing

@FanDjango
Copy link
Collaborator

I would like to refer this to #1030 - because of "When running a lot of operations". Let me close this and please follow the #1030 issue, please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants