Knowledge Base
MilesWeb / FTP

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

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:

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?

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.

Trusted By Thousands of Clients & Big Businesses

We highly appreciate the kind and stellar feedback we receive from our customers. Delivering the best is our goal! MilesWeb is rated Excellent out of 5 based on reviews. Read more reviews.

Excellent
Based on reviews
2 hours ago
Perfect and Valuable Server + ...
I am using MilesWeb Servers, The main thing which I getting are continuous support over everything w...
Gunjan Makwana
4 hours ago
Milesweb is superb Hosting pro...
Milesweb is superb Hosting provider ever, their Support team is amazing!!!...
Abhishek Singh
15 hours ago
Great support in great timing...
We need urgent assistance on changes in a primary domain on our client's Cpanel accounts and reached...
Riyaju Deen
21 hours ago
Best Website Hosting platform ...
I was new on MilesWeb. And needed help on multiple areas from setting up to getting started with cre...
Harshada
1 days ago
Very quick and helpful assista...
Very quick and helpful assistance. Support person listened properly and provided a nice solution....
Narendra
1 days ago
the team is very supportive th...
the team is very supportive though at times effort needs to be made to make understand the problem s...
Suree Sharma
1 days ago
I am using miles web for 3plus...
I am using miles web for 3plus years, very quick and perfect support by the team, they helped me man...
Sri Raghav
2 days ago
The service is good...
The service is good. They are answering with patience and doing the needful as soon as possible....
MR
2 days ago
Perfect and Valuable Server + ...
I am using MilesWeb Servers, The main thing which I getting are continuous support over everything w...
Gunjan Makwana
3 days ago
Very quick and helpful assista...
Very quick and helpful assistance. Support person listened properly and provided a nice solution....
Narendra
4 days ago
positively helped me with find...
positively helped me with finding insecure content on my website causing SSL to not work properly on...
Thaviraj Junglee
4 days ago
Exceptional support, Truly Pra...
I had opted for the basic wordpress hosting plan as I intended to experiment with various plug-ins. ...
Aseem Chandna