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

Incomplete uploads with TLS 1.3 #509

Closed
markushaslinger opened this issue Jan 13, 2020 · 7 comments
Closed

Incomplete uploads with TLS 1.3 #509

markushaslinger opened this issue Jan 13, 2020 · 7 comments

Comments

@markushaslinger
Copy link

FTP OS: Ubuntu 18

FTP Server: ProFTPD

Computer OS: Debian 10

Using SslProtocols.Tls13 uploads are incomplete and the error 450 Transfer aborted. Link to file server lost is logged. However, no Exception is thrown and FtpVerify.Retry does not detect the incomplete upload (reporting success instead). Using SslProtocols.Tls12 the uploads work without any issues.
Server operator has been contacted and insists the problem lies not with their system.

Not sure if #236 and #347 are related.

Logs :

[Verbose] >         ConnectAsync()
[Info] Status:   Connecting to xx.xx.xx.xx:21
[Info] Response: 220 FTP on ftp.example.com ready
[Info] Command:  AUTH TLS
[Info] Response: 234 AUTH TLS successful
[Info] Status:   FTPS Authentication Successful
[Verbose] Status:   Time to activate encryption: 0h 0m 0s.  Total Seconds: 0.1914561.
[Info] Command:  USER xxxxxxx
[Info] Response: 331 Password required for xxxxxxx
[Info] Command:  PASS ***
[Info] Response: 230 User xxxxxxx logged in
[Info] Command:  PBSZ 0
[Info] Response: 200 PBSZ 0 successful
[Info] Command:  PROT P
[Info] Response: 200 Protection set to Private
[Info] Command:  FEAT
[Verbose] Response: 211-Features:
Response: MDTM
Response: SSCN
Response: TVFS
Response: MFMT
Response: SIZE
Response: PROT
Response: LANG bg-BG;zh-CN;en-US;ru-RU;fr-FR;ko-KR;ja-JP;es-ES;it-IT;zh-TW
Response: CCC
Response: PBSZ
Response: AUTH TLS
Response: MFF modify;UNIX.group;UNIX.mode;
Response: REST STREAM
Response: MLST modify*;perm*;size*;type*;unique*;UNIX.group*;UNIX.mode*;UNIX.owner*;
Response: UTF8
Response: EPRT
Response: EPSV
[Info] Response: 211 End
[Info] Status:   Text encoding: System.Text.UTF8Encoding+UTF8EncodingSealed
[Info] Command:  OPTS UTF8 ON
[Info] Response: 200 UTF8 set to on
[Info] Command:  SYST
[Info] Response: 215 UNIX Type: L8
[Verbose] >         UploadFileAsync("/home/markus/ftptest/test.zip", "test.zip", Overwrite, False, Retry)
[Verbose] >         FileExistsAsync("test.zip")
[Verbose] >         GetWorkingDirectoryAsync()
[Info] Command:  PWD
[Info] Response: 257 "/" is the current directory
[Info] Command:  SIZE /test.zip
[Info] Response: 550 SIZE not allowed in ASCII mode
[Info] Command:  TYPE I
[Info] Response: 200 Type set to I
[Info] Command:  SIZE /test.zip
[Info] Response: 550 /test.zip: Datei oder Verzeichnis nicht gefunden
[Verbose] >         OpenWriteAsync("test.zip", Binary)
[Verbose] >         OpenPassiveDataStreamAsync(AutoPassive, "STOR test.zip", 0)
[Info] Command:  EPSV
[Info] Response: 229 Entering Extended Passive Mode (|||50054|)
[Info] Status:   Connecting to xx.xx.xx.xx:50054
[Info] Command:  STOR test.zip
[Info] Response: 150 Opening BINARY mode data connection for test.zip
[Info] Status:   FTPS Authentication Successful
[Verbose] Status:   Time to activate encryption: 0h 0m 0s.  Total Seconds: 0.0705701.
[Verbose] Status:   Disposing FtpSocketStream...
[Info] Response: 450 Transfer aborted. Link to file server lost
[Info] Status:   File Verification: PASS
[Info] Command:  QUIT
[Info] Response: 221 Goodbye.
[Verbose] Status:   Disposing FtpSocketStream...
@robinrodricks
Copy link
Owner

We will need to stop suppressing exceptions in UploadFileAsync

@robinrodricks
Copy link
Owner

Can you try the latest release 32.0.0, it should throw an error correctly with 4xx error codes.

https://www.nuget.org/packages/FluentFTP/32.0.0

@markushaslinger
Copy link
Author

Can confirm that with v32.2.0 the FtpStatus of the incomplete upload is now correctly reported as Failed, thanks!
Are there some logs I could provide which would help you to find the root cause and allow uploads via TLS 1.3?

@robinrodricks
Copy link
Owner

Great. Not sure as its a complicated run time error.

@robinrodricks
Copy link
Owner

Possible reasons:

  1. The FTP server you're connected to has a problem. It loses its internal link to one of the storage servers (where the actual files are stored). You need to contact server support so they can fix that.
  2. Internal server problems. The FTP server lost the link to its internal storage (large servers have separate storage back-ends). This was a temporary problem.
  3. You mean that? This indicates an FTP server problem. The server loses the connection to its storage backend mid-transfer.

@robinrodricks
Copy link
Owner

robinrodricks commented Mar 25, 2020

Some people report success when not using Passive mode, or when not using SSL/TLS. I'm sorry since this is a server error I can't fix it.

@markushaslinger
Copy link
Author

Some people report success when not using Passive mode, or when not using SSL/TLS. I'm sorry since this is a server error I can't fix it.

Thanks, will try without passive.
I also assumed it's a server issue (after all that's what the error sent by the server says) but the operator is telling me 'no way this is our fault' and I don't have leverage on them, so I'll probably just stay on TLS 1.2 for the time being. Thanks for your effort anyway!

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

No branches or pull requests

2 participants