Error connecting to FTP server.

Advertisement

Yahowmy
Joined:
Posts:
4

Error connecting to FTP server.

Hello,
We have 14 ftp clients can connect to ftp server using ftp protocol except for two clients,
All clients have same configurations and can connectto the same ftp server except for these two clients they get the following error msg:

"The server cannot open connection in active mode. If you are behind a NAT router, you may need to specify an external IP address. Alternatively, consider switching to passive mode.
Could not retrieve directory listing Can't open data connection for transfer of "/""


- Passive mode off
- Client's Windows Firewall is Off

Thank you in advance for helping.

Reply with quote

Advertisement

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

Re: Error connecting to FTP server.

What does it mean "14 ftp clients"? Are these persons/institutions or machines or what?

Please post a complete session log file from both a client that can and cannot connect.

Why do you even use the active mode?

Reply with quote

Yahowmy
Joined:
Posts:
4

Hello martin,

Clients are Windows Server 2016 machines, and i use active mode because i cannot get passive mode to work.

Here is session log from client that can connect:
. 2018-10-27 08:44:33.858 Connecting to bscoftp.ddns.net ...
. 2018-10-27 08:44:33.934 Connected with bscoftp.ddns.net. Waiting for welcome message...
< 2018-10-27 08:44:33.969 220-FileZilla Server 0.9.60 beta
< 2018-10-27 08:44:33.969 220 Welcome To Binshihon FTP Server
> 2018-10-27 08:44:33.969 USER 5017
< 2018-10-27 08:44:34.216 331 Password required for 5017
> 2018-10-27 08:44:34.216 PASS ********
< 2018-10-27 08:44:34.566 230 Logged on
> 2018-10-27 08:44:34.566 SYST
< 2018-10-27 08:44:34.801 215 UNIX emulated by FileZilla
> 2018-10-27 08:44:34.801 FEAT
< 2018-10-27 08:44:35.056 211-Features:
< 2018-10-27 08:44:35.056 MDTM
< 2018-10-27 08:44:35.056 REST STREAM
< 2018-10-27 08:44:35.056 SIZE
< 2018-10-27 08:44:35.056 MLST type*;size*;modify*;
< 2018-10-27 08:44:35.056 MLSD
< 2018-10-27 08:44:35.056 UTF8
< 2018-10-27 08:44:35.056 CLNT
< 2018-10-27 08:44:35.056 MFMT
< 2018-10-27 08:44:35.056 EPSV
< 2018-10-27 08:44:35.056 EPRT
< 2018-10-27 08:44:35.056 211 End
> 2018-10-27 08:44:35.056 CLNT WinSCP-release-5.13.4
< 2018-10-27 08:44:35.404 200 Don't care
> 2018-10-27 08:44:35.404 OPTS UTF8 ON
< 2018-10-27 08:44:35.680 202 UTF8 mode is always enabled. No need to send this command.
. 2018-10-27 08:44:35.691 Connected
. 2018-10-27 08:44:35.691 --------------------------------------------------------------------------
. 2018-10-27 08:44:35.691 Using FTP protocol.
. 2018-10-27 08:44:35.691 Doing startup conversation with host.
> 2018-10-27 08:44:35.707 PWD
< 2018-10-27 08:44:35.964 257 "/" is current directory.
. 2018-10-27 08:44:35.964 Changing directory to "/".
> 2018-10-27 08:44:35.964 CWD /
< 2018-10-27 08:44:36.305 250 CWD successful. "/" is current directory.
. 2018-10-27 08:44:36.305 Getting current directory name.
> 2018-10-27 08:44:36.305 PWD
< 2018-10-27 08:44:36.549 257 "/" is current directory.
. 2018-10-27 08:44:36.592 Retrieving directory listing...
> 2018-10-27 08:44:36.592 TYPE A
< 2018-10-27 08:44:36.836 200 Type set to A
> 2018-10-27 08:44:36.837 PORT 192,168,1,9,233,151
< 2018-10-27 08:44:37.188 200 Port command successful
> 2018-10-27 08:44:37.188 MLSD
< 2018-10-27 08:44:37.425 150 Opening data channel for directory listing of "/"
< 2018-10-27 08:44:37.712 226 Successfully transferred "/"
. 2018-10-27 08:44:37.713 Data connection closed
. 2018-10-27 08:44:37.713 type=dir;modify=20181014123646; 5002
. 2018-10-27 08:44:37.713 type=dir;modify=20181023065616; 5010
. 2018-10-27 08:44:37.713 type=dir;modify=20181023084221; 5011
. 2018-10-27 08:44:37.713 type=dir;modify=20181023083122; 5012
. 2018-10-27 08:44:37.713 type=dir;modify=20181023062504; 5013
. 2018-10-27 08:44:37.713 type=dir;modify=20181022134710; 5014
. 2018-10-27 08:44:37.713 type=dir;modify=20181022132422; 5015
. 2018-10-27 08:44:37.713 type=dir;modify=20181014120530; 5016
. 2018-10-27 08:44:37.713 type=dir;modify=20181023080840; 5017
. 2018-10-27 08:44:37.713 type=dir;modify=20181022131851; 5018
. 2018-10-27 08:44:37.713 type=dir;modify=20181022133251; 5019
. 2018-10-27 08:44:37.713 type=dir;modify=20181023064907; 5030
. 2018-10-27 08:44:37.713 type=dir;modify=20181022132218; 5031
. 2018-10-27 08:44:37.713 type=dir;modify=20181023061603; 5032
. 2018-10-27 08:44:37.713 type=dir;modify=20181022065511; 5033
. 2018-10-27 08:44:37.713 type=dir;modify=20181022132717; 5034
. 2018-10-27 08:44:37.713 Directory listing successful
. 2018-10-27 08:44:37.714 ..;D;0;1899-12-30T03:00:00.000Z;0;"" [0];"" [0];---------;0
. 2018-10-27 08:44:37.714 5002;D;0;2018-10-14T12:36:46.000Z;3;"" [0];"" [0];---------;0
. 2018-10-27 08:44:37.714 5010;D;0;2018-10-23T06:56:16.000Z;3;"" [0];"" [0];---------;0
. 2018-10-27 08:44:37.714 5011;D;0;2018-10-23T08:42:21.000Z;3;"" [0];"" [0];---------;0
. 2018-10-27 08:44:37.714 5012;D;0;2018-10-23T08:31:22.000Z;3;"" [0];"" [0];---------;0
. 2018-10-27 08:44:37.714 5013;D;0;2018-10-23T06:25:04.000Z;3;"" [0];"" [0];---------;0
. 2018-10-27 08:44:37.714 5014;D;0;2018-10-22T13:47:10.000Z;3;"" [0];"" [0];---------;0
. 2018-10-27 08:44:37.714 5015;D;0;2018-10-22T13:24:22.000Z;3;"" [0];"" [0];---------;0
. 2018-10-27 08:44:37.714 5016;D;0;2018-10-14T12:05:30.000Z;3;"" [0];"" [0];---------;0
. 2018-10-27 08:44:37.714 5017;D;0;2018-10-23T08:08:40.000Z;3;"" [0];"" [0];---------;0
. 2018-10-27 08:44:37.714 5018;D;0;2018-10-22T13:18:51.000Z;3;"" [0];"" [0];---------;0
. 2018-10-27 08:44:37.714 5019;D;0;2018-10-22T13:32:51.000Z;3;"" [0];"" [0];---------;0
. 2018-10-27 08:44:37.714 5030;D;0;2018-10-23T06:49:07.000Z;3;"" [0];"" [0];---------;0
. 2018-10-27 08:44:37.714 5031;D;0;2018-10-22T13:22:18.000Z;3;"" [0];"" [0];---------;0
. 2018-10-27 08:44:37.715 5032;D;0;2018-10-23T06:16:03.000Z;3;"" [0];"" [0];---------;0
. 2018-10-27 08:44:37.715 5033;D;0;2018-10-22T06:55:11.000Z;3;"" [0];"" [0];---------;0
. 2018-10-27 08:44:37.715 5034;D;0;2018-10-22T13:27:17.000Z;3;"" [0];"" [0];---------;0
. 2018-10-27 08:44:37.761 Startup conversation with host finished.
. 2018-10-27 08:45:07.945 Sending dummy command to keep session alive.
> 2018-10-27 08:45:07.945 REST 0

Here is session log from client that cannot connect:
. 2018-10-27 08:55:38.433 --------------------------------------------------------------------------
. 2018-10-27 08:55:38.434 WinSCP Version 5.13.4 (Build 8731) (OS 10.0.14393 - Windows Server 2016 Essentials)
. 2018-10-27 08:55:38.434 Configuration: HKCU\Software\Martin Prikryl\WinSCP 2\
. 2018-10-27 08:55:38.434 Log level: Normal
. 2018-10-27 08:55:38.434 Local account: DATACENTER\Administrator
. 2018-10-27 08:55:38.434 Working directory: C:\Program Files (x86)\WinSCP
. 2018-10-27 08:55:38.434 Process ID: 5532
. 2018-10-27 08:55:38.435 Command-line: "C:\Program Files (x86)\WinSCP\WinSCP.exe"
. 2018-10-27 08:55:38.435 Time zone: Current: GMT+3 (Arab Standard Time), No DST
. 2018-10-27 08:55:38.435 Login time: Saturday, October 27, 2018 8:55:38 AM
. 2018-10-27 08:55:38.436 --------------------------------------------------------------------------
. 2018-10-27 08:55:38.436 Session name: BSCoFTP (Site)
. 2018-10-27 08:55:38.436 Host name: bscoftp.ddns.net (Port: 21)
. 2018-10-27 08:55:38.436 User name: 5002 (Password: Yes, Key file: No, Passphrase: No)
. 2018-10-27 08:55:38.436 Transfer Protocol: FTP
. 2018-10-27 08:55:38.436 Ping type: Dummy, Ping interval: 30 sec; Timeout: 15 sec
. 2018-10-27 08:55:38.436 Disable Nagle: No
. 2018-10-27 08:55:38.436 Proxy: None
. 2018-10-27 08:55:38.436 Send buffer: 262144
. 2018-10-27 08:55:38.436 UTF: Auto
. 2018-10-27 08:55:38.436 FTPS: None [Client certificate: No]
. 2018-10-27 08:55:38.436 FTP: Passive: No [Force IP: Auto]; MLSD: Auto [List all: Auto]; HOST: Auto
. 2018-10-27 08:55:38.436 Local directory: C:\Users\Administrator\Documents, Remote directory: /, Update: Yes, Cache: Yes
. 2018-10-27 08:55:38.436 Cache directory changes: Yes, Permanent: Yes
. 2018-10-27 08:55:38.436 Recycle bin: Delete to: No, Overwritten to: No, Bin path:
. 2018-10-27 08:55:38.436 Timezone offset: 0h 0m
. 2018-10-27 08:55:38.436 --------------------------------------------------------------------------
. 2018-10-27 08:55:38.467 Connecting to bscoftp.ddns.net ...
. 2018-10-27 08:55:38.935 Connected with bscoftp.ddns.net. Waiting for welcome message...
< 2018-10-27 08:55:39.255 220-FileZilla Server 0.9.60 beta
< 2018-10-27 08:55:39.255 220 Welcome To Binshihon FTP Server
> 2018-10-27 08:55:39.255 USER 5002
< 2018-10-27 08:55:39.455 331 Password required for 5002
> 2018-10-27 08:55:39.455 PASS ********
< 2018-10-27 08:55:39.465 230 Logged on
> 2018-10-27 08:55:39.465 SYST
< 2018-10-27 08:55:39.475 215 UNIX emulated by FileZilla
> 2018-10-27 08:55:39.475 FEAT
< 2018-10-27 08:55:39.489 211-Features:
< 2018-10-27 08:55:39.489 MDTM
< 2018-10-27 08:55:39.489 REST STREAM
< 2018-10-27 08:55:39.489 SIZE
< 2018-10-27 08:55:39.489 MLST type*;size*;modify*;
< 2018-10-27 08:55:39.489 MLSD
< 2018-10-27 08:55:39.489 UTF8
< 2018-10-27 08:55:39.489 CLNT
< 2018-10-27 08:55:39.489 MFMT
< 2018-10-27 08:55:39.489 EPSV
< 2018-10-27 08:55:39.489 EPRT
< 2018-10-27 08:55:39.490 211 End
> 2018-10-27 08:55:39.501 CLNT WinSCP-release-5.13.4
< 2018-10-27 08:55:39.610 200 Don't care
> 2018-10-27 08:55:39.610 OPTS UTF8 ON
< 2018-10-27 08:55:39.816 202 UTF8 mode is always enabled. No need to send this command.
. 2018-10-27 08:55:39.833 Connected
. 2018-10-27 08:55:39.833 --------------------------------------------------------------------------
. 2018-10-27 08:55:39.833 Using FTP protocol.
. 2018-10-27 08:55:39.833 Doing startup conversation with host.
> 2018-10-27 08:55:39.846 PWD
< 2018-10-27 08:55:40.154 257 "/" is current directory.
. 2018-10-27 08:55:40.154 Changing directory to "/".
> 2018-10-27 08:55:40.154 CWD /
< 2018-10-27 08:55:40.353 250 CWD successful. "/" is current directory.
. 2018-10-27 08:55:40.354 Getting current directory name.
> 2018-10-27 08:55:40.354 PWD
< 2018-10-27 08:55:40.363 257 "/" is current directory.
. 2018-10-27 08:55:40.421 Retrieving directory listing...
> 2018-10-27 08:55:40.421 TYPE A
< 2018-10-27 08:55:40.647 200 Type set to A
> 2018-10-27 08:55:40.653 PORT 192,168,100,16,194,133
< 2018-10-27 08:55:41.043 200 Port command successful
> 2018-10-27 08:55:41.043 MLSD
< 2018-10-27 08:55:41.237 150 Opening data channel for directory listing of "/"
< 2018-10-27 08:55:51.771 425 Can't open data connection for transfer of "/"
. 2018-10-27 08:55:51.771 Could not retrieve directory listing
* 2018-10-27 08:55:51.811 (ECommand) Error listing directory '/'.
* 2018-10-27 08:55:51.811 The server cannot open connection in active mode. If you are behind a NAT router, you may need to specify an external IP address. Alternatively, consider switching to passive mode.
* 2018-10-27 08:55:51.811 Could not retrieve directory listing
* 2018-10-27 08:55:51.811 Can't open data connection for transfer of "/"
. 2018-10-27 08:55:54.017 Startup conversation with host finished.
. 2018-10-27 08:56:11.442 Sending dummy command to keep session alive.
> 2018-10-27 08:56:11.442 PWD
< 2018-10-27 08:56:11.943 257 "/" is current directory.
. 2018-10-27 08:56:41.443 Sending dummy command to keep session alive.
> 2018-10-27 08:56:41.443 PWD
< 2018-10-27 08:56:41.942 257 "/" is current directory.
. 2018-10-27 08:57:11.455 Sending dummy command to keep session alive.
> 2018-10-27 08:57:11.455 PWD
< 2018-10-27 08:57:11.961 257 "/" is current directory.
. 2018-10-27 08:57:38.458 Dummy directory read to keep session alive.
. 2018-10-27 08:57:38.458 Retrieving directory listing...
> 2018-10-27 08:57:38.458 TYPE A
< 2018-10-27 08:57:38.624 200 Type set to A
> 2018-10-27 08:57:38.630 PORT 192,168,100,16,194,140
< 2018-10-27 08:57:38.638 200 Port command successful
> 2018-10-27 08:57:38.638 MLSD
< 2018-10-27 08:57:38.658 150 Opening data channel for directory listing of "/"
< 2018-10-27 08:57:49.344 425 Can't open data connection for transfer of "/"
. 2018-10-27 08:57:49.344 Could not retrieve directory listing
. 2018-10-27 08:58:08.458 Sending dummy command to keep session alive.
> 2018-10-27 08:58:08.458 PWD
< 2018-10-27 08:58:08.959 257 "/" is current directory.
. 2018-10-27 08:58:38.490 Sending dummy command to keep session alive.
> 2018-10-27 08:58:38.490 TYPE I
< 2018-10-27 08:58:38.994 200 Type set to I

Big thanks for helping.

Reply with quote

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

Yahowmy wrote:

Clients are Windows Server 2016 machines, and i use active mode because i cannot get passive mode to work.
Well, you cannot make the active mode to work either. And it's easier to fix the passive mode usually. And the passive mode has the advantage, that usually only the server that needs a proper configuration. All clients will usually work without any additional setup. While with the active mode, problems tend to be on a client side. So I believe that you are wasting your time with the active mode.
In any case, it looks like the server cannot connect back to the client to open a data connection. I'd suspect a local firewall or network NAT (even though you claim the firewall to be turned off).
See also https://winscp.net/eng/docs/ftp_modes

Reply with quote

Advertisement

You can post new topics in this forum