0 votes
by (900 points)

Not able get directory listing from ftp.styx.cabel.net server?
i am getting error :ERROR Ftp(1)[7] Info: Rebex.Net.FtpException: Opening ASCII mode data connection for directory listing (150).

logs:
2015-08-19 17:15:54.169 Opening log file.
2015-08-19 17:15:54.170 Using FileLogWriter version 2.0.5700.0.
2015-08-19 17:15:54.222 INFO Ftp(1)[11] Info: Connecting to ftp.styx.cabel.net:21 using Ftp 4.0.5700.0.
2015-08-19 17:15:54.223 INFO Ftp(1)[11] Info: Using proxy none.
2015-08-19 17:16:15.376 ERROR Ftp(1)[11] Info: Rebex.Net.FtpException: No connection could be made because the target machine actively refused it. ---> Rebex.Net.ProxySocketException: No connection could be made because the target machine actively refused it. ---> Rebex.Net.ProxySocketException: No connection could be made because the target machine actively refused it. ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 93.174.73.18:21
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
   at Rebex.Net.OEB.YC(String A, IPAddress B, Int32 C)
   --- End of inner exception stack trace ---
   at Rebex.Net.OEB.YC(String A, IPAddress B, Int32 C)
   --- End of inner exception stack trace ---
   at Rebex.Net.OEB.XC(IAsyncResult A, String B)
   at Rebex.Net.OEB.SB(IAsyncResult A)
   at Rebex.Net.ProxySocket.EndConnect(IAsyncResult asyncResult)
   at Rebex.Net.ES..ctor(Ftp A, ISocketFactory B, String C, Int32 D)
   at Rebex.Net.Ftp.XM(String A, Int32 B, TlsParameters C, SslMode D, FtpSecureUpgradeType I)
   --- End of inner exception stack trace ---
   at Rebex.Net.Ftp.XM(String A, Int32 B, TlsParameters C, SslMode D, FtpSecureUpgradeType I)
