Knowledge Base
MilesWeb / FTP

Learn to Fix Failed to Retrieve Directory Listing Error in FileZilla FTP

Approx. read time : 2 min

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

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:

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:

4. Next, configure the server so that the passive port range will pass through the firewall.

5. Lastly, restart the PureFTP service.

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:

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?

Avatar
Pallavi is a Digital Marketing Executive at MilesWeb and has an experience of over 4 years in content development. She is interested in writing engaging content on business, technology, web hosting and other topics related to information technology.
Need help? We’re always here for you.
Register Your Free Domain Name
OFFER EXPIRES IN
04
min
59
sec