Are you getting an error like “FTP cannot retrieve directory listing” when you try to access FTP server remotely?
This error is caused due to the bad settings in the FTP server, misconfiguration of FTP client, when passive mode setting disables and much more.
That’s why we often get requests from our customers to solve the error like “FTP cannot retrieve directory listing” as part of our Server Management Services.
Today, we’ll see how our Support Engineers fixed the issue for our customers.
What is “FTP cannot retrieve directory listing” error?
This error “FTP cannot retrieve directory listing” means that the user could not access the files from FTP server.
Users encounter an error message like this.
Error: Failed to retrieve directory listing
Now, let’s see the reasons for the error and the real solution to fix it.
Top 4 reasons and solutions to fix it
Here, we have the top 4 reasons for this error to occur and how we troubleshoot it.
1. Wrong encryption settings in FTP client
For instance, in FileZilla, when you connect to FTP server, you will see something like this.
Response: 227 Entering Passive Mode (11,22,33,44,167,111)
Command: MLSD
Error: Connection timed out
Error: Failed to retrieve directory listing
This happens when encryption is set to “Use explicit FTP over TLS if available” in FTP client settings.
So, we changed the encryption to “only use plain FTP” by executing the below steps.
1. First, we click on the File menu and choose Site Manager.
2. Then add Host and change Encryption to only use plain FTP.
3. Also, change the Logon Type to Normal and enter Username and Password.
4. Finally, click Connect to continue.
2. Problem with Passive mode
FTP operates in both active and passive mode. By default, FTP clients like FileZilla, CuteFTP uses passive as transfer mode.
But, in some cases, you may get an error like “FTP cannot retrieve directory listing” in passive mode. Then, try to change the default transfer mode by simply doing the steps below.
1. Go to Settings > Edit and click on Connection > FTP and choose Active.
2. Then under Active mode IP > select Ask your operating system for the external IP address.
3. Finally, under Passive mode > choose Fall back to active mode and click ok to save.
3. Missing passive port range in FTP server
In most of the cases “FTP cannot retrieve directory listing” error happens when passive port range is not mentioned FTP server configuration.
In cPanel for FTP servers like PureFTP, we perform the following steps.
1. We log in to the server via SSH.
2. Open the /var/cpanel/conf/pureftpd/local file and we add the entry like:
ForcePassiveIP: X.X.X.X
We add these changes to the file because FTP server exists behind the firewall.
3. Then we change the server’s default passive port range, by running the command.
echo "PassivePortRange: 49152 65534" >> /var/cpanel/conf/pureftpd/local
/usr/local/cpanel/scripts/setupftpserver pure-ftpd --force
4. Next, we configure the server to allow the passive port range to pass through the firewall.
5. Finally, restart the PureFTP service.
/usr/local/cpanel/scripts/setupftpserver pure-ftpd --force
4. Lacking Port range in firewall settings
Often this error happens when a firewall blocks passive FTP ports. So, it results in getting an error like “FTP cannot retrieve directory listing”.
We execute the following steps to add the passive port range to the firewall.
1. For firewall like iptables, we open the /etc/sysconfig/iptables file in a text editor.
2. Then add the entry like:
iptables -I INPUT -p tcp --dport 49152:65534 -j ACCEPT
3. Finally, run the command to save.
service iptables save
This is how we fix the error like “FTP cannot retrieve directory listing”.
[Having trouble in “FTP cannot retrieve directory listing” error? We’ll fix it for you.]
Conclusion
In short, “FTP cannot retrieve directory listing” error can happen due to a misconfiguration in firewall settings, incorrect passive port range, and more. Today, we’ve discussed the top 4 reasons for this error and how our Technical Engineers fixed them.
PREVENT YOUR SERVER FROM CRASHING!
Never again lose customers to poor server speed! Let us help you.
Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.
GET STARTED
var google_conversion_label = «owonCMyG5nEQ0aD71QM»;
Moderator: Project members
-
Furious
- 500 Command not understood
- Posts: 1
- Joined: 2008-07-10 22:09
- First name: Glen
- Last name: Hastings
Failed to retrieve Directory Listing
#1
Post
by Furious » 2008-07-10 22:15
Hi guys,
I have read the network guide and a bunch of on-line «how to’s» and think I’ve done everything right (but I probably havn’t).
Anyway, I’ve installed FileZilla Server and can access it from internally, but externally I get this message.
Status: Connecting to 203.206.183.174:21…
Status: Connection established, waiting for welcome message…
Response: 220-FileZilla Server version 0.9.24 beta
Response: 220-written by Tim Kosse (Tim.Kosse@gmx.de)
Response: 220 Please visit http://sourceforge.net/projects/filezilla/
Command: USER pd
Response: 331 Password required for pd
Command: PASS **
Response: 230 Logged on
Command: SYST
Response: 215 UNIX emulated by FileZilla
Command: FEAT
Response: 211-Features:
Response: MDTM
Response: REST STREAM
Response: SIZE
Response: MLST type*;size*;modify*;
Response: MLSD
Response: UTF8
Response: CLNT
Response: MFMT
Response: 211 End
Status: Connected
Status: Retrieving directory listing…
Command: PWD
Response: 257 «/» is current directory.
Command: TYPE I
Response: 200 Type set to I
Command: PASV
Response: 227 Entering Passive Mode (203,206,183,174,214,224)
Command: LIST
Error: Connection timed out
Error: Failed to retrieve directory listing
It seems like it can log on etc, but for what ever reason can’t do any more. Can anyone help please?
-
boco
- Contributor
- Posts: 26455
- Joined: 2006-05-01 03:28
- Location: Germany
Re: Failed to retrieve Directory Listing
#2
Post
by boco » 2008-07-11 07:39
If, after reading the Network Configuration Guide and following it to the letter, you still get errors, it’s either a software (Windows Firewall anyone?) or a hardware interfering with/blocking the traffic. Uninstall firewalls and test again. Disabling doesn’t get rid of the firewall btw.
### BEGIN SIGNATURE BLOCK ###
No support requests per PM! You will NOT get any reply!!!
FTP connection problems? Do yourself a favor and read Network Configuration.
FileZilla connection test: https://filezilla-project.org/conntest.php
### END SIGNATURE BLOCK ###
-
ronan
- 500 Syntax error
- Posts: 12
- Joined: 2008-06-28 12:37
Re: Failed to retrieve Directory Listing
#3
Post
by ronan » 2008-07-16 12:54
I’ve got almost exactly the same problem. This is what I get;
Status: Resolving IP-Address for www.newtownstewartgolf.talktalk.net
Status: Connecting to 62.24.128.168:21…
Status: Connection established, waiting for welcome message…
Response: 220-Welcome to Pure-FTPd.
Response: 220-You are user number 576 of 1000 allowed.
Response: 220-This is a private system — No anonymous login
Response: 220 You will be disconnected after 5 minutes of inactivity.
Command: USER newtownstewartgolf@talktalk.net
Response: 331 User newtownstewartgolf@talktalk.net OK. Password required
Command: PASS ***********
Response: 230-User newtownstewartgolf@talktalk.net has group access to: ftpgroup
Response: 230-OK. Current restricted directory is /
Response: 230 11286 Kbytes used (11%) — authorized: 102400 Kb
Command: SYST
Response: 215 UNIX Type: L8
Command: FEAT
Response: 211-Extensions supported:
Response: EPRT
Response: IDLE
Response: MDTM
Response: SIZE
Response: REST STREAM
Response: MLST type*;size*;sizd*;modify*;UNIX.mode*;UNIX.uid*;UNIX.gid*;unique*;
Response: MLSD
Response: TVFS
Response: ESTP
Response: PASV
Response: EPSV
Response: SPSV
Response: ESTA
Response: 211 End.
Status: Connected
Status: Retrieving directory listing…
Command: PWD
Response: 257 «/» is your current location
Command: TYPE I
Response: 200 TYPE is now 8-bit binary
Command: PASV
Response: 227 Entering Passive Mode (62,24,128,168,205,40)
Command: LIST
Error: Connection timed out
Error: Failed to retrieve directory listing
Looks familiar? I’ve turned off Windows firewall and my antivirus but it has made no difference. If you find a solution I’d be very interested to hear about it.
-
ExploreMN
- 500 Command not understood
- Posts: 1
- Joined: 2008-07-16 16:02
Re: Failed to retrieve Directory Listing
#4
Post
by ExploreMN » 2008-07-16 16:07
Actually I think you are looking at a bug and not a firewall issue. I get the same problem and this worked for almost 2 weeks then just stopped. Rebooting the machine and reinstalling does not make a difference.
Status: Resolving IP-Address for hidden.url
Status: Connecting to «our IP address»:21…
Status: Connection established, waiting for welcome message…
Response: 220 Remote Directory
Command: USER «username»
Response: 331 Password required for «username»
Command: PASS ***********
Response: 230 Logged on
Command: SYST
Response: 215 UNIX emulated by FileZilla
Command: FEAT
Response: 211-Features:
Response: MDTM
Response: REST STREAM
Response: SIZE
Response: MLST type*;size*;modify*;
Response: MLSD
Response: UTF8
Response: CLNT
Response: MFMT
Response: 211 End
Status: Connected
Status: Retrieving directory listing…
Command: PWD
Response: 257 «/» is current directory.
Command: TYPE I
Response: 200 Type set to I
Command: PASV
Response: 227 Entering Passive Mode («ip information here»)
Command: LIST
Response: 150 Connection accepted
Response: 226 Transfer OK
Error: Connection timed out
Error: Failed to retrieve directory listing
Again, this was working for several weeks and then just stopped with this problem.
-
ronan
- 500 Syntax error
- Posts: 12
- Joined: 2008-06-28 12:37
Re: Failed to retrieve Directory Listing
#5
Post
by ronan » 2008-07-27 12:16
I have had the same problem for weeks. Now I think I’ve cracked it (with the help of advice from a lot of very helpful members). I changed from Passive to Active mode, then I ticked «Ask your operating system for external IP address.»
Now I’m transferring files.
Can some one now tell me how to increase the time before it cuts out because of inactivity. The default seems to be 5 mins.
-
bjdea1
- 500 Command not understood
- Posts: 2
- Joined: 2009-05-28 02:44
- First name: Brett
Re: Failed to retrieve Directory Listing
#6
Post
by bjdea1 » 2009-05-28 02:51
I’m a server administrator and after changing over to FTPES I also had many of my clients complaining that they couldn’t connect using FileZilla
Since currently FileZilla and FireFTP are the only 2 free FTPES/FTPS (secure) ftp clients worth using, I had no other option but to solve this problem fully for my clients if I wanted our servers to be secure.
I found that this had nothing to do with FileZilla nor my clients PC or network firewalls. Instead it required extra configuration and setup of our pure-ftpd servers. It is explained fully in this article:
http://www.theserverpages.com/articles/ … perly.html
Basically the server needs to have a passive ftp port range opened in its own firewall and then pureftpd also needs to be configured to use this passive port range. Once we made this configuration change on our servers Filezilla began working for everyone in secure FTPES mode.
-
botg
- Site Admin
- Posts: 34750
- Joined: 2004-02-23 20:49
- First name: Tim
- Last name: Kosse
- Contact:
Re: Failed to retrieve Directory Listing
#7
Post
by botg » 2009-05-28 08:29
This is also explained in the Network Configuration guide. The instructions are meant for FileZilla but can be easily employed on all other servers.
-
uk2k05
- 500 Command not understood
- Posts: 1
- Joined: 2009-06-02 14:05
- First name: Stuart
- Last name: Donnachie
Re: Failed to retrieve Directory Listing
#8
Post
by uk2k05 » 2009-06-02 14:17
In my situation I required filezilla to run off port 2122, local connections were fine however after forwarding port 2122 from the router, users outside my LAN would have the same issue you experience.
To resolve this I had to turn on passive mode from within the client software.
I don’t use filezilla’s client software myself if that is what your using, but look out for this option and try to enable it.
-
ericvl
- 500 Command not understood
- Posts: 1
- Joined: 2010-03-18 07:40
- First name: Eric
- Last name: ValLau
Re: Failed to retrieve Directory Listing
#9
Post
by ericvl » 2010-03-18 08:02
I had the same problem and before spending too much time reading all the documentation and fiddling with your router and firewall, try this:
I have a windows 2000 server with no firewall (b/c I couldn’t find it) and a Linksys Corporate router.
-Open FileZilla Server Interface
-Go to the menu [Server]->[Active] — ensure that it is checked «Active»
That was the first thing. Then things started working and connecting instead of just EconnREFUSED…
Finally, the listing of directories. I had my port configured at 21.
But one thing that fixed the issue for me was going to the interface and:
-Menu [Edit]->[Settings]
-Go to [Passive Mode Settings]
-Check [Use Customer port range] and I keyed in 21 to 21 (could be different for anyone else)
Everything started working fine…. always a simpler solution before going to the complicated stuff and i don’t even think the Network Configuration doc covered that, but hope this helps!!!
-
botg
- Site Admin
- Posts: 34750
- Joined: 2004-02-23 20:49
- First name: Tim
- Last name: Kosse
- Contact:
Re: Failed to retrieve Directory Listing
#10
Post
by botg » 2010-03-18 19:29
ericvl, no offense but those settings are totally wrong.
Please read the Network Configuration guide for the correct instructions.
-
devknob
- 500 Command not understood
- Posts: 3
- Joined: 2010-05-29 06:16
- First name: devon
- Last name: averswald
- Location: Colorado Springs
Re: Failed to retrieve Directory Listing
#11
Post
by devknob » 2010-05-29 06:21
ericvl. TY so much. those settings are totally working for me.
-
devknob
- 500 Command not understood
- Posts: 3
- Joined: 2010-05-29 06:16
- First name: devon
- Last name: averswald
- Location: Colorado Springs
Re: Failed to retrieve Directory Listing
#12
Post
by devknob » 2010-05-29 06:27
hrm. idk wtf fixed my problem now. Works with 50000-50999 while it was not working for 40000-50000 … whatev. It works.
-
robajz
- 504 Command not implemented
- Posts: 9
- Joined: 2010-11-10 16:24
- First name: Robin
- Last name: Kaňjak
Re: Failed to retrieve Directory Listing
#13
Post
by robajz » 2014-03-02 16:21
Good afternoon,
I am using FZ Client for many years without a problem, but now I tried to set FZ Server and have the same issues with this message.
The server should be set correctly (listening port 21, passive mode with filled «following IP» and without custom port range), on hw-firewall before FZ Server forwarded (21) and in sw-firewall enabled port 21 too.
The log from FZ Client is:
Status: Connecting to 178.248.248.10:21…
Status: Connection established, waiting for welcome message…
Response: 220-FileZilla Server version 0.9.43 beta
Response: 220 Welcome to FTP
Command: USER user
Response: 331 Password required for user
Command: PASS ***********************
Response: 230 Logged on
Command: SYST
Response: 215 UNIX emulated by FileZilla
Command: FEAT
Response: 211-Features:
Response: MDTM
Response: REST STREAM
Response: SIZE
Response: MLST type*;size*;modify*;
Response: MLSD
Response: UTF8
Response: CLNT
Response: MFMT
Response: 211 End
Status: Connected
Status: Retrieving directory listing…
Command: PWD
Response: 257 «/» is current directory.
Command: TYPE I
Response: 200 Type set to I
Command: PASV
Response: ZZZZEntering Passive Mode (178,248,248,10,7,25)
Command: PORT 192,168,1,1,58,153
Response: 500 Syntax error, command unrecognized.
Error: Failed to retrieve directory listing
What is curious on my home-pc (Win 7, Asus router without special settings) can I connect normally (from FZ Client only, Total Commander or web browser does not work), but from a few other locations not.
I tried to read many arctiles (incl. Network Configuration), but unfortunately it did not help me.
Any advice will be appreciated.
Thanks.
-
boco
- Contributor
- Posts: 26455
- Joined: 2006-05-01 03:28
- Location: Germany
Re: Failed to retrieve Directory Listing
#14
Post
by boco » 2014-03-03 19:50
If that log you posted is genuine, you have something (most probably the router or a firewall) on your PC or network sabotaging FTP.
Response: ZZZZEntering Passive Mode (178,248,248,10,7,25)
Here it sabotages Passive mode by overwriting the response code.
Command: PORT 192,168,1,1,58,153
Response: 500 Syntax error, command unrecognized.
Here it probably sabotages Active mode, also, although you would have to provide the server’s log, too, to check this.
### BEGIN SIGNATURE BLOCK ###
No support requests per PM! You will NOT get any reply!!!
FTP connection problems? Do yourself a favor and read Network Configuration.
FileZilla connection test: https://filezilla-project.org/conntest.php
### END SIGNATURE BLOCK ###
-
robajz
- 504 Command not implemented
- Posts: 9
- Joined: 2010-11-10 16:24
- First name: Robin
- Last name: Kaňjak
Re: Failed to retrieve Directory Listing
#15
Post
by robajz » 2014-03-06 13:25
Hi boco,
thanks for reply. Sorry for that, here is the server log:
(000135)6.3.2014 14:14:52 — (not logged in) (46.23.53.15)> Connected, sending welcome message…
(000135)6.3.2014 14:14:52 — (not logged in) (46.23.53.15)> 220-FileZilla Server version 0.9.43 beta
(000135)6.3.2014 14:14:52 — (not logged in) (46.23.53.15)> 220 Welcome to praha-server (ROSENBERG)!
(000135)6.3.2014 14:14:52 — (not logged in) (46.23.53.15)> USER user
(000135)6.3.2014 14:14:52 — (not logged in) (46.23.53.15)> 331 Password required for dluhy
(000135)6.3.2014 14:14:52 — (not logged in) (46.23.53.15)> PASS ***********
(000135)6.3.2014 14:14:52 — dluhy (46.23.53.15)> 230 Logged on
(000135)6.3.2014 14:14:52 — dluhy (46.23.53.15)> PWD
(000135)6.3.2014 14:14:52 — dluhy (46.23.53.15)> 257 «/» is current directory.
(000135)6.3.2014 14:14:52 — dluhy (46.23.53.15)> TYPE I
(000135)6.3.2014 14:14:52 — dluhy (46.23.53.15)> 200 Type set to I
(000135)6.3.2014 14:14:52 — dluhy (46.23.53.15)> PASV
(000135)6.3.2014 14:14:52 — dluhy (46.23.53.15)> 227 Entering Passive Mode (178,248,248,10,7,0)
(000135)6.3.2014 14:14:52 — dluhy (46.23.53.15)> ZZZZ 192,168,1,1,13,205
(000135)6.3.2014 14:14:52 — dluhy (46.23.53.15)> 500 Syntax error, command unrecognized.
I do not know, what should sabotage this connection. I have checked firewalls on either side (software/hardware) and as I wrote already, on my home-pc can I connect safely.
Thanks.
FileZilla is free software, it has two versions i.e. FileZilla Client and FileZilla Server. The Client has cross-platform support but the Server only supports Windows. This application is used to transfer files between computers on a network. However, quite recently, a lot of reports have been coming in where users experience the “Failed to Retrieve Directory Listing” error while trying to connect to the server.
What Causes the “Failed to Retrieve Directory Listing” Error on FileZilla?
After receiving numerous reports from multiple users, we decided to investigate the issue and devised a set of solutions that eradicated it for most of our users. Also, we looked into the reasons due to which this issue is triggered and listed some of the most common ones below.
- Windows Firewall: In most cases, the FileZilla server worked locally but not remotely. Whenever a connection attempt was made locally this error was triggered. This error is triggered because FileZilla’s connection was being blocked by the Windows Firewall. Even though the exception for a particular port might be added in the Firewall, it still uses a “Passive Mode” to send and receive files. This is done on random TCP ports. Therefore, these ports are blocked by the Firewall and this error is triggered.
- Encryption: There are several types of connection encryptions that you can use while trying to connect to the server. Although some are more secure than the others they can often cause issues even with the legitimate connections by preventing the connection from being established.
Now that you have a basic understanding of the nature of the problem, we will move on towards the solutions. Make sure to implement these in the specific manner in which they are presented to avoid conflicts.
1. Create a Firewall Rule
If the Firewall is blocking FileZilla from making contact with the internet, it will not work properly and the error will be triggered. Therefore, in this step, we will be first limiting the ports for FileZilla and then adding exceptions for them in the Firewall. To do that:
- Launch the “FileZilla Server” on the “Server” computer.
- Click on the “Edit” option and select “Settings” from the list.
Clicking on “Edit” and select “Settings” - Click on the “Passive Mode Settings” option from the left pane and check the “Use Custom Port Range” option.
- Enter “2100” in the first box and the second box.
Entering 2100 in both the boxes - Click on “OK” to save your settings.
- Press the “Windows” + “I” buttons simultaneously to open settings.
- Click on “Update & Security” and select “Windows Security” in the left pane.
Selecting “Update and Security” - Click on the “Firewall & Network Protection” option and select the “Advanced Settings” button.
Clicking on “Advanced Settings” - Left–click on the “Inbound Rule” option and then right–click on it again.
- Select “New Rule” from the list.
Selecting “New Rule” - Under the heading “What Type of Rule you want to create“, check the “Port” option and click on “Next”.
Checking the “Port” option - Check the “TCP” option and check the “Specific Local Ports” option.
Checking “TCP” and the “Specific Local Ports” option - Write in “21,2100” in the space and click on “Next”.
Note: In place for 21 write the port that you selected while creating the server - Check the “Allow Connection” option and click on “Next“.
Clicking on “Allow Connection” - In the next screen, check “Private“, “Domain” and the “public” option.
Checking the Private, Domain and Public options - Click on “Next” and enter the name which you want for this rule.
Entering the name for the rule - Click on “Finish” to add this rule.
- Repeat this same process for “Outgoing Rules” to add the same rule for it as well.
- When these rules have been added, check to see if the issue persists.
2. Change Encryption
It is possible that the Encryption configurations might be causing the issue. Therefore, in this step, we will be changing the encryption for the connection. For that:
- Open “FileZilla Client” on the “Client” computer.
- Click on “File” and select “Site Manager“.
Clicking on File and selecting “Site Manager” - If the server you want to connect to isn’t already in there select “New Site“.
- Add the hostname, username, and password for the connection.
- Click on the “Logon Type” dropdown and select “Normal“.
- Click on the “Encryption” dropdown and select “Only use Plain FTP“.
Changing Encryption Settings - Make the connection and check to see if the issue persists.
3. Change FTP Configurations
In some cases, the FTP settings might not be configured properly due to which the error is being triggered. Therefore, in this step, we will be changing certain FTP configurations. In order to do that:
- Open “FileZilla Client” on the “Client” Computer.
- Click on “Edit” and select “Settings“.
Clicking on “Edit” and select “Settings” - Click on “FTP” under “Connections” and check the “Active” option.
Clicking on FTP and checking “Active” - Check “Allow Fallback to other transfer modes on Failure“.
- Click on “Active Mode” under the “FTP” heading and check the “Ask your operating system for External IP Address” option.
Clicking on “Active Mode” and checking the “Ask your operating system for External IP Address” option - Click on the “Passive Mode” option and check the “Fall Back to Active Mode” option.
Clicking on “Passive Mode” and checking the “Fall Back to Active Mode” option - Click on “OK” to save your settings and check to see if the issue persists.
4. Alter the Host Name
Sometimes, while making a connection to a specific host altering the hostname to initiate a certain protocol might fix the error. Therefore, in this step, we will be altering the hostname. For that:
- Open “FileZilla Client” on the “Client” computer.
- Click on the “Hostname” option.
- Enter the following before the actual hostname of the server
sftp://
Adding “sftp://” before the hostname - Enter the rest of the details and check to see if the issue persists.
5. Change Transfer Mode
Filezilla offers two specific transfer modes to transfer files across the network. It has Passive Mode or Active Mode; Passive Mode allows the server to determine which port is used for data connection, while Active Mode allows the server to assign the same IP address as the FTP client making the request. Follow the steps to change the transfer mode:-
- Click on File from the top and select Site Manager
Go to Site Manager - Select your site and navigate to Transfer Settings from the right pane
- Change Transfer Mode from Passive to Active
Changing Transfer Mode - Once done and check if the issue persists.
Kevin Arrows
Kevin is a dynamic and self-motivated information technology professional, with a Thorough knowledge of all facets pertaining to network infrastructure design, implementation and administration. Superior record of delivering simultaneous large-scale mission critical projects on time and under budget.
Approx. read time : 3 min
Watch this video for a step by step process on how to Fix Failed to Retrieve Directory Listing Error in FileZilla FTP
While using FileZilla for connecting to your FTP you might get an error as below:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
Status: Resolving address of ftp.website.com Status: Connecting to 11.22.33.44:21… Status: Connection established, waiting for welcome message... Status: Initializing TLS... Status: Verifying certificate... Status: TLS connection established. Status: Server does not support non—ASCII characters. Status: Connected Status: Retrieving directory listing... Command: PWD Response: 257 «/» is your current location Command: TYPE I Response: 200 TYPE is now 8—bit binary Command: PASV Response: 227 Entering Passive Mode (11,22,33,44,167,111) Command: MLSD Error: Connection timed out Error: Failed to retrieve directory listing |
There can be different reasons for this error to occur and also different solutions for it.
This error can be easily fixed by going into the Site Manager and using plain FTP by adjusting your connection details.
Note: You will have to open Passive Ports in your FTP’s server configuration file and firewall too.
1. Wrong Encryption Settings in FTP Client
For example, while using FileZilla, when you connect to FTP server you might get an error as below:
Response: 227 Entering Passive Mode (11,22,33,44,167,111) Command: MLSD Error: Connection timed out Error: Failed to retrieve directory listing |
This error occurs when encryption is set to “Use explicit FTP over TLS if available” in FTP client settings.
Check the steps below to fix the problem:
1. Go to FileZilla, click on “File” menu and select “Site Manager”.
2. If the site or server you want to connect to isn’t already mentioned in site manager, add it.
a. Add hostname.
b. Make the Encryption to “Only use plain FTP”.
c. Change logon type to “Normal”.
d. Enter username/password.
e. Ok/Connect to continue.
In case you are still getting the error, disable your firewall then try once more!
2. Problem with Passive mode
FTP works in both active and passive mode. FTP clients like FileZilla, CuteFTP, etc. use passive mode for transfer. But sometimes you may get an error such as “FTP can’t retrieve directory listing” in passive mode, then follow the below steps to resolve the error:
- Open Filezilla, click on Edit -> Settings.
- Next, click on Connection -> FTP: Select Active.
- Click on Connection -> FTP -> Active Mode: Choose “Ask your operating system for the external IP address”.
- Click on Connection -> FTP -> Passive Mode: Select Fall Back to Active Mode
- Press OK.
Try connecting to your FTP again!
3. Missing Passive Port Range in FTP Server
In most of the cases “FTP cannot retrieve directory listing” error occurs when passive port range is not mentioned FTP server configuration.
In cPanel for FTP servers like PureFTP, follow the below steps.
1. Log in to the server via SSH.
2. Open the /var/cpanel/conf/pureftpd/local file and add the entry as below:
These changes are then added to the file because FTP server exists behind the firewall.
3. Then change the server’s default passive port range, by running the below command:
echo «PassivePortRange: 49152 65534» >> /var/cpanel/conf/pureftpd/local /usr/local/cpanel/scripts/setupftpserver pure—ftpd —force |
4. Next, configure the server so that the passive port range will pass through the firewall.
5. Lastly, restart the PureFTP service.
/usr/local/cpanel/scripts/setupftpserver pure—ftpd —force |
4. Lacking Port Range in Firewall Settings
This error usually occurs when a firewall blocks passive FTP ports.
Check the following steps to add the passive port range to the firewall to solve this error:
1. For firewall like iptables, open the /etc/sysconfig/iptables file in a text editor.
2. Then add the entry as below:
iptables —I INPUT —p tcp —dport 49152:65534 —j ACCEPT |
3. Lastly, run the below command to save.
In this way, you can fix the error like “FTP cannot retrieve directory listing”.
Also Read:
Steps to Display Hidden Files on Your FTP Client
How to Create and Edit a File via FTP?
FileZilla – это специализированное FTP-приложение, которое используется для обмена файлами по сети. Работает по принципу «клиент-сервер». Но иногда при попытке подключится к серверу FileZilla, пользователи сталкиваются с ошибкой «не удалось получить список каталогов».
Содержание
- 1 Чем вызвана ошибка?
- 2 Создание правила в брандмауэре
- 3 Изменение настроек шифрования
- 4 Изменение конфигурации FTP
- 5 Изменение имени хоста
Чем вызвана ошибка?
Ошибка получения списка каталогов при подключении к серверу FileZilla может возникнуть по ряду причин:
- Соединение заблокировано брандмауэром Windows. Даже если установлено исключение для определенного порта в этом инструменте контроля за трафиком, FileZilla использует «Пассивный режим» для получения или отправки файлов. То есть для передачи могут быть открыты любые порты TCP, при блокировке которых приложение выбрасывает эту ошибку.
- Используется зашифрованное соединение, при котором могут возникнуть проблемы с подключением к серверу.
Создание правила в брандмауэре
Сообщение о неполадке при получении списков каталогов часто возникает из-за блокировки брандмауэром подключения FileZilla. В этом решении сначала ограничим порты клиента, затем добавим их в список исключений межсетевого экрана.
Запустите FileZilla Server, щелкните на «Edit» и выберите «Settings».
На левой панели щелкните на опцию «Passive Mode Settings» и отметьте флажком «Use Custom Port Range».
В первом и во втором поле введите «2100» и сохраните настройки.
В меню Пуск кликните на значок шестеренки для входа в параметры Windows. Перейдите в раздел «Обновления и безопасность».
На вкладке Безопасность Windows откройте Брандмауэр и защита сети.
Перейдите в «Дополнительные параметры».
Затем кликните на «Правила для входящих подключений», на правой панели Действие выберите «Создать правило».
В открывшемся окне укажите тип правила «Для порта» и продолжите.
Отметьте флажком опции «протокол TCP», «Определенные локальные порты» и наберите в поле «21, 2100» и продолжите.
Примечание: вместо 21 впишите порт, который был указан при установке сервера.
В окне Действие установите флажок «Разрешить подключение».
В следующем окне отметьте все три профиля: доменный, частный, публичный и продолжите.
Присвойте имя новому правилу и нажмите на «Готово».
Повторите эти действия для создания исходящего правила.
После добавления правил проверьте, сохраняется ли проблема.
Изменение настроек шифрования
Проблема также связана с настройками шифрования. Чтобы исправить ошибку получения списков каталогов при подключении к серверу FileZilla попробуйте отключить шифрование. Выполните следующие шаги.
Откройте клиента FileZilla на клиентском компьютере. В верхнем меню приложения перейдите в Файл – Менеджер сайтов.
Если еще нет созданных подключений, кликните на кнопку «Новый сайт». Добавьте хост, логин и пароль для доступа к FTP.
В пункте «Тип входа» кликните на выпадающий список и установите значение «Нормальный». В пункте «Шифрование» разверните выпадающее меню и выберите «Использовать обычный FTP».
После попробуйте установить соединение.
Изменение конфигурации FTP
Если по-прежнему не удается подключиться к серверу FileZilla из-за проблем с получением списка каталога, попробуйте изменить параметры FTP соединения.
В меню клиента перейдите на вкладку Редактирование, затем щелкните на Настройки.
Разверните раздел Соединение — FTP. Отметьте опцию «Разрешить возврат к другому режиму при сбое».
Затем на вкладке «Активный режим» установите флажок на «Получить сведения о внешнем IP-адресе в настройках системы».
На вкладке «Пассивный режим» выберите опцию «Вернуться в активный режим».
Сохраните изменения и проверьте, возникает ли ошибка.
Изменение имени хоста
Иногда удается устранить проблему путем изменения имени хоста для инициализации определенного протокола.
Откройте клиента FileZilla и в основном окне приложения щелкните в поле хоста. Перед фактическим именем хоста наберите «sftp://».
Введите остальные данные и проверьте, удалось ли исправить ошибку получения списка каталогов.
-
Partition Wizard
-
Partition Manager
- 3 Ways to Fix FileZilla Failed to Retrieve Directory Listing
By Linda | Follow |
Last Updated August 13, 2021
Have you encountered Failed to retrieve directory listing error when connect to the FileZilla server? In this post, MiniTool Partition Wizard offers you 3 ways to fix the FileZilla failed to retrieve directory listing error and you can try then one by one.
FileZilla Failed to Retrieve Directory Listing
FileZilla is a free and open source FTP (File Transfer Protocol) application, divided into client version and server version, with all FTP software functions. The Client has cross-platform support but the Server only supports Windows.
The FileZilla server is installed on a PC providing file storage services and the FileZilla client is installed on your PC. In this way, you can upload your files to the server on the remote PC or download files from the server to your local PC.
However, some people report that they have encountered «FileZilla failed to retrieve directory listing» error when they try to connect to the server, just as the following picture shows:
As for how to solve this issue, you can try the following methods.
What Are The Best File Hosting Services For You In 2021
Fix 1. Create a Firewall Rule
FileZilla uses Passive Mode by default to send and receive files as well as directory listings. This is often done on random TCP ports, even if a port has been reserved for FTP service on the host machine and for incoming connections.
However, Firewall won’t allow random TCP IP connections. In this case, you can try to create a Firewall rule. Here is the guide:
Step 1: Custom port range in FileZilla.
- Launch the FileZilla Server on the Server computer.
- Choose Edit > Settings.
- In FileZilla Server Options window, navigate to General settings > Passive mode settings tab and highlight it in the left panel.
- In the right panel, check Use Custom Port Range option and enter 2100 in the two boxes.
- Click OK to save changes.
Step 2: Change Firewall settings.
- Press Windows key + I to open Windows Settings.
- Go to Update & Security > Windows Defender > Open Windows Defender Security Center > Firewall & network protection > Advanced settings.
- Choose Inbound Rules and right-click on it. Then, choose New Rule.
- Check Port and click Next.
- Check TCP option and Specific Local Ports Then, enter #,2100 in the space and click Next (# is the port number reserved for FTP and you should replace it according).
- Check Allow the connection option and click Next.
- Check Domain, Private, and Public Then, click Next.
- Enter a name and click Finish.
- Repeat this same process for Outbound Rules to add the same rule for it as well.
Fix 2. Use Plain FTP
- Open FileZilla Client on the Client computer.
- Click File > Site Manager.
- Add the site or server you want to connect to if it’s not already in site manager. You should add the hostname, change Encryption to only use plain FTP, change Logon Type to Normal, and enter username/password.
Fix 3. Change FTP Configurations
- Open FileZilla Client.
- Click Edit > Settings.
- Click FTP under Connections. Then, under Transfer Mode, check Active option and Allow Fallback to other transfer modes on Failure option in the right panel. This will change the transfer mode from passive to active.
- Click Active Mode under FTP. Then, under Active mode IP, check Ask your operating system for External IP Address
- Click Passive Mode under FTP. Then, check the Fall Back to Active Mode
- Click OK to save changes.
If the above methods don’t work, you can try adding sftp:// before the hostname when you connecting the server.
About The Author
Position: Columnist
Author Linda has been working as an editor at MiniTool for 1 year. As a fresh man in IT field, she is curious about computer knowledge and learns it crazily. Maybe due to this point, her articles are simple and easy to understand. Even people who do not understand computer can gain something.
By the way, her special focuses are data recovery, partition management, disk clone, and OS migration.
Updated January 2023: Stop getting error messages and slow down your system with our optimization tool. Get it now at this link
- Download and install the repair tool here.
- Let it scan your computer.
- The tool will then repair your computer.
You cannot connect via FTP; the server accepts your username and password, but it fails when you request a directory or wait for a welcome message.
An error such as one of the following may appear:
- Unable to build data connection: Connection timed out
- MLSD: Connection timed out
- [R] List Error
- Error: Failed to retrieve directory listing
FileZilla is free software, there are two versions, FileZilla Client and FileZilla Server. The client is supported on all platforms, but the server only supports Windows. This application is used to transfer files between computers on a network. Recently, however, there have been many reports in which users trying to connect to the server have found the error “Failed to Retrieve Directory Listing”.
How to fix directory listing errors that fail in FileZilla FTP?
You can easily solve this problem by going to the Site Manager and adjusting your login data to use simple FTP. Follow these steps to solve the problem:
- In FileZilla, click on the File menu and select Site Manager.
- Add the website or server to which you want to connect, if it is not already present in Site Manager.
- Add a host name
- Change the encryption to “Use normal FTP only
- Change the connection type “Normal
- Enter the username/password.
- Ok/Connection to continue
January 2023 Update:
You can now prevent PC problems by using this tool, such as protecting you against file loss and malware. Additionally it is a great way to optimize your computer for maximum performance.
The program fixes common errors that might occur on Windows systems with ease — no need for hours of troubleshooting when you have the perfect solution at your fingertips:
- Step 1 : Download PC Repair & Optimizer Tool (Windows 10, 8, 7, XP, Vista – Microsoft Gold Certified).
- Step 2 : Click “Start Scan” to find Windows registry issues that could be causing PC problems.
- Step 3 : Click “Repair All” to fix all issues.
Disable the System Firewall
If such problems occur while it is working for one instance, but not for another – in this case FTP works locally, but not remotely – the first thing you should try is to disable the firewall to see if it makes a difference. If you are using the Windows firewall, disable it and you can connect to the FTP server remotely via the system.
Send the PASV command to the server.
When you send the port command to your server, ask the server to connect to you (in the remote network). If the remote network also has a NAT router and you have not redirected the port you are sending with your PORT command, the server cannot reach you.
The most common solution would be to send the PASV command to the server instead of the PORT command. The PASV command prompts the server to create a listening record and accept a connection from the remote computer to establish the data connection.
For the PASV command to work, you must also forward a number of ports for passive data connections. Passive connection ports (which must be forwarded) must be listed in the FileZilla documentation.
Change the transfer method to Active.
To resolve this FTP error, do the following:
- Open Filezilla, go to Edit -> Settings
- Click on Connection -> FTP : Select On.
- Click on Connection -> FTP -> Active mode: select “Request external IP address from your operating system”.
- Click on Connection -> FTP -> Passive mode: Select Return to active mode.
CONCLUSION
In short, the FTP error “could not retrieve the list of directories” in cPanel occurs due to server firewall restrictions, FTP client settings and more.
https://forum.filezilla-project.org/viewtopic.php?t=7315
Expert Tip: This repair tool scans the repositories and replaces corrupt or missing files if none of these methods have worked. It works well in most cases where the problem is due to system corruption. This tool will also optimize your system to maximize performance. It can be downloaded by Clicking Here
CCNA, Web Developer, PC Troubleshooter
I am a computer enthusiast and a practicing IT Professional. I have years of experience behind me in computer programming, hardware troubleshooting and repair. I specialise in Web Development and Database Design. I also have a CCNA certification for Network Design and Troubleshooting.
Post Views: 256