Closed funkel1989 closed 1 month ago
Ok, I have some questions:
we are occasionally seeing the below error
After updating, you occasionally see the error. Before updating, the error was never to be seen?
49.x.x -> 50.x.x There were certainly a lot of fixes and changes.
But:
I specifically remember (but I could be wrong) that async connect itself was not correctly honoring the timeout time that the user set - it was always the system default (which is longer that your 10 seconds). Thus now with fixed timeout handling, your 10 seconds are actually taking effect and might be on the edge of being to short.
Have you tried increasing the timeout a little?
Beyond that I am looking forward to a verbose log.
I feel like AutoConnect used to re-initialize the connection if it was closed but that is where I'm getting the Timeouts.
You might want to elaborate on the statement a little bit. Huh?
@FanDjango Here is a snippet of the logs we are getting when this issue is occurring.
[2024-08-01T15:58:03.041Z] # AutoConnect()
[2024-08-01T15:58:03.042Z] # AutoDetect(CloneConnection = False, FirstOnly = True, IncludeImplicit = True, AbortOnTimeout = True, RequireEncryption = False, ProtocolPriority = [Tls11, Tls12])
[2024-08-01T15:58:03.043Z] # Disconnect()
[2024-08-01T15:58:03.044Z] Command: QUIT
[2024-08-01T15:58:03.046Z] Warning: AsyncFtpClient.Disconnect(): Exception caught and discarded while closing control connection : Unable to write data to the transport connection: An established connection was aborted by the software in your host machine..
[2024-08-01T15:58:03.047Z] Status: Auto-Detect trying encryption mode "Auto" with "Tls11, Tls12"
[2024-08-01T15:58:03.048Z] # Connect(False)
[2024-08-01T15:58:03.053Z] Status: FluentFTP 50.1.0.0(.NET 6.0) AsyncFtpClient
[2024-08-01T15:58:03.055Z] # Disconnect()
[2024-08-01T15:58:03.057Z] Command: QUIT
[2024-08-01T15:58:03.058Z] Warning: AsyncFtpClient.Disconnect(): Exception caught and discarded while closing control connection : Unable to write data to the transport connection: An established connection was aborted by the software in your host machine..
[2024-08-01T15:58:03.060Z] Status: Connecting(async) AsyncFtpClient.FtpSocketStream(control) IP #1 = 204.236.238.164:21
[2024-08-01T15:58:03.080Z] Status: Waiting for a response
[2024-08-01T15:58:18.180Z] # Disconnect()
[2024-08-01T15:58:18.181Z] Command: QUIT
[2024-08-01T15:58:18.184Z] Warning: AsyncFtpClient.Disconnect(): Exception caught and discarded while closing control connection : Unable to write data to the transport connection: An established connection was aborted by the software in your host machine..
[2024-08-01T15:58:22.104Z] # AutoConnect()
[2024-08-01T15:58:22.105Z] # AutoDetect(CloneConnection = False, FirstOnly = True, IncludeImplicit = True, AbortOnTimeout = True, RequireEncryption = False, ProtocolPriority = [Tls11, Tls12])
[2024-08-01T15:58:22.106Z] # Disconnect()
[2024-08-01T15:58:22.107Z] Command: QUIT
[2024-08-01T15:58:22.109Z] Warning: AsyncFtpClient.Disconnect(): Exception caught and discarded while closing control connection : Unable to write data to the transport connection: An established connection was aborted by the software in your host machine..
[2024-08-01T15:58:22.110Z] Status: Auto-Detect trying encryption mode "Auto" with "Tls11, Tls12"
[2024-08-01T15:58:22.111Z] # Connect(False)
[2024-08-01T15:58:22.112Z] Status: FluentFTP 50.1.0.0(.NET 6.0) AsyncFtpClient
[2024-08-01T15:58:22.114Z] # Disconnect()
[2024-08-01T15:58:22.115Z] Command: QUIT
[2024-08-01T15:58:22.116Z] Warning: AsyncFtpClient.Disconnect(): Exception caught and discarded while closing control connection : Unable to write data to the transport connection: An established connection was aborted by the software in your host machine..
[2024-08-01T15:58:22.117Z] Status: Connecting(async) AsyncFtpClient.FtpSocketStream(control) IP #1 = 204.236.238.164:21
[2024-08-01T15:58:22.152Z] Status: Waiting for a response
[2024-08-01T15:58:37.249Z] # Disconnect()
[2024-08-01T15:58:37.250Z] Command: QUIT
[2024-08-01T15:58:37.253Z] Warning: AsyncFtpClient.Disconnect(): Exception caught and discarded while closing control connection : Unable to write data to the transport connection: An established connection was aborted by the software in your host machine..
One thing i noticed, its referencing dotnet 6 when we are running dotnet 8.
@FanDjango One more thing to note, We are still waiting to see if there is any more reproduction when deployed but we found that this issue was able to be re-created on our local machines across multiple engineers and when downgrading to 49.0.2 (our previous) we are no longer encountering the issues locally but can't guarantee this is the fix yet as the issue is sporadic to begin with. We are going to deploy with FluentFtp V49 and see what happens overnight and I'll update you on that tomorrow.
One thing i noticed, its referencing dotnet 6 when we are running dotnet 8.
You are being serviced by the .NET 6 targeted assembly of FluentFTP - we have no higher than that in NuGet, currently.
and when downgrading to 49.0.2 (our previous) we are no longer encountering the issues locally but can't guarantee this is the fix yet as the issue is sporadic to begin with
Fair enough. Let's give it a day or too now that you are focusing on this.
this issue was able to be re-created on our local machines across multiple engineers (sic)
That means that I could give you our bleeding edge branch to run that against - it certainly has more and clearer logging of the things that are happening. Would you be available for that? You current logging snippet is singularly devoid of any serious failure messages (Disregard this one: [2024-08-01T15:58:03.058Z] Warning: AsyncFtpClient.Disconnect(): Exception caught and discarded while closing control connection : Unable to write data to the transport connection: An established connection was aborted by the software in your host machine..
).
I feel like AutoConnect used to re-initialize the connection if it was closed but that is where I'm getting the Timeouts.
Phew, I have checked and now I understand what you meant by your comment: In V50.1.0 there actually is a failure to reuse a Client for multiple connect-disconnect sequences and this certainly might make AutoConnect fail if a retry is needed. This I have fixed for in the current master and it is waiting for release. So that might be the first thing to investigate: Use the current master locally and report back, please.
Means: AutoConnect succeeds when the first try connects. Subsequent attempts fail?
@FanDjango Can confirm. reverting back to 49.0.2 has resolved all of our timeout issues. We have not had an opportunity to test from the main branch yet.
Ok.
Let's divide this into topics possibly contributing to the problem:
Since azure stuff is notoriously slow in some areas, if you combine the above 3 points you can see that there might be an explanation - and some avenues for you to investigate.
Best would be to wait for the upcoming 51.0.0 (which fixes the "flaw" and gives more information in logging) on Nuget and stay with 49.0.2 until then. We will keep this open and then re-evaluate the issue you reported.
That work for you?
@FanDjango That works for me. Thanks for being so diligent!
@funkel1989 V51.0.0 has been released to Nuget. At your convenience, you may want to check it out locally. I would appreciate verbose logs that bracket the failure and we can go on from there.
FTP Server OS: unknown
FTP Server Type: no sure, connecting to HostedFtp.com SaaS service
Client Computer OS: Windows
FluentFTP Version: 50.1.0
Framework: .NET 8
After updating to dotnet 8 on azure isolated functions when connecting to our SaaS Ftp server while deployed we are occasionally seeing the below error
Our usage looks like this:
Previous version for FluentFtp was 49.0.2. Does AutoConnect still work in the same way? I feel like AutoConnect used to re-initialize the connection if it was closed but that is where I'm getting the Timeouts.
Logs :