FluentFTP: FtpCommandException: Code: 550 Message: Can't check for file existence
FTP Server OS: Windows
FTP Server Type: not sure, how can i check this?
Client Computer OS: Windows
FluentFTP Version: 51.1.0
Framework: .NET 8
Trying to upload files to FTP server. Here is the flow it should follow:
- Create directory
- Upload artwork
- Upload song
- Upload atmos song
- Upload metadata file
- Upload empty confirmation file
Here are the results:
- It manages to create the directory
- upload the png
- seems to not be able to upload the song?
- uploads the atmos song
- crashes when uploading the metadata file:
Failed to upload file to 8721093032076/8721093032076.xml: Error while uploading the file to the server. See InnerException for more info. —> FluentFTP.Exceptions.FtpCommandException: Code: 550 Message: Can’t check for file existence
I also want to add that this started to happen today, this flow have been working before.
Logs :
# DirectoryExists("8721093032076")
Command: CWD 8721093032076
Status: Waiting for response to: CWD 8721093032076
Response: 550 Can't change directory to 8721093032076: No such file or directory [30ms]
# CreateDirectory("8721093032076", True)
# DirectoryExists(".")
Status: CreateDirectory 8721093032076
Command: MKD 8721093032076
Status: Waiting for response to: MKD 8721093032076
Response: 257 "8721093032076" : The directory was successfully created [29ms]
# UploadStream("8721093032076/8721093032076.png", Overwrite, False)
# FileExists("8721093032076/8721093032076.png")
Command: SIZE /8721093032076/8721093032076.png
Status: Waiting for response to: SIZE /8721093032076/8721093032076.png
Response: 550 Can't check for file existence [31ms]
# OpenWrite("8721093032076/8721093032076.png", Binary, -1, False)
# OpenDataStream("STOR 8721093032076/8721093032076.png", 0)
# OpenPassiveDataStream(PASV, "STOR 8721093032076/8721093032076.png", 0)
Command: PASV
Status: Waiting for response to: PASV
Response: 227 Entering Passive Mode (178,237,44,159,132,132) [32ms]
Status: Connecting(sync) FtpClient.FtpSocketStream(data) IP #1 = ***:33924
Command: STOR 8721093032076/8721093032076.png
Status: Waiting for response to: STOR 8721093032076/8721093032076.png
Response: 150 Accepted data connection [31ms]
Status: FTPS authentication successful, lib = .NET SslStream, cipher suite = Tls12 (Aes256, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, 44550, 256) [29ms]
Status: Uploaded 17388936 bytes, 872ms, 19 MB/s
Status: Disposing(sync) FtpClient.FtpSocketStream(data)
Status: Waiting for response to: STOR 8721093032076/8721093032076.png
Status: Disposing(sync) FtpClient.FtpSocketStream(data) (redundant)
Status: Error encountered uploading file
Status: IOException for file : Unable to read data from the transport connection: The connection attempt failed because the connected computer did not respond within a certain time or because the established connection to the host computer no longer works.
# UploadStream("8721093032076/8721093032076.wav", Overwrite, False)
# FileExists("8721093032076/8721093032076.wav")
Command: SIZE /8721093032076/8721093032076.wav
Status: Waiting for response to: SIZE /8721093032076/8721093032076.wav
Status: Error encountered uploading file
Status: IOException for file : Unable to read data from the transport connection: The connection attempt failed because the connected computer did not respond within a certain time or because the established connection to the host computer no longer works.
# UploadFile("C:\Users\mypc\AppData\Local\Temp\8721093032076_atmos.wav", "8721093032076/8721093032076_atmos.wav", Overwrite, False, None)
# FileExists("8721093032076/8721093032076_atmos.wav")
Status: Control connection has stale data(218) - prior to Execute("SIZE...")
Status: The stale data was (length = 131):
Stale: 226-File successfully transferred
Stale: 226 1.055 seconds (measured here), 15.73 Mbytes per second
Stale: 550 Can't check for file existence
Warning: Reconnect needed due to stale data present on control connection (SslSessionLength: 27)
Status: Disposing(sync) FtpClient.FtpSocketStream(control) (redundant)
Status: Command stashed: SIZE /8721093032076/8721093032076_atmos.wav
# Connect(True)
Warning: Reconnect (Count: 2)
Status: FluentFTP 51.1.0.0(.NET 6.0) FtpClient
Status: Connecting(sync) FtpClient.FtpSocketStream(control) IP #1 = ***:21
Status: Waiting for a response
Response: 220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
Response: 220-You are user number 32 of 100 allowed.
Response: 220-Local time is now 17:42. Server port: 21.
Response: 220-This is a private system - No anonymous login
Response: 220 You will be disconnected after 15 minutes of inactivity. [54,172s]
Status: Detected FTP server: PureFTPd
Command: AUTH TLS
Status: Waiting for response to: AUTH TLS
Response: 234 AUTH TLS OK. [31ms]
Status: FTPS authentication successful, lib = .NET SslStream, cipher suite = Tls12 (Aes256, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, 44550, 256) [41ms]
Command: USER ***
Status: Waiting for response to: USER ***
Response: 331 User *** OK. Password required [57ms]
Command: PASS ***
Status: Waiting for response to: PASS ***
Response: 230 OK. Current restricted directory is / [220ms]
Command: PBSZ 0
Status: Waiting for response to: PBSZ 0
Response: 200 PBSZ=0 [29ms]
Command: PROT P
Status: Waiting for response to: PROT P
Response: 200 Data protection level set to "private" [27ms]
Status: Text encoding: System.Text.UTF8Encoding+UTF8EncodingSealed
Command: OPTS UTF8 ON
Status: Waiting for response to: OPTS UTF8 ON
Response: 200 OK, UTF-8 enabled [30ms]
Command: SYST
Status: Waiting for response to: SYST
Response: 215 UNIX Type: L8 [28ms]
Status: Active ServerHandler is: PureFTPd
Status: Listing parser set to: Machine
Command: TYPE I
Status: Waiting for response to: TYPE I
Response: 200 TYPE is now 8-bit binary [39ms]
# SetWorkingDirectory("/")
Command: CWD /
Status: Waiting for response to: CWD /
Response: 250 OK. Current directory is / [30ms]
Status: Executing stashed command
Command: SIZE /8721093032076/8721093032076_atmos.wav
Status: Waiting for response to: SIZE /8721093032076/8721093032076_atmos.wav
Response: 550 Can't check for file existence [29ms]
# OpenWrite("8721093032076/8721093032076_atmos.wav", Binary, -1, False)
# OpenDataStream("STOR 8721093032076/8721093032076_atmos.wav", 0)
# OpenPassiveDataStream(PASV, "STOR 8721093032076/8721093032076_atmos.wav", 0)
Command: PASV
Status: Waiting for response to: PASV
Response: 227 Entering Passive Mode (178,237,44,159,119,113) [30ms]
Status: Connecting(sync) FtpClient.FtpSocketStream(data) IP #1 = ***:30577
Command: STOR 8721093032076/8721093032076_atmos.wav
Status: Waiting for response to: STOR 8721093032076/8721093032076_atmos.wav
Response: 150 Accepted data connection [29ms]
Status: FTPS authentication successful, lib = .NET SslStream, cipher suite = Tls12 (Aes256, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, 44550, 256) [33ms]
Status: Uploaded 948437966 bytes, 57,71s, 15,7 MB/s
Status: Disposing(sync) FtpClient.FtpSocketStream(data)
Status: Waiting for response to: STOR 8721093032076/8721093032076_atmos.wav
Status: Disposing(sync) FtpClient.FtpSocketStream(data) (redundant)
Status: Error encountered uploading file
Status: IOException for file C:\Users\mypc\AppData\Local\Temp\8721093032076_atmos.wav : Unable to read data from the transport connection: The connection attempt failed because the connected computer did not respond within a certain time or because the established connection to the host computer no longer works.
Status: Failed to upload file.
# UploadStream("8721093032076/8721093032076.xml", Overwrite, False)
# FileExists("8721093032076/8721093032076.xml")
Command: SIZE /8721093032076/8721093032076.xml
Status: Waiting for response to: SIZE /8721093032076/8721093032076.xml
Response: 226-File successfully transferred
Response: 226 57.909 seconds (measured here), 15.62 Mbytes per second [11,306s]
# DeleteFile("8721093032076/8721093032076.xml")
Command: DELE 8721093032076/8721093032076.xml
Status: Waiting for response to: DELE 8721093032076/8721093032076.xml
Response: 550 Can't check for file existence [<1ms]
Status: Error encountered uploading file
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 24
Also note that in your logs of last night, the responses were actually not ~12 seconds, they were more like 50 seconds or so.
Ok. It’s looking good now, isn’t it?
Here is a thing you should do: Never issue the next API call (i.e. the second download) before you have checked the success of the previous one. In the logs, one saw that all the subsequent API calls also failed because the server was still hanging in the response to the first download. All the subsequent responses were queued behind that.
Yes, extremely so.
Remember, I wrote
Perhaps the png is being stored “somewhere” else? Or it is being copied from a staging area to the final resting place.
Note that the server might be buffering the incoming bytes so the actual TCP send (from the viewpoint of the client) is over rather quickly, while after sending all the bytes (“uploaded nnnnn bytes”) you still need to wait for the server to “226 upload successful” confirm that the upload was completed.
Appreciate the help. Regarding older logs => i don’t write FluentFTP logs to file, i only log my own to database.
However, i will also try tomorrow morning to see if i get better results then. Let keep in touch here then?
Thanks again!
Ok, some servers reply to a NOOP command with this, when there is no transfer running. Duh. Never saw it before.
Also, JUST for testing, consider adding
to switch response waiting and analysis and logging to a different mode. It wont make it work any better, but maybe I can see more.
Yes i can definitely try that, getting back soon…
The AutoConnect should happen after the log setup.