Timeout detected. Could not retrieve directory listing

Advertisement

Lauri
Guest

Timeout detected. Could not retrieve directory listing

I just downloaded WinSCP. I've tried and tried to get it to connect to the server, but it doesn't work. I've been through the FAQ and all but couldn't find anything to help. This is the error message that I get:
Timeout detected.
Could not retrieve directory listing
Opening ASCII mode data connection for /bin/ls.
Error listing directory '/'.
Can you help me?

Reply with quote

Advertisement

Lauri
Guest

Still can't get in

I'm not sure what you wanted me to see in the documentation. I've uninstalled and re-installed, checked and double checked my settings, host name, passwords, etc., tried both passive and active, and still cannot get through to the server. Here's the error message I'm getting now:
Could not retrieve directory listing
Can't open data connection.
It says that it is connected but each time it tries to retrieve the directory it fails. I know that other people are getting through to this server with WinSCP – what is going wrong for me?
Please HELP!

Reply with quote

Lauri
Guest

Log - I hope this is what you wanted

SYST
215 Windows_NT
FEAT
211-FEAT
    SIZE
    MDTM
211 END
Connected
--------------------------------------------------------------------------
Using FTP protocol.
Doing startup conversation with host.
PWD
257 "/" is current directory.
Getting current directory name.
Retrieving directory listing...
TYPE A
200 Type set to A.
PORT 192,168,1,47,15,209
200 PORT command successful.
LIST -a
150 Opening ASCII mode data connection for /bin/ls.
425 Can't open data connection.
Could not retrieve directory listing
Retrieving directory listing...
TYPE A
200 Type set to A.
PORT 192,168,1,47,15,211
200 PORT command successful.
LIST
150 Opening ASCII mode data connection for /bin/ls.
425 Can't open data connection.
Could not retrieve directory listing
(ECommand) Error listing directory '/'.
Could not retrieve directory listing
Can't open data connection.
Startup conversation with host finished.
TYPE A
200 Type set to A.
TYPE A
200 Type set to A.

Reply with quote

Advertisement

martin
Site Admin
martin avatar

Re: Log - I hope this is what you wanted

You haven't posted full log file, so I cannot tell for sure. But from the IP address I suspect this issue is what you are facing.

Reply with quote

Lauri
Guest

How do I get the full log

Please explain to me how to get the full log file. Or explain how I can fix this problem.

Reply with quote

Guest

Re: Log - I hope this is what you wanted

@Lauri: Are you using PASSIVE (PASV) connection? If so, you'll need to configure your client accordingly and ensure the proper PASV ports are open on your firewall if you are accessing your FTP server through one. FTP server admin, if other than you, will know the PASSIVE port range.

Reply with quote

Advertisement

grouver
Guest

Solution

Hi, this is a bit old however the problem is STILL not solved. It has been getting on my nerves for a while and if there were decent free Windows FTP clients I would have given up on WinSCP a long time ago. Anyway, my rants aside, here is a work around that you might find useful. If you notice, the error message usually suggests that you try passive mode due to inability to open some port. Now there might be any reasons why a port cannot be opened and WinSCP cannot really change that. Nonetheless the software should be able to automatically switch to a passive connection which it currently most definitely does not do.

You have to tick the passive connection box. The way you do this is tick the Advanced options box. Then under Connection tick the passive one. I also selected IPv4 as the internet protocol (might not work in your case) and under Environment > FTP ticked the Force IP ... option. I'd suggest you save all that as a session and reuse the setting next time. If you are editing a saved session make sure that you save.

Hope this helps!

Reply with quote

lmstearn
Guest

Timeout

Had a problem with this for years.
Forgive my "layman's" jargon.
Previous dialogues with site Admin & Tech personnel tried to locate a "problem" with my modem. That ceased when exactly the same "problem" arose with a different ADSL2 modem.
Was a problem then with my broadband connection, which used a shared, not dedicated, address at the exchange.
However, the problem was *only* with remote servers run on Microsoft Windows and was dated to a server upgrade ~3.5 years ago.
Other remote servers e.g. Unix didn't care
Once I changed providers, the problem disappeared altogether.
Until now.
It seems to be a connection speed? issue. I have blown my 2 gigabyte allocation and the transfer speed slows to around 7 kbs.
Logging on to the remote Microsoft Windows FTP server I got no timeout message but:
Could not retrieve directory listing -Can't open data connection
I deselected passive mode and removed permanent caching and, bingo, got in.
Hope this helps,
Laurie

Reply with quote

Guest

For the Progs.