2015-08-19 17:16:17.544 INFO Ftp(1)[13] Info: Connecting to ftp.styx.cabel.net:21 using Ftp 4.0.5700.0.
2015-08-19 17:16:17.544 INFO Ftp(1)[13] Info: Using proxy none.
2015-08-19 17:16:49.215 INFO Ftp(1)[13] Response: 220 gsh.styx.cabel.net FTP server ready.
2015-08-19 17:16:49.235 INFO Ftp(1)[13] Command: USER anonymous
2015-08-19 17:16:49.449 INFO Ftp(1)[13] Response: 331 Guest login ok, send your complete e-mail address as password.
2015-08-19 17:16:49.449 INFO Ftp(1)[13] Command: PASS *********
2015-08-19 17:16:49.885 INFO Ftp(1)[13] Response: 230-The response 'anonymous' is not valid
2015-08-19 17:16:49.885 INFO Ftp(1)[13] Response: 230-Next time please use your e-mail address as your password
2015-08-19 17:16:49.885 INFO Ftp(1)[13] Response: 230-   for example: joe@186-54-87-183.mysipl.com
2015-08-19 17:16:49.885 INFO Ftp(1)[13] Response: 230-         Welcome [unknown]@186-54-87-183.mysipl.com!  
2015-08-19 17:16:49.885 INFO Ftp(1)[13] Response: 230-  This is an private FTP server.  If have any unusual problems, please 
2015-08-19 17:16:49.885 INFO Ftp(1)[13] Response: 230-report them to postmaster@gsh.styx.cabel.net. If you do have problems, please try using
2015-08-19 17:16:49.885 INFO Ftp(1)[13] Response: 230-a dash (-) as the first character of your password -- this will turn off
2015-08-19 17:16:49.885 INFO Ftp(1)[13] Response: 230-the continuation messages that may be confusing your ftp client.
2015-08-19 17:16:49.885 INFO Ftp(1)[13] Response: 230 Guest login ok, access restrictions apply.
2015-08-19 17:16:49.889 INFO Ftp(1)[13] Command: FEAT
2015-08-19 17:16:50.106 INFO Ftp(1)[13] Response: 211-Extensions supported:
2015-08-19 17:16:50.106 INFO Ftp(1)[13] Response:  CSID
2015-08-19 17:16:50.106 INFO Ftp(1)[13] Response:  CLNT
2015-08-19 17:16:50.106 INFO Ftp(1)[13] Response:  EPRT
2015-08-19 17:16:50.106 INFO Ftp(1)[13] Response:  EPSV
2015-08-19 17:16:50.106 INFO Ftp(1)[13] Response:  MDTM
2015-08-19 17:16:50.106 INFO Ftp(1)[13] Response:  MLST Type*;Size*;Modify*;Perm*;Charset*;UNIX.mode*;UNIX.slink*;Unique*;
2015-08-19 17:16:50.106 INFO Ftp(1)[13] Response:  PASV
2015-08-19 17:16:50.106 INFO Ftp(1)[13] Response:  REST STREAM
2015-08-19 17:16:50.106 INFO Ftp(1)[13] Response:  SBUF
2015-08-19 17:16:50.106 INFO Ftp(1)[13] Response:  SITE BUFSIZE
2015-08-19 17:16:50.106 INFO Ftp(1)[13] Response:  SITE BUFSIZEMEASURE
2015-08-19 17:16:50.106 INFO Ftp(1)[13] Response:  SITE CHECKSUM
2015-08-19 17:16:50.107 INFO Ftp(1)[13] Response:  SITE CHECKMETHOD
2015-08-19 17:16:50.107 INFO Ftp(1)[13] Response:  SIZE
2015-08-19 17:16:50.107 INFO Ftp(1)[13] Response:  TVFS
2015-08-19 17:16:50.107 INFO Ftp(1)[13] Response: 211 END
2015-08-19 17:16:50.112 INFO Ftp(1)[13] Command: SYST
2015-08-19 17:16:50.326 INFO Ftp(1)[13] Response: 215 UNIX Type: L8
2015-08-19 17:16:50.329 INFO Ftp(1)[13] Command: OPTS MLST Type;Size;Modify;Perm;UNIX.mode;
2015-08-19 17:16:50.544 INFO Ftp(1)[13] Response: 200 OPTS successful.
2015-08-19 17:16:50.549 INFO Ftp(1)[13] Command: PWD
2015-08-19 17:16:50.764 INFO Ftp(1)[13] Response: 257 "/" is current directory.
2015-08-19 17:16:50.767 INFO Ftp(1)[13] Command: SYST
2015-08-19 17:16:50.981 INFO Ftp(1)[13] Response: 215 UNIX Type: L8
2015-08-19 17:16:53.737 INFO Ftp(1)[13] Command: CWD /
2015-08-19 17:16:53.951 INFO Ftp(1)[13] Response: 250 CWD command successful.
2015-08-19 17:16:53.981 INFO Ftp(1)[13] Command: TYPE A
2015-08-19 17:16:54.195 INFO Ftp(1)[13] Response: 200 Type set to A.
2015-08-19 17:16:54.201 INFO Ftp(1)[13] Command: PASV
2015-08-19 17:16:54.416 INFO Ftp(1)[13] Response: 227 Entering Passive Mode (93,174,73,18,95,205)
2015-08-19 17:16:54.660 INFO Ftp(1)[13] Command: MLSD /
2015-08-19 17:16:54.874 INFO Ftp(1)[13] Response: 226 Listing /
2015-08-19 17:17:04.646 INFO Ftp(1)[7] Command: CWD /pub
2015-08-19 17:17:04.648 INFO Ftp(1)[7] Response: 150 Opening ASCII mode data connection for directory listing.
2015-08-19 17:17:04.679 ERROR Ftp(1)[7] Info: Rebex.Net.FtpException: Opening ASCII mode data connection for directory listing (150).
   at Rebex.Net.Ftp.GM(Int32 A, Boolean B)
   at Rebex.Net.Ftp.GM(Int32 A)
   at Rebex.Net.Ftp.QO(String A, UP B)
Applies to: Rebex FTP/SSL

1 Answer

0 votes
by (58.9k points)
edited by

Update: Rebex FTP/SSL 2016 R1 includes an automated workaround for this issue.

Thank you for the log file. Actually, the server has badly implemented MLSD command as it incorrectly responds to the MLSD command with the bad "226 Listing" response as can be seen in the log file:

2015-08-19 17:16:54.660 INFO Ftp(1)[13] Command: MLSD /
2015-08-19 17:16:54.874 INFO Ftp(1)[13] Response: 226 Listing /

As a workaround please disable the MLSD extension with the code below and let me know whether it helped:

Ftp ftp = new Ftp();
ftp.EnabledExtensions &= ~FtpExtensions.MachineProcessingList;
by (58.9k points)
A workaround that automatically disables the MLSD extension will be released with the next version of Rebex components.
...