FTP Connection Error : Error loading directory...

Status
Not open for further replies.

tuncayeskikoy

Member
May 30, 2011
5
0
51
Hi

We can not access the ftp directory on the newly formed cpanel.
Connection logs, such as the following.
Look forward to your help.
Sorry for bad English.

--------------------------------------------------------------
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 1 of 50 allowed.
220-Local time is now 15:04. Server port: 21.
220-This is a private system - No anonymous login
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
USER xpazarla
331 User xpazarla OK. Password required
PASS **********
230 OK. Current restricted directory is /
SYST
215 UNIX Type: L8
Keep alive off...
Attemping Active mode transfer...
PORT 192,168,100,90,68,127
200 PORT command successful
LIST
500 Unknown command
Server failed to connect data port
Error loading directory...
-------------------------------------------------------------
 

adminlogs

Member
May 30, 2011
5
0
51
Hi ,

Check port 20 is open in the server firewall.

you can allow port 20 in iptables

iptables -A INPUT -s 0/0 -p tcp --dport 20 -j ACCEPT

/etc/init.d/iptables save


In the above its allowed from public. If you want then you can restrict with the specified ip's.


Sincerely,
/http://www.adminlogs.info
 

JaredR.

Well-Known Member
Feb 25, 2010
1,834
23
143
Houston, TX
cPanel Access Level
Root Administrator
FTP normally uses port 21, not 20.

What is described looks like the customer is using passive-mode FTP and a port range is not open in the firewall to match the port range used by the FTP service. There are two options to fix this:

  • Use active-mode FTP instead of passive. This is normally selectable in the FTP client. In the command-line FTP client, you can simply type "passive" to toggle passive/active mode.
  • Configure a port range for passive-mode FTP in the FTP service configuration, and configure the server's firewall to match.

The second option has been covered extensively in this forum, as it is a very common issue. I found the following threads that should help:

http://forums.cpanel.net/f5/ftp-passive-mode-not-working-74605.html
http://forums.cpanel.net/f5/passive-ftp-cpbackup-not-working-202992.html
http://forums.cpanel.net/f5/ftp-not-working-help-please-125589.html

If you are using Pure-FTPd, which is the default, you can define the passive-mode port range by editing /etc/pure-ftpd.conf and uncommenting the following directive:

Code:
# Port range for passive connections replies. - for firewalling.

# PassivePortRange          30000 50000
Once you have removed the hash mark (#) from the line starting with "PassivePortRange", restart Pure-FTPd and edit your firewall configuration to allow traffic on the same port range.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,606
33
238
somewhere over the rainbow
cPanel Access Level
Root Administrator
Are you certain you are trying passive mode even? The log shows active mode:

Attemping Active mode transfer...
Are you using an FTP client such as FileZilla or what precisely? If you are not using FileZilla, could you try using that free FTP client? You can download it from here:

FileZilla - Client Download
 

tuncayeskikoy

Member
May 30, 2011
5
0
51
FileZilla output:

Status: Resolving address of ftp......com
Status: Connecting to ........:21...
Status: Connection established, waiting for welcome message...
Response: 220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
Response: 220-You are user number 1 of 50 allowed.
Response: 220-Local time is now 14:24. Server port: 21.
Response: 220-This is a private system - No anonymous login
Response: 220 You will be disconnected after 15 minutes of inactivity.
Command: USER xpazarla
Response: 331 User xpazarla OK. Password required
Command: PASS ********
Response: 230 OK. Current restricted directory is /
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: AUTH TLS
Response: PBSZ
Response: PROT
Response: ESTA
Response: PASV
Response: EPSV
Response: SPSV
Response: ESTP
Response: 211 End.
Status: Connected
Status: Retrieving directory listing...
Command: PWD
Response: 257 "/" is your current location
Command: TYPE I
Response: 504-Unknown TYPE: I
Response: 504 TYPE is now ASCII
Error: Failed to retrieve directory listing
 

Infopro

Well-Known Member
May 20, 2003
17,113
507
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
Using Filezilla to duplicate your steps, my output is identical until the last section:

Code:
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 ([I]ip,he,re,some,where[/I])
Command:	MLSD
Response:	150 Accepted data connection
Response:	226-Options: -a -l 
Response:	226 15 matches total
Status:	Directory listing successful
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,606
33
238
somewhere over the rainbow
cPanel Access Level
Root Administrator
If you have root SSH access, please run an "ls -lah /home/xpazarla" to check the permissions on the directory.

Next, what operating system are you using? There's a bug in pure-ftpd where it will not work to list the directories or upload files in RHEL 3 and CentOS 3. For those operating systems where pure-ftpd will not work, proftpd needs to be used.

Finally, please check for the following in /etc/pure-ftpd.conf file:

Code:
#CallUploadScript yes
If this is uncommented (where the # has been removed), please re-add the # in front of this option. This option cannot be used with the cPanel installed copy of pure-ftpd
 

pubudusj

Registered
Jul 8, 2011
1
0
51
Hi,
I set the passive port range on pure-ftpd.conf to 30000 50000 & set allowed the same in configserver firewall.
Also the line on pure-ftpd.conf "#CallUploadScript yes" is as u mentioned commented.
Restarted pureftpd as well as configserver firewall.
Still I can't login with FTP.
Can someone tell me what is wrong there?

I even tried with disabling the firewall, but it is not working too :confused:

My log on Filezilla client is as follows.
Code:
Command:	PASS ******
Response:	230 OK. Current restricted directory is /
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:	 AUTH TLS
Response:	 PBSZ
Response:	 PROT
Response:	 ESTA
Response:	 PASV
Response:	 EPSV
Response:	 SPSV
Response:	 ESTP
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 (50,30,32,76,146,90)
Command:	MLSD
Response:	150 Accepted data connection
Response:	226-Options: -a -l 
Response:	226 2 matches total
Error:	Connection timed out
Error:	Failed to retrieve directory listing
 
Last edited:

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,911
2,233
363
cPanel Access Level
DataCenter Provider
Twitter
Hello :)

Were you able to run the command that Tristan suggested?

Code:
# ls -lah /home/xpazarla
If the permission and ownership values look normal, please feel free to open a support ticket for this issue so we may check further:

Submit A Ticket

You can post the ticket number here so we may track the issue.

Thank you.
 

PDW

Well-Known Member
Dec 29, 2003
121
0
166
Did you get this fixed with their help, what was the issue - I am havign the exact same problem - started today and I have had no issues before - I cant get ftp connect to to work. thanks
 

JaredR.

Well-Known Member
Feb 25, 2010
1,834
23
143
Houston, TX
cPanel Access Level
Root Administrator
This thread was last updated over four months ago, and we are no longer seeing many instances of the CallUploadScript problem. If FTP is still not working for you, please submit a ticket so that we may log into the server and work with you individually. There is no charge for submitting a ticket.
 
Status
Not open for further replies.