Re above, deselecting passive mode,
"Auto" is greyed out, but neither IPv4 nor IPv6 are selected.
What's the story there?
Cheers
Laurie

Reply with quote

Advertisement

Hari
Guest

Re: For the Progs.

I am getting this error "Can't open data connection". please find the log file below
. 2011-07-13 12:45:13.218 --------------------------------------------------------------------------
. 2011-07-13 12:45:13.218 WinSCP Version 4.3.3 (Build 1340) (OS 5.1.2600 Service Pack 3)
. 2011-07-13 12:45:13.218 Configuration: HKEY_CURRENT_USER\Software\Martin Prikryl\WinSCP 2\
. 2011-07-13 12:45:13.218 Login time: Wednesday, July 13, 2011 12:45:13 PM
. 2011-07-13 12:45:13.218 --------------------------------------------------------------------------
. 2011-07-13 12:45:13.218 Session name: CambridgeAssessment@ftps.vizual.co.uk (Ad-Hoc session)
. 2011-07-13 12:45:13.218 Host name: ftps.vizual.co.uk (Port: 990)
. 2011-07-13 12:45:13.218 User name: CambridgeAssessment (Password: Yes, Key file: No)
. 2011-07-13 12:45:13.218 Tunnel: No
. 2011-07-13 12:45:13.218 Transfer Protocol: FTP
. 2011-07-13 12:45:13.218 Ping type: C, Ping interval: 30 sec; Timeout: 15 sec
. 2011-07-13 12:45:13.218 Proxy: none
. 2011-07-13 12:45:13.218 FTP: FTPS: Implicit SSL/TLS; Passive: Yes [Force IP: No]
. 2011-07-13 12:45:13.218 Local directory: default, Remote directory: home, Update: No, Cache: Yes
. 2011-07-13 12:45:13.218 Cache directory changes: Yes, Permanent: Yes
. 2011-07-13 12:45:13.218 DST mode: 1
. 2011-07-13 12:45:13.218 --------------------------------------------------------------------------
. 2011-07-13 12:45:13.890 Connecting to ftps.vizual.co.uk:990 ...
. 2011-07-13 12:45:14.031 Connected with ftps.vizual.co.uk:990, negotiating SSL connection...
. 2011-07-13 12:45:14.406 SSL connection established. Waiting for welcome message...
< 2011-07-13 12:45:14.406 220 WELCOME TO FTPS.VIZUAL.CO.UK Vizual Business Tools Secure FTP Site ========
> 2011-07-13 12:45:14.406 USER CambridgeAssessment
< 2011-07-13 12:45:14.593 331 Password required for cambridgeassessment
> 2011-07-13 12:45:14.593 PASS **************************
< 2011-07-13 12:45:14.765 230 Logged on
> 2011-07-13 12:45:14.765 SYST
< 2011-07-13 12:45:14.937 215 UNIX emulated by FileZilla
> 2011-07-13 12:45:14.937 FEAT
< 2011-07-13 12:45:15.125 211-Features:
< 2011-07-13 12:45:15.125  MDTM
< 2011-07-13 12:45:15.125  REST STREAM
< 2011-07-13 12:45:15.125  SIZE
< 2011-07-13 12:45:15.125  MLST type*;size*;modify*;
< 2011-07-13 12:45:15.125  MLSD
< 2011-07-13 12:45:15.125  AUTH SSL
< 2011-07-13 12:45:15.125  AUTH TLS
< 2011-07-13 12:45:15.125  PROT
< 2011-07-13 12:45:15.125  PBSZ
< 2011-07-13 12:45:15.125  UTF8
< 2011-07-13 12:45:15.125  CLNT
< 2011-07-13 12:45:15.125  MFMT
< 2011-07-13 12:45:15.140 211 End
> 2011-07-13 12:45:15.140 PBSZ 0
< 2011-07-13 12:45:15.312 200 PBSZ=0
> 2011-07-13 12:45:15.312 PROT P
< 2011-07-13 12:45:15.484 200 Protection level set to P
. 2011-07-13 12:45:15.484 Connected
. 2011-07-13 12:45:15.484 --------------------------------------------------------------------------
. 2011-07-13 12:45:15.500 Using FTP protocol.
. 2011-07-13 12:45:15.500 Doing startup conversation with host.
> 2011-07-13 12:45:15.515 PWD
< 2011-07-13 12:45:15.687 257 "/" is current directory.
. 2011-07-13 12:45:15.687 Getting current directory name.
. 2011-07-13 12:45:15.703 Retrieving directory listing...
> 2011-07-13 12:45:15.703 TYPE A
< 2011-07-13 12:45:15.875 200 Type set to A
> 2011-07-13 12:45:15.890 PASV
< 2011-07-13 12:45:16.078 227 Entering Passive Mode (172,16,18,6,195,83)
> 2011-07-13 12:45:16.078 LIST -a
< 2011-07-13 12:45:26.609 425 Can't open data connection.
. 2011-07-13 12:45:26.609 Could not retrieve directory listing
. 2011-07-13 12:45:26.625 Retrieving directory listing...
> 2011-07-13 12:45:26.625 TYPE A
< 2011-07-13 12:45:26.796 200 Type set to A
> 2011-07-13 12:45:26.796 PASV
< 2011-07-13 12:45:26.984 227 Entering Passive Mode (172,16,18,6,195,84)
> 2011-07-13 12:45:26.984 LIST
< 2011-07-13 12:45:37.609 425 Can't open data connection.
. 2011-07-13 12:45:37.609 Could not retrieve directory listing
* 2011-07-13 12:45:37.609 (ECommand) Error listing directory '/'.
* 2011-07-13 12:45:37.609 Could not retrieve directory listing
* 2011-07-13 12:45:37.609 Can't open data connection.

