FluentFTP
FluentFTP copied to clipboard
Timeout exception in GetObjectInfo when path contains "[" or "]"
FTP OS: Unix
FTP Server: Synology FTP Server
Computer OS: Windows 10
I'm getting timeout exceptions when trying to GetObjectInfo of files containing "[" or "]" characters in path. When I'm trying to list directories named this way - GetListing returns empty array. Filezilla works fine with that.
Logs :
FluentFTP - GetObjectInfo
# Connect()
Status: Connecting to 192.168.8.103:21
Response: 220 192.168.8.103 FTP server ready.
Command: USER admin
Response: 331 Password required for admin.
Command: PASS ***
Response: 230 User admin logged in.
Command: FEAT
Response: 211 End.
Response: 211- Extensions supported:
Response: AUTH TLS
Response: PBSZ
Response: PROT
Response: SIZE
Response: MDTM
Response: MFMT
Response: REST STREAM
Response: UTF8
Response: MLST type*;modify*;size*;UNIX.mode*;UNIX.owner*;UNIX.group*;
Response: MLSD
Status: Text encoding: System.Text.UTF8Encoding
Command: OPTS UTF8 ON
Response: 200 OK, UTF-8 enabled
Command: SYST
Response: 215 UNIX Type: L8
Status: Auto-detected UNIX listing parser
# GetObjectInfo("/video/[src] sr/[src] sth.of.-LLO.mkv", True)
Command: MLST /video/[src] sr/[src] sth.of.-LLO.mkv
The thread 0x28b8 has exited with code 0 (0x0).
Status: Disposing FtpSocketStream...
Exception thrown: 'System.TimeoutException' in mscorlib.dll
# Dispose()
Status: Disposing FtpClient object...
Status: Disposing FtpSocketStream...
Exception thrown: 'System.TimeoutException' in mscorlib.dll
Exception thrown: 'System.TimeoutException' in mscorlib.dll
An exception of type 'System.TimeoutException' occurred in mscorlib.dll but was not handled in user code
Timed out trying to read data from the socket stream!
FluentFTP - GetListing
# Connect()
Status: Connecting to 192.168.8.103:21
Response: 220 192.168.8.103 FTP server ready.
Command: USER admin
Response: 331 Password required for admin.
Command: PASS ***
Response: 230 User admin logged in.
Command: FEAT
Response: 211 End.
Response: 211- Extensions supported:
Response: AUTH TLS
Response: PBSZ
Response: PROT
Response: SIZE
Response: MDTM
Response: MFMT
Response: REST STREAM
Response: UTF8
Response: MLST type*;modify*;size*;UNIX.mode*;UNIX.owner*;UNIX.group*;
Response: MLSD
Status: Text encoding: System.Text.UTF8Encoding
Command: OPTS UTF8 ON
Response: 200 OK, UTF-8 enabled
Command: SYST
Response: 215 UNIX Type: L8
Status: Auto-detected UNIX listing parser
# GetListingAsync("/video/[src] sr", Auto)
Command: TYPE I
Response: 200 Type set to I.
# OpenPassiveDataStreamAsync(AutoPassive, "MLSD /video/[src] sr", 0)
Command: EPSV
Response: 229 Entering Extended Passive Mode (|||55541|)
Status: Connecting to 192.168.8.103:55541
Command: MLSD /video/[src] sr
Response: 150 Opening BINARY mode data connection for 'file list'.
+---------------------------------------+
-----------------------------------------
Status: Disposing FtpSocketStream...
# CloseDataStream()
Response: 226 Transfer complete.
Status: Disposing FtpSocketStream...
Command: QUIT
Response: 221 Goodbye. You uploaded 0 bytes and downloaded 0 bytes.
Status: Disposing FtpSocketStream...
FileZilla
2018-01-18 02:34:19 24808 1 Status: Connecting to 192.168.8.103:21...
2018-01-18 02:34:19 24808 1 Status: Connection established, waiting for welcome message...
2018-01-18 02:34:19 24808 1 Response: 220 192.168.8.103 FTP server ready.
2018-01-18 02:34:19 24808 1 Command: AUTH TLS
2018-01-18 02:34:19 24808 1 Response: 234 AUTH SSL command successful.
2018-01-18 02:34:19 24808 1 Status: Initializing TLS...
2018-01-18 02:34:19 24808 1 Status: Verifying certificate...
2018-01-18 02:34:19 24808 1 Status: TLS connection established.
2018-01-18 02:34:19 24808 1 Command: USER admin
2018-01-18 02:34:19 24808 1 Response: 331 Password required for admin.
2018-01-18 02:34:19 24808 1 Command: PASS ************
2018-01-18 02:34:20 24808 1 Response: 230 User admin logged in.
2018-01-18 02:34:20 24808 1 Command: SYST
2018-01-18 02:34:20 24808 1 Response: 215 UNIX Type: L8
2018-01-18 02:34:20 24808 1 Command: FEAT
2018-01-18 02:34:20 24808 1 Response: 211- Extensions supported:
2018-01-18 02:34:20 24808 1 Response: AUTH TLS
2018-01-18 02:34:20 24808 1 Response: PBSZ
2018-01-18 02:34:20 24808 1 Response: PROT
2018-01-18 02:34:20 24808 1 Response: SIZE
2018-01-18 02:34:20 24808 1 Response: MDTM
2018-01-18 02:34:20 24808 1 Response: MFMT
2018-01-18 02:34:20 24808 1 Response: REST STREAM
2018-01-18 02:34:20 24808 1 Response: UTF8
2018-01-18 02:34:20 24808 1 Response: MLST type*;modify*;size*;UNIX.mode*;UNIX.owner*;UNIX.group*;
2018-01-18 02:34:20 24808 1 Response: MLSD
2018-01-18 02:34:20 24808 1 Response: 211 End.
2018-01-18 02:34:20 24808 1 Command: OPTS UTF8 ON
2018-01-18 02:34:20 24808 1 Response: 200 OK, UTF-8 enabled
2018-01-18 02:34:20 24808 1 Command: PBSZ 0
2018-01-18 02:34:20 24808 1 Response: 200 PBSZ command successful (PBSZ=0).
2018-01-18 02:34:20 24808 1 Command: PROT P
2018-01-18 02:34:20 24808 1 Response: 200 Protection level set to Private.
2018-01-18 02:34:20 24808 1 Status: Logged in
2018-01-18 02:34:20 24808 1 Status: Retrieving directory listing...
2018-01-18 02:34:20 24808 1 Command: PWD
2018-01-18 02:34:20 24808 1 Response: 257 "/" is current directory.
2018-01-18 02:34:20 24808 1 Command: TYPE I
2018-01-18 02:34:20 24808 1 Response: 200 Type set to I.
2018-01-18 02:34:20 24808 1 Command: PASV
2018-01-18 02:34:20 24808 1 Response: 227 Entering Passive Mode (192,168,8,103,216,241)
2018-01-18 02:34:20 24808 1 Command: MLSD
2018-01-18 02:34:20 24808 1 Response: 150 Opening BINARY mode SSL data connection for 'file list'.
2018-01-18 02:34:20 24808 1 Response: 226 Transfer complete.
2018-01-18 02:34:20 24808 1 Status: Directory listing of "/" successful
2018-01-18 02:34:25 24808 1 Status: Retrieving directory listing of "/video"...
2018-01-18 02:34:25 24808 1 Command: CWD video
2018-01-18 02:34:25 24808 1 Response: 250 CWD command successful.
2018-01-18 02:34:25 24808 1 Command: PWD
2018-01-18 02:34:25 24808 1 Response: 257 "/video" is current directory.
2018-01-18 02:34:25 24808 1 Command: PASV
2018-01-18 02:34:25 24808 1 Response: 227 Entering Passive Mode (192,168,8,103,216,246)
2018-01-18 02:34:25 24808 1 Command: MLSD
2018-01-18 02:34:25 24808 1 Response: 150 Opening BINARY mode SSL data connection for 'file list'.
2018-01-18 02:34:25 24808 1 Response: 226 Transfer complete.
2018-01-18 02:34:25 24808 1 Status: Directory listing of "/video" successful
2018-01-18 02:34:27 24808 1 Status: Retrieving directory listing of "/video/[src] sr"...
2018-01-18 02:34:27 24808 1 Command: CWD [src] sr
2018-01-18 02:34:27 24808 1 Response: 250 CWD command successful.
2018-01-18 02:34:27 24808 1 Command: PWD
2018-01-18 02:34:27 24808 1 Response: 257 "/video/[src] sr" is current directory.
2018-01-18 02:34:27 24808 1 Command: PASV
2018-01-18 02:34:27 24808 1 Response: 227 Entering Passive Mode (192,168,8,103,216,244)
2018-01-18 02:34:27 24808 1 Command: MLSD
2018-01-18 02:34:27 24808 1 Response: 150 Opening BINARY mode SSL data connection for 'file list'.
2018-01-18 02:34:27 24808 1 Response: 226 Transfer complete.
2018-01-18 02:34:27 24808 1 Status: Directory listing of "/video/[src] sr" successful
I can confirm this also happens on PureFTPD server. If I do, for example:
var listing = await client.GetListingAsync()
listing contains all but paths/files containing '[' or ']'
See #101 Should work in current versions of FluentFTP. See also Wiki path problems