FTPES fails to retrieve directory listing

Need help with FileZilla Client? Something does not work as expected? In this forum you may find an answer.

Moderator: Project members

Post Reply
Message
Author
geronimo
500 Command not understood
Posts: 2
Joined: 2008-03-17 18:38
First name: Serge
Last name: Goldenberg

FTPES fails to retrieve directory listing

#1 Post by geronimo » 2008-03-17 18:54

I am using Filezilla client 3.0.8 on my laptop to communicate with my home server (A synology DS207 behind a routeur);
2 filezilla version ago I managed to connect using FTP over explicit TLS/SSL but it is not working anymore: I am getting a "failed to retrieve directory listing" error. Regular FTP does work from outside the network, and FTPES works from within my home network. Can someone help ?

Here is the log of my last failed attempt (from outside):

Status: Connecting to 81.57.50.59:21...
Status: Connection established, waiting for welcome message...
Response: 220 Disk Station FTP server at Server ready.
Command: AUTH TLS
Response: 234 AUTH TLS OK.
Status: Initializing TLS...
Command: USER geronimo
Trace: Handshake successful
Trace: Cipher: AES-128-CBC, MAC: SHA1
Status: Verifying certificate...
Status: TLS/SSL connection established.
Response: 331 Password required for geronimo.
Command: PASS ******
Response: 230 User geronimo logged in.
Command: SYST
Response: 215 UNIX Type: L8
Command: FEAT
Response: 211- Extensions supported:
Response: AUTH TLS
Response: PBSZ
Response: PROT
Response: SIZE
Response: MDTM
Response: REST STREAM
Response: 211 End.
Command: PBSZ 0
Response: 200 PBSZ command successful (PBSZ=0)
Command: PROT P
Response: 200 Protection level set to Private.
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 (192,168,1,6,220,188)
Status: Server sent passive reply with unroutable address. Passive mode failed.
Trace: Reply: 192.168.1.6, peer: 81.57.50.59
Command: PORT 81,57,50,59,220,124
Response: 200 PORT command successful.
Command: LIST
Response: 425 Can't build data connection: Connection refused.
Error: Failed to retrieve directory listing
Response: 550 Data connection: Success.
Trace: Unexpected reply, no reply was pending.
Status: Sending keep-alive command
Command: NOOP
Response: 200 NOOP command successful.
Trace: Skipping reply after cancelled operation or keepalive command.
Status: Disconnected from server (-> manually disconnected)

M@TTY
504 Command not implemented
Posts: 10
Joined: 2008-03-16 18:48
First name: Mathijs
Last name: Schilthuizen
Location: The Netherlands

Re: FTPES fails to retrieve directory listing

#2 Post by M@TTY » 2008-03-17 19:12

got same problem but then a 425 can't open data connection
425: can't open data connection ;) unable to use passive mode: t-o

leach
500 Command not understood
Posts: 1
Joined: 2008-03-23 19:56
First name: Pasi
Last name: Oikarinen

Re: FTPES fails to retrieve directory listing

#3 Post by leach » 2008-03-23 20:00

You have to use Active transfer mode.

User avatar
botg
Site Admin
Posts: 35509
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: FTPES fails to retrieve directory listing

#4 Post by botg » 2008-03-23 21:09

Please read the Network Configuration guide.

the123hulk
500 Command not understood
Posts: 4
Joined: 2005-11-03 02:46

Re: FTPES fails to retrieve directory listing

#5 Post by the123hulk » 2008-03-24 18:05

Hi,

Some of the answers you have received are incorrect. Your problem is that your passive mode is not being accepted because you do not have your FTP server set up incorrectly :

Command: PASV
Response: 227 Entering Passive Mode (192,168,1,6,220,188)
Status: Server sent passive reply with unroutable address. Passive mode failed.
Trace: Reply: 192.168.1.6, peer: 81.57.50.59

As you can see, your FTP server is responding with a local LAN address when requesting PASSIVE mode instead of your home WAN address. To correct this, do the following :

In FTP Server, Edit - Settings - Passive Mode Settings
1). Change default to "Use the following IP" and put in your WAN IP.
2). If you have an IP which changes regularly, then you should look into a DNS client such as one available at http://www.no-ip.com. That will automatically update your domain name with your changing IP so that the address is always correct. You don't need to do this second step, it is just a suggestion but makes life easier.
3). Enable "Use custom port range" and fill in a range of ports (such as 6000-6050)
4). Open up your router settings (usually by going to 192.168.1.1 in your local browser), and port forward whatever port you are using for your FTP server (default is 21), and the range of ports you just assigned in step 3. Since your FTP server is actually responding, it is correctly listening on port 21 so at least that part is correct. Once you port forward the range you defined, the LIST command will also work.

That's it. If you want the technical explanation, your FTP server is listening on port 21 (by default), but the LIST command needs separate ports on which to communicate in passive mode. That's why you can log in, but not see the files.

TH.

User avatar
boco
Contributor
Posts: 26914
Joined: 2006-05-01 03:28
Location: Germany

Re: FTPES fails to retrieve directory listing

#6 Post by boco » 2008-03-24 18:10

The Network Configuration Guide already contains most of that information. We don't redirect people there for fun.
No support requests over PM! You will NOT get any reply!!!
FTP connection problems? Please read Network Configuration.
FileZilla connection test: https://filezilla-project.org/conntest.php
FileZilla Pro support: https://customerforum.fileZilla-project.org

geronimo
500 Command not understood
Posts: 2
Joined: 2008-03-17 18:38
First name: Serge
Last name: Goldenberg

Re: FTPES fails to retrieve directory listing

#7 Post by geronimo » 2008-03-28 14:05

Thank you for your answers.
I did read the manual before posting however:
the123hulk wrote:Hi,

Some of the answers you have received are incorrect. Your problem is that your passive mode is not being accepted because you do not have your FTP server set up incorrectly :

Command: PASV
Response: 227 Entering Passive Mode (192,168,1,6,220,188)
Status: Server sent passive reply with unroutable address. Passive mode failed.
Trace: Reply: 192.168.1.6, peer: 81.57.50.59

As you can see, your FTP server is responding with a local LAN address when requesting PASSIVE mode instead of your home WAN address. To correct this, do the following :

In FTP Server, Edit - Settings - Passive Mode Settings
1). Change default to "Use the following IP" and put in your WAN IP.
(I ALREADY DID THAT BEFORE GETTING ERROR MESSAGE)
2). If you have an IP which changes regularly, then you should look into a DNS client such as one available at http://www.no-ip.com. That will automatically update your domain name with your changing IP so that the address is always correct. You don't need to do this second step, it is just a suggestion but makes life easier.
NO I HAVE A FIXED WAN IP 3).
Enable "Use custom port range" and fill in a range of ports (such as 6000-6050)
(I ALREADY DID THAT BEFORE GETTING ERROR MESSAGE, USED THE RANGE REQUESTED BY SYNOLOGY)

4). Open up your router settings (usually by going to 192.168.1.1 in your local browser), and port forward whatever port you are using for your FTP server (default is 21), and the range of ports you just assigned in step 3. Since your FTP server is actually responding, it is correctly listening on port 21 so at least that part is correct. Once you port forward the range you defined, the LIST command will also work.

I ALREADY DID THAT BEFORE GETTING ERROR MESSAGE: RANGE OF PORTS REROUTED TO THE INTERNAL IP ADDRESS OF MY ROUTER

That's it. If you want the technical explanation, your FTP server is listening on port 21 (by default), but the LIST command needs separate ports on which to communicate in passive mode. That's why you can log in, but not see the files.

TH.

User avatar
boco
Contributor
Posts: 26914
Joined: 2006-05-01 03:28
Location: Germany

Re: FTPES fails to retrieve directory listing

#8 Post by boco » 2008-03-28 21:33

You put your WAN IP in the server's Passive settings? Sorry, but the log says the contrary. It should reply with the WAN IP. Until it does, you won't get anywhere.
No support requests over PM! You will NOT get any reply!!!
FTP connection problems? Please read Network Configuration.
FileZilla connection test: https://filezilla-project.org/conntest.php
FileZilla Pro support: https://customerforum.fileZilla-project.org

the123hulk
500 Command not understood
Posts: 4
Joined: 2005-11-03 02:46

Re: FTPES fails to retrieve directory listing

#9 Post by the123hulk » 2008-04-03 20:07

Boco is entirely correct.

The log you posted clearly shows that when your FTP client issues the PASV command to request passive mode, the server responds with the local LAN address. That will never work (unless your requesting client is also on the same local LAN). FTP works in passive mode by listening on port 21, and then sending data over an agreed upon data connection port. In this case, the server tries to respond with a local LAN address which the external client cannot access. The server must respond with the WAN IP (or WAN DNS name, either one as long as it is resolvable). Otherwise, no dice.

So from your log, I can see that the WAN IP is not currently configured correctly in the "Passive mode settings". Change the "Use the following IP" setting to your WAN IP. Since you have a fixed WAN IP, go ahead and put that in since it will never change.

TH.

Post Reply