Reply with quote

user
Guest

Re: Solution

find the new one
> 2011-07-13 12:45:14.765 SYST
< 2011-07-13 12:45:14.937 215 UNIX emulated by FileZilla
> 2011-07-13 12:45:14.937 FEAT
< 2011-07-13 12:45:15.125 211-Features:
< 2011-07-13 12:45:15.125  MDTM
< 2011-07-13 12:45:15.125  REST STREAM
< 2011-07-13 12:45:15.125  SIZE
< 2011-07-13 12:45:15.125  MLST type*;size*;modify*;
< 2011-07-13 12:45:15.125  MLSD
< 2011-07-13 12:45:15.125  AUTH SSL
< 2011-07-13 12:45:15.125  AUTH TLS
< 2011-07-13 12:45:15.125  PROT
< 2011-07-13 12:45:15.125  PBSZ
< 2011-07-13 12:45:15.125  UTF8
< 2011-07-13 12:45:15.125  CLNT
< 2011-07-13 12:45:15.125  MFMT
< 2011-07-13 12:45:15.140 211 End
> 2011-07-13 12:45:15.140 PBSZ 0
< 2011-07-13 12:45:15.312 200 PBSZ=0
> 2011-07-13 12:45:15.312 PROT P
< 2011-07-13 12:45:15.484 200 Protection level set to P
. 2011-07-13 12:45:15.484 Connected
. 2011-07-13 12:45:15.484 --------------------------------------------------------------------------
. 2011-07-13 12:45:15.500 Using FTP protocol.
. 2011-07-13 12:45:15.500 Doing startup conversation with host.
> 2011-07-13 12:45:15.515 PWD
< 2011-07-13 12:45:15.687 257 "/" is current directory.
. 2011-07-13 12:45:15.687 Getting current directory name.
. 2011-07-13 12:45:15.703 Retrieving directory listing...
> 2011-07-13 12:45:15.703 TYPE A
< 2011-07-13 12:45:15.875 200 Type set to A
> 2011-07-13 12:45:15.890 PASV
< 2011-07-13 12:45:16.078 227 Entering Passive Mode (172,16,18,6,195,83)
> 2011-07-13 12:45:16.078 LIST -a
< 2011-07-13 12:45:26.609 425 Can't open data connection.
. 2011-07-13 12:45:26.609 Could not retrieve directory listing
. 2011-07-13 12:45:26.625 Retrieving directory listing...
> 2011-07-13 12:45:26.625 TYPE A
< 2011-07-13 12:45:26.796 200 Type set to A
> 2011-07-13 12:45:26.796 PASV
< 2011-07-13 12:45:26.984 227 Entering Passive Mode (172,16,18,6,195,84)
> 2011-07-13 12:45:26.984 LIST
< 2011-07-13 12:45:37.609 425 Can't open data connection.
. 2011-07-13 12:45:37.609 Could not retrieve directory listing
* 2011-07-13 12:45:37.609 (ECommand) Error listing directory '/'.
* 2011-07-13 12:45:37.609 Could not retrieve directory listing
* 2011-07-13 12:45:37.609 Can't open data connection. 

Reply with quote

Advertisement

Daniel D
Guest

Passive Mode

Try disabling passive mode. Probably not all FTP passive ports are not opened.

For example these all ports must be allowed to use passive mode.
Response:             227 Entering Passive Mode (202,234,195,227,219,190).

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,541
Location:
Prague, Czechia

Re: Passive Mode

Daniel D wrote:

For example these all ports must be allowed to use passive mode.
Response:             227 Entering Passive Mode (202,234,195,227,219,190).
This is bit confusing. The numbers in the 227 response are not port numbers! Only the 219 and 190 represent a port number 56254 (219 * 256 + 190). The 202,234,195,227 is an IP address. So there's only one port number in the message.

Reply with quote

Advertisement

Fizzy
Joined:
Posts:
1
Location:
Srilanka

FTP connection and folder listing

Hi,

I am facing this same issue am assuming if it's because the data channel ports 5000-5005 which i have updated the firewall settings which aren't open, It connects to the FTP successfully but does not list the folders under the FTP drive created.
Timeout detected. (data connection)
Could not retrieve directory listing
Error listing directory '/'.
Appreciate your input in this regard.

Thanks,
Fazil

Reply with quote E-mail

martin
Site Admin
martin avatar

Re: FTP connection and folder listing

@Fizzy: Sorry, I do not understand. Can you try to describe your problem again?
Also, can you retrieve the listing using any other FTP client?

Reply with quote

anotherusername
Joined:
Posts:
1
Location:
Earth

My Solution!

After messing around for ages and reading all the useless advice – this is what fixed it for me.
I am using Plesk FTP server with WinSCP connecting on port 21 Passive.
So in Sire settings – Go Advanced > Then FTP under Environment.
Change the following commands that used to be set to AUTO
Use MLSD command - On
Force IP for passive - On
Use HOST command - On


Boom then everything worked.

Reply with quote

fometeo
Joined:
Posts:
3
Location:
Portugal

425 or MSLD are not the problem

On a recent case the problem was not the lack of FTP server support for MSLD as log seemed to show cause the connection was lost just after MSLD trying to get the dir listed. The Linux vsftpd server was good:
at file /etc/vsftpd/vsftpd.conf it had both active and passive services OK
connect_from_port_20=YES
pasv_enable=YES
The issue did not happen all the times, sometimes the connection was established (!)

This was a CentOS 7 policy (SELinux) issue solved by
setsebool -P ftpd_connect_all_unreserved 1
or just disabling SElinux

By the way old Windows up to version 8 had ftp.exe supporting only active FTP.

Reply with quote

Advertisement

sarawgeek
Guest

For me it was a VPN issue, server was blocking the IP so it was not allowing the directory listing, just check if you something similar kind of setup.
I was trying to connect from USA and server was in India, so may that is why it was blocking for security purpose.

Reply with quote

Johann
Guest

@anotherusername solution finally worked.

Well the solution by @anotherusername of changing Auto to On worked but, What about other users who want to try to login through FTP and don't know of this? How can I solve this issue where it isn't relying on the client making changes on their side? I have another server similar to this one as they're made from the same custom AMI but for some reason only this one has this FTP login issue.

Reply with quote

martin
Site Admin
martin avatar

Re: @anotherusername solution finally worked.

@Johann: Please post session log files both with the default settings (not working) and your custom settings (working).

Reply with quote

Advertisement

Johann
Guest

Found the issue and the solution for it.

I figured out how to make sure proper passive IP should be passed so you don't have to go and change settings in Environment to "ON".

I inherited this server from someone who used to work here. Didn't know what the FTP setup was.

Anyway, here's the solution, I'm running PureFTPd please find something similar for your FTP service.
sudo echo "40110 40210" > /etc/pure-ftpd/conf/PassivePortRange
Restart pure-ftpd
sudo service pure-ftpd-mysql restart
If you are using AWS like me, you need to run
sudo echo "YOUR_EXTERNAL_IP_ADDR" > /etc/pure-ftpd/conf/ForcePassiveIP
sudo service pure-ftpd-mysql restart
@martin. Thanks for your time and help. Really grateful.

Reply with quote

Unknown_Techy
Guest

Need FTPS assistance

