Open lukechenw opened 2 weeks ago
Change both logs to include log messages with "VERBOSE" severity, please.
Logs for 48.0.0:
# Connect(False)
Status: FluentFTP 48.0.0.0(.NET Framework 4.6.2)
Status: Connecting to IP #1= ***:21
Status: Waiting for a response
Response: 220 Service ready for new user. [739183.082d]
Command: USER ***
Status: Waiting for response to: USER ***
Response: 331 User name okay, need password for ***. [11ms]
Command: PASS ***
Status: Waiting for response to: PASS ***
Response: 230 User logged in, proceed. [5ms]
Command: FEAT
Status: Waiting for response to: FEAT
Response: 211-Extensions supported
Response: SIZE
Response: MDTM
Response: REST STREAM
Response: LANG en;zh-tw;ja;is
Response: MLST Size;Modify;Type;Perm
Response: AUTH SSL
Response: AUTH TLS
Response: MODE Z
Response: UTF8
Response: TVFS
Response: MD5
Response: MMD5
Response: MFMT
Response: 211 End [35ms]
Status: Text encoding: System.Text.UTF8Encoding
Command: OPTS UTF8 ON
Status: Waiting for response to: OPTS UTF8 ON
Response: 200 Command OPTS okay. [5ms]
Command: SYST
Status: Waiting for response to: SYST
Response: 215 UNIX Type: Apache FtpServer [7ms]
Status: Detected FTP server: Apache
Status: Listing parser set to: Machine
Command: PWD
Status: Waiting for response to: PWD
Response: 257 "/" is current directory. [7ms]
# DownloadFile("IMGDown\aaa.img.gz", "PRD80000000000000002587611", Overwrite, Retry)
# GetFileSize("PRD80000000000000002587611", -1)
Command: SIZE PRD80000000000000002587611
Status: Waiting for response to: SIZE PRD80000000000000002587611
Response: 213 184 [2ms]
# OpenRead("PRD80000000000000002587611", Binary, 0, 184)
Command: TYPE I
Status: Waiting for response to: TYPE I
Response: 200 Command TYPE okay. [5ms]
# OpenDataStreamAsync("RETR PRD80000000000000002587611", 0)
# OpenPassiveDataStreamAsync(AutoPassive, "RETR PRD80000000000000002587611", 0)
Command: EPSV
Status: Waiting for response to: EPSV
Response: 229 Entering Passive Mode (|||11404|) [8ms]
Status: Connecting to IP #1= ***:11404
Command: RETR PRD80000000000000002587611
Status: Waiting for response to: RETR PRD80000000000000002587611
Response: 150 File status okay; about to open data connection. [12ms]
“demo.exe”(CLR v4.0.30319: demo.exe): 已加载“Anonymously Hosted DynamicMethods Assembly”。
Status: Closing/Disposing FtpSocketStream(data connection)
Status: Closing/Disposing FtpSocketStream(data connection)
Status: Download cancellation requested
引发的异常:“System.Threading.Tasks.TaskCanceledException”(位于 mscorlib.dll 中)
# Dispose()
Status: Disposing FtpClient object...
Status: Closing/Disposing FtpSocketStream(control connection)
Logs for 51.1.0 :
# Connect(False)
Status: FluentFTP 51.1.0.0(.NET Framework 4.6.2) AsyncFtpClient
Status: Connecting(async) AsyncFtpClient.FtpSocketStream(control) IP #1 = ***:21
Status: Waiting for a response
Response: 220 Service ready for new user. [739183.083d]
Command: USER ***
Status: Waiting for response to: USER ***
Response: 331 User name okay, need password for ***. [11ms]
Command: PASS ***
Status: Waiting for response to: PASS ***
Response: 230 User logged in, proceed. [4ms]
Command: FEAT
Status: Waiting for response to: FEAT
Response: 211-Extensions supported
Response: SIZE
Response: MDTM
Response: REST STREAM
Response: LANG en;zh-tw;ja;is
Response: MLST Size;Modify;Type;Perm
Response: AUTH SSL
Response: AUTH TLS
Response: MODE Z
Response: UTF8
Response: TVFS
Response: MD5
Response: MMD5
Response: MFMT
Response: 211 End [32ms]
Status: Text encoding: System.Text.UTF8Encoding
Command: OPTS UTF8 ON
Status: Waiting for response to: OPTS UTF8 ON
Response: 200 Command OPTS okay. [4ms]
Command: SYST
Status: Waiting for response to: SYST
Response: 215 UNIX Type: Apache FtpServer [6ms]
Status: Detected FTP server: Apache
Status: Active ServerHandler is: Apache
Status: Listing parser set to: Machine
Command: PWD
Status: Waiting for response to: PWD
Response: 257 "/" is current directory. [5ms]
# DownloadFile("IMGDown\aaa.img.gz", "PRD80000000000000002587611", Overwrite, Retry)
# GetFileSize("PRD80000000000000002587611", -1)
Command: SIZE PRD80000000000000002587611
Status: Waiting for response to: SIZE PRD80000000000000002587611
Response: 213 184 [2ms]
# OpenRead("PRD80000000000000002587611", Binary, 0, 184, False)
Command: TYPE I
Status: Waiting for response to: TYPE I
Response: 200 Command TYPE okay. [4ms]
# OpenDataStreamAsync("RETR PRD80000000000000002587611", 0)
# OpenPassiveDataStreamAsync(AutoPassive, "RETR PRD80000000000000002587611", 0)
Command: EPSV
Status: Waiting for response to: EPSV
Response: 229 Entering Passive Mode (|||46341|) [7ms]
Status: Connecting(async) AsyncFtpClient.FtpSocketStream(data) IP #1 = ***:46341
Command: RETR PRD80000000000000002587611
Status: Waiting for response to: RETR PRD80000000000000002587611
Response: 150 File status okay; about to open data connection. [9ms]
“demo.exe”(CLR v4.0.30319: demo.exe): 已加载“Anonymously Hosted DynamicMethods Assembly”。
Status: Downloaded 184 bytes, 30ms, 5.9 KB/s
Status: Disposing(async) AsyncFtpClient.FtpSocketStream(data)
Status: Waiting for response to: RETR PRD80000000000000002587611
Response: 426 Data connection error. [77ms]
Status: Failed to download file.
Status: Retrying to download file.
# GetFileSize("PRD80000000000000002587611", -1)
Command: SIZE PRD80000000000000002587611
Status: Waiting for response to: SIZE PRD80000000000000002587611
Response: 213 184 [2ms]
# OpenRead("PRD80000000000000002587611", Binary, 0, 184, False)
# OpenDataStreamAsync("RETR PRD80000000000000002587611", 0)
# OpenPassiveDataStreamAsync(AutoPassive, "RETR PRD80000000000000002587611", 0)
Command: EPSV
Status: Waiting for response to: EPSV
Response: 229 Entering Passive Mode (|||26841|) [7ms]
Status: Connecting(async) AsyncFtpClient.FtpSocketStream(data) IP #1 = ***:26841
Command: RETR PRD80000000000000002587611
Status: Waiting for response to: RETR PRD80000000000000002587611
Response: 150 File status okay; about to open data connection. [8ms]
Status: Downloaded 184 bytes, 33ms, 4.9 KB/s
Status: Disposing(async) AsyncFtpClient.FtpSocketStream(data)
Status: Waiting for response to: RETR PRD80000000000000002587611
Response: 426 Data connection error. [54ms]
Status: Failed to download file.
Status: Retrying to download file.
# GetFileSize("PRD80000000000000002587611", -1)
Command: SIZE PRD80000000000000002587611
Status: Waiting for response to: SIZE PRD80000000000000002587611
Response: 213 184 [1ms]
# OpenRead("PRD80000000000000002587611", Binary, 0, 184, False)
# OpenDataStreamAsync("RETR PRD80000000000000002587611", 0)
# OpenPassiveDataStreamAsync(AutoPassive, "RETR PRD80000000000000002587611", 0)
Command: EPSV
Status: Waiting for response to: EPSV
Response: 229 Entering Passive Mode (|||16553|) [8ms]
Status: Connecting(async) AsyncFtpClient.FtpSocketStream(data) IP #1 = ***:16553
Command: RETR PRD80000000000000002587611
Status: Waiting for response to: RETR PRD80000000000000002587611
Response: 150 File status okay; about to open data connection. [10ms]
Status: Downloaded 184 bytes, 33ms, 4.9 KB/s
Status: Disposing(async) AsyncFtpClient.FtpSocketStream(data)
Status: Waiting for response to: RETR PRD80000000000000002587611
Response: 426 Data connection error. [58ms]
Status: Failed to download file.
# Dispose()
# DisposeAsync()
Status: Disposing(async) AsyncFtpClient
# Disconnect()
Command: QUIT
Status: Waiting for response to: QUIT
Response: 221 Goodbye. [2ms]
Status: Disposing(async) AsyncFtpClient.FtpSocketStream(control)
Status: Disposing(async) AsyncFtpClient.FtpSocketStream(control) (redundant)
Thank you for posting a verbose log (which we always request), but why on earth did you then remove the time stamps? So I needed to go back and forth between the first log and the verbose one, what a drag, man.
Response: 150 File status okay; about to open data connection. [12ms]
“demo.exe”(CLR v4.0.30319: demo.exe): 已加载“Anonymously Hosted DynamicMethods Assembly”。
Status: Closing/Disposing FtpSocketStream(data connection)
Status: Closing/Disposing FtpSocketStream(data connection)
Status: Download cancellation requested
引发的异常:“System.Threading.Tasks.TaskCanceledException”(位于 mscorlib.dll 中)
# Dispose()
Status: Disposing FtpClient object...
Status: Closing/Disposing FtpSocketStream(control connection)
In this one, who is doing a cancel???
I don`t see that "it works". The file might have been downloaded ok, but the result is not right. The new version is somewhat better in that it tells you the "426 Data connection error". The file once again probably is present (downloaded) but now at least the response from the server is being looked at.
426 Data connection error
It is considered a transient negative reply as it is considered to be a temporary condition.
It is usually sent when the data connection is unexpectedly closed before the completion
of a data transfer.
In this case, the client is encouraged to restart the FTP transaction and try again.
# GetFileSize("PRD80000000000000002587611", -1)
Command: SIZE PRD80000000000000002587611
Status: Waiting for response to: SIZE PRD80000000000000002587611
Response: 213 184 [2ms]
The size is 184.
Status: Downloaded 184 bytes, 33ms, 4.9 KB/s
Status: Disposing(async) AsyncFtpClient.FtpSocketStream(data)
We downloaded 184 and closed the connection. So phoooey.
Response: 426 Data connection error. [58ms]
Looks like the server prefers to close the connection himself and calls that a failure.
The only reason that "worked" previously is because in the old version, for some reasons, such a negative response was not reported and not acted upon. Unclean and now fixed. Sadly that means this download is thus classified as failed.
We would rather need to concentrate what the Apache file server would prefer: Should we wait for him to close the connection when the download is finished? Ignore any error messages?
I realize that it worked before. But your log doesn't really show that. It shows cancellations, exceptions etc. I see no download success message. Of course the file might be present on the disk, but how safe is the assumption that all is ok. This apache server problem had been hiding behind the old versions code until it surfaced now.
I cancelled the download because the file was too large(>100G)
Response: 150 File status okay; about to open data connection. [12ms]
“demo.exe”(CLR v4.0.30319: demo.exe): 已加载“Anonymously Hosted DynamicMethods Assembly”。
Status: Closing/Disposing FtpSocketStream(data connection)
Status: Closing/Disposing FtpSocketStream(data connection)
Status: Download cancellation requested
引发的异常:“System.Threading.Tasks.TaskCanceledException”(位于 mscorlib.dll 中)
# Dispose()
Status: Disposing FtpClient object...
Status: Closing/Disposing FtpSocketStream(control connection)
On the FTP server, PRD80000000000000002587611 is a connection file ( size is 184byte ), The actual files are stored on another FTP server, and the file size >100G.
# GetFileSize("PRD80000000000000002587611", -1)
Command: SIZE PRD80000000000000002587611
Status: Waiting for response to: SIZE PRD80000000000000002587611
Response: 213 184 [2ms]
So the result of the SIZE command is a lie!
This FluentFTP version handles these things correctly. So it stops after 184 bytes. I explained that previously.
One way to handle this quickly is to provide a custom server handler and to provide
ServerHandler.AlwaysReadToEnd(...)
Perhaps, we should introduce a new download FileExists option to allow saying "AlwaysReadToEnd".
FTP Server OS: Unix
FTP Server Type: Apache FtpServer
Client Computer OS: Windows
FluentFTP Version: 51.1.0
Framework: .NET 4
download file fail using the DownloadFile method. Same code works with version 49.0.1 Found after upgrading FluentFTP from 48.0.0 to 51.1.0
Logs : Logs for 48.0.0:
Logs for 51.1.0 :