Knowledge Base Hub

Browse through our helpful how-to guides to get the fastest solutions to your technical issues.

Home  >  FTP  >  How to Fix Failed to Retrieve Directory Listing Error in FileZilla FTP?
Top Scroll

How to Fix Failed to Retrieve Directory Listing Error in FileZilla FTP?

 3 min

While using FileZilla for connecting to your FTP you might get an error as below:

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:

ForcePassiveIP: X.X.X.X

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.

service iptables 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?

For our Knowledge Base visitors only
Get 10% OFF on Hosting
Special Offer!
30
MINS
59
SECS
Claim the discount before it’s too late. Use the coupon code:
STORYSAVER
Note: Copy the coupon code and apply it on checkout.