< 2023-07-27 13:54:56.295 257 "/Vendor/Soarian/ININD" is current directory
. 2023-07-27 13:54:56.295 Changing directory to "/Vendor/Soarian/ININD".
> 2023-07-27 13:54:56.295 CWD /Vendor/Soarian/ININD
< 2023-07-27 13:54:56.326 250 CWD command successful
. 2023-07-27 13:54:56.326 Getting current directory name.
> 2023-07-27 13:54:56.326 PWD
< 2023-07-27 13:54:56.373 257 "/Vendor/Soarian/ININD" is current directory
. 2023-07-27 13:54:56.373 Startup conversation with host finished.
. 2023-07-27 13:54:56.451 Retrieving directory listing...
> 2023-07-27 13:54:56.451 TYPE A
< 2023-07-27 13:54:56.498 200 TYPE command successful
> 2023-07-27 13:54:56.498 PASV
< 2023-07-27 13:54:56.529 227 Entering Passive Mode (10,240,101,27,11,245)
> 2023-07-27 13:54:56.529 LIST
. 2023-07-27 13:54:56.529 Connecting to 10.240.101.27:3061 ...
< 2023-07-27 13:54:56.576 150 Opening ASCII mode data connection
. 2023-07-27 13:55:01.185 Timeout detected. (data connection)
. 2023-07-27 13:55:01.185 Could not retrieve directory listing
* 2023-07-27 13:55:01.232 (EFatal) **Lost connection.**
* 2023-07-27 13:55:01.232 Timeout detected. (data connection)
* 2023-07-27 13:55:01.232 Could not retrieve directory listing
* 2023-07-27 13:55:01.232 Error listing directory '/Vendor/Soarian/ININD'.

Reply with quote

Advertisement

martin
Site Admin
martin avatar

Re: Need FTPS assistance

@Unknown_Techy: What is the 10.240.101.27 IP address? Is the the correct IP address of the FTP server you are connecting to? Can you retrieve the directory listing or transfer files using any other FTP client with the same FTP server? If you can, post its full log file (as well a a full log file of WinSCP).

Reply with quote

Unknown_Techy
Guest

Re: Need FTPS assistance

@martin: 10.240.101.27 is the FTP server. For my use I am only able to use FTPS for what I am setting this connection up for. Also no I am not able to use FTPS with any other FTP client.

Reply with quote

LukeNe
Guest

Forcing IP In Passive Mode

Just wanted to add my 2 cents – forcing the IP in passive mode solved my problem. Can now connect and ignore all of the above issues since the start of this post.

Reply with quote

Advertisement

martin
Site Admin
martin avatar

Re: Forcing IP In Passive Mode

@LukeNe: Thanks for your post. The "Force IP address for passive mode connection" can help only if the IP address in the PASV command response is not correct IP address of the server. What is probably your case, but not in this thread.

Reply with quote

patton
Guest

ftp wont load

Timeout detected. (data connection)
Could not retrieve directory listing
Error listing directory '/'.
I have contacted xfinty and everything nothing works

Reply with quote

slowreader
Joined:
Posts:
12

same here

I am having the identical problem this morning after many years of updating my website at the first of every month.
Timeout detected. (control connection)
Connection failed.
My internet provider was Xfinity (Comcast Business). Last week I switched to Breezeline. Could that have anything to do with today's failures?

Thanks! - Dan

Reply with quote

Advertisement

slowreader

Yes, it worked fine, every month for many years. (Well, a few hiccups along the way.) Breezeline became active on Friday, and this is the first time I've tried to ftp or to reach cPanel since.

Reply with quote

slowreader

Same way I tried to do it last month: loaded up WinSCP, clicked on Log in, and instead of logging in, I got the message "Timeout detected. (control connection) Connection failed." Similarly, I can't access the website by going to cPanel with my web browser Firefox or the backup Chrome. I have no problem looking at my web pages online, and Simply Hosting support says "cpanel url is working fine". But I can't update the website, as I do every month at this time.

Reply with quote

Advertisement

martin
Site Admin
martin avatar

@slowreader and @patton: You should contact your hosting support. Also make sure you are using the correct protocol. Maybe the new hosting uses SFTP (or encrypted FTP), not plain FTP. Can you connect with any other client?

Reply with quote

slowreader
Joined:
Posts:
12

logging in

I have a ticket opened at Simply Hosting, which hasn't changed. I've used them for years. It's my internet provider that has changed (formerly Xfinity aka Comcast Business, now Breezeline fiber optic). The web host says everything is working fine at their end, but WinSCP can't connect, nor can I log in to Simply Hosting's Cpanel using Firefox or Chrome. When I paste the url into the search line of the browser, nothing happens except I see the hourglass figure as the browser tries to find it. I have used both these ways to manage my website several times a month for twenty years or more. Thanks! - Dan

Reply with quote

slowreader
Joined:
Posts:
12

still trying to log in

I just now cleared all my history on Firefox and tried again to log into CPanel. Again the hourglass icon, but finally this message came up. (I am the website owner so I have no one to inform!) Thanks - Dan
Secure Connection Failed

An error occurred during a connection to danford.net:2083. PR_CONNECT_RESET_ERROR

Error code: PR_CONNECT_RESET_ERROR

The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.
Please contact the website owners to inform them of this problem.

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum