Topic "Proxy request failed, can't connect through proxy server"

Author Message
keviejay
[View user's profile]

Joined: 2016-04-15
Posts: 3
The ftp client is able to see the file and connect to the server, but the handshake is failing. I am able to use the GUI client to access the same file with no issues. If I do not use the proxy in my code, the transfer fails on a timeout.

< 2016-04-14 16:45:02.621 Script: Connecting to ftp2.nyxdata.com ...
. 2016-04-14 16:45:02.622 Connecting to ftp2.nyxdata.com ...
< 2016-04-14 16:45:02.673 Script: Connection with proxy established, performing handshake...
. 2016-04-14 16:45:02.740 Connection with proxy established, performing handshake...
. 2016-04-14 16:45:02.752 Connected with ftp2.nyxdata.com. Waiting for welcome message...
< 2016-04-14 16:45:02.813 220 ftpnj.nyxdata.com
> 2016-04-14 16:45:02.813 USER XXXXX
< 2016-04-14 16:45:02.886 331 Password required for XXXXX
> 2016-04-14 16:45:02.886 PASS **********
< 2016-04-14 16:45:03.534 230 User XXXXX logged in
> 2016-04-14 16:45:03.535 SYST
< 2016-04-14 16:45:03.610 215 UNIX Type: L8
> 2016-04-14 16:45:03.610 FEAT
< 2016-04-14 16:45:03.685 211-Features:
< 2016-04-14 16:45:03.685 MDTM
< 2016-04-14 16:45:03.685 MFMT
< 2016-04-14 16:45:03.685 TVFS
< 2016-04-14 16:45:03.685 MFF modify;UNIX.group;UNIX.mode;
< 2016-04-14 16:45:03.685 MLST modify*;perm*;size*;type*;unique*;UNIX.group*;UNIX.mode*;UNIX.owner*;
< 2016-04-14 16:45:03.685 REST STREAM
< 2016-04-14 16:45:03.685 SIZE
< 2016-04-14 16:45:03.686 211 End
< 2016-04-14 16:45:03.686 Script: Connected
. 2016-04-14 16:45:03.686 Connected
. 2016-04-14 16:45:03.686 Doing startup conversation with host.
< 2016-04-14 16:45:03.686 Script: Starting the session...
> 2016-04-14 16:45:03.686 PWD
< 2016-04-14 16:45:03.776 257 "/" is the current directory
. 2016-04-14 16:45:03.776 Changing directory to "/".
> 2016-04-14 16:45:03.776 CWD /
< 2016-04-14 16:45:03.851 250 CWD command successful
. 2016-04-14 16:45:03.851 Getting current directory name.
> 2016-04-14 16:45:03.852 PWD
< 2016-04-14 16:45:03.926 257 "/" is the current directory
. 2016-04-14 16:45:03.926 Startup conversation with host finished.
< 2016-04-14 16:45:03.926 Script: Session started.
. 2016-04-14 16:45:03.927 File: '/XXXXXXXXXXXXXXX/BIOSC.txt' [2016-04-01T22:21:24.000Z] [28254]
. 2016-04-14 16:45:03.927 Copying "/XXXXXXXXXXXXXXX/BIOSC.txt" to local directory started.
. 2016-04-14 16:45:03.927 Binary transfer mode selected.
. 2016-04-14 16:45:03.928 Starting download of /XXXXXXXXXXXXXXX/BIOSC.txt
> 2016-04-14 16:45:03.928 CWD /XXXXXXXXXXXXXXX/
< 2016-04-14 16:45:04.849 250 CWD command successful
> 2016-04-14 16:45:04.849 PWD
< 2016-04-14 16:45:04.924 257 "/XXXXXXXXXXXXXXX/" is the current directory
> 2016-04-14 16:45:04.925 TYPE A
< 2016-04-14 16:45:05.000 200 Type set to A
> 2016-04-14 16:45:05.000 PASV
< 2016-04-14 16:45:05.074 227 Entering Passive Mode (216,206,127,27,110,159).
. 2016-04-14 16:45:05.074 FtpControlSocket.cpp(6604): Error retrieving server address, cannot test if address is routable caller=0x01073de8
> 2016-04-14 16:45:05.075 MLSD
. 2016-04-14 16:45:05.156 Connection with proxy established, performing handshake...
. 2016-04-14 16:45:08.098 Proxy request failed, can't connect through proxy server
. 2016-04-14 16:45:08.098 Transfer channel can't be opened. Reason: An established connection was aborted by the software in your host machine.
Advertisements
martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 27059
Location: Prague, Czechia
Please attach a full log file both from GUI and code (using the latest version of WinSCP).
keviejay
[View user's profile]

Joined: 2016-04-15
Posts: 3
I have attached the 2 logs. Thank you.
NETLog.txt (7.5 KB) [Download]

Description: Log for .NET

GUILog.txt (98.57 KB) [Download]

Description: Log for the GUI

martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 27059
Location: Prague, Czechia
In the GUI, you have Force IP address for passive mode connections enabled.
https://winscp.net/eng/docs/ui_login_ftp

To enable it in the GUI, use:

SessionOptions.AddRawSettings("FtpForcePasvIp2", "0");

See https://winscp.net/eng/docs/rawsettings
keviejay
[View user's profile]

Joined: 2016-04-15
Posts: 3
Thank you. I had some white space after the property name.
dodin

Guest


Hello,

getting really lost here :/

I am trying to connect from windows server to remote FTP server behind NAT(using proxy) and download files.

Getting error like:

< 2017-03-07 22:45:45.349 226 Transfer ok.
. 2017-03-07 22:45:45.349 Directory listing successful
. 2017-03-07 22:45:45.349 Got reply 1 to the command 2
. 2017-03-07 22:45:45.349 File: "/2017-03-07/FIMT0307.zip"
. 2017-03-07 22:45:45.365 Copying "/2017-03-07/FIMT0307.zip" to local directory started.
. 2017-03-07 22:45:45.365 Binary transfer mode selected.
. 2017-03-07 22:45:45.365 Starting download of /2017-03-07/FIMT0307.zip
> 2017-03-07 22:45:45.365 TYPE I
< 2017-03-07 22:45:45.458 200 Type set to I.
> 2017-03-07 22:45:45.458 PASV
< 2017-03-07 22:45:45.614 227 Entering Passive Mode (195,53,156,45,38,26)
> 2017-03-07 22:45:45.630 RETR FIMT0307.zip
. 2017-03-07 22:45:45.630 m_pProxyLayer changed state from 0 to 1
. 2017-03-07 22:45:45.630 m_pProxyLayer changed state from 1 to 2
. 2017-03-07 22:45:45.630 m_pProxyLayer changed state from 2 to 4
. 2017-03-07 22:45:45.630 Proxy request failed, can't connect through proxy server
. 2017-03-07 22:45:45.630 m_pProxyLayer changed state from 4 to 6
. 2017-03-07 22:45:45.630 Transfer channel can't be opened. Reason: An established connection was aborted by the software in your host machine.
. 2017-03-07 22:45:45.630 Copying files from remote side failed.
. 2017-03-07 22:45:45.630 Got reply 4 to the command 4
* 2017-03-07 22:45:45.630 (ExtException) Proxy request failed, can't connect through proxy server
* 2017-03-07 22:45:45.630 Transfer channel can't be opened. Reason: An established connection was aborted by the software in your host machine.
* 2017-03-07 22:45:45.630 Copying files from remote side failed.
* 2017-03-07 22:45:45.630 Entering Passive Mode (195,53,156,45,38,26)
. 2017-03-07 22:45:45.630 Asking user:
. 2017-03-07 22:45:45.630 Error transferring file '/2017-03-07/FIMT0307.zip'. ("Proxy request failed, can't connect through proxy server","Transfer channel can't be opened. Reason: An established connection was aborted by the software in your host machine.","Copying files from remote side failed.","Entering Passive Mode (195,53,156,45,38,26)")
* 2017-03-07 22:45:45.630 (EScpSkipFile) Error transferring file '/2017-03-07/FIMT0307.zip'.
* 2017-03-07 22:45:45.630 Proxy request failed, can't connect through proxy server
* 2017-03-07 22:45:45.630 Transfer channel can't be opened. Reason: An established connection was aborted by the software in your host machine.
* 2017-03-07 22:45:45.630 Copying files from remote side failed.


Using GUI sometimes I cannot connect or I can connect for a while(sometimes also list few directories) but then error message comes:
Proxy request failed, can't connect through proxy server
Transfer channel can't be opened. Reason: An established connection was aborted by the software in your host machine.
Could not retrieve directory listing
Entering Passive Mode (195,53,156,45,38,155)

I have done investigation also with network team and they say ports are open correctly and that the issue is not with network. As usual Smile They say that it seems connection is ended from FTP server side. I cannot talk to anyone from FTP server side unfortunately...

...any ideas what else could be the cause? I will be happy to hear...
dodin

Guest


running the job every 5 minutes and I was able to see little bit better output. 3 files were copied successfully, 2 failed. So connection works but getting cut after short amount of time:

. 2017-03-07 23:50:44.081 Directory listing successful
. 2017-03-07 23:50:44.081 Got reply 1 to the command 2
. 2017-03-07 23:50:44.081 File: "/2017-03-07/FIMT0307.zip"
. 2017-03-07 23:50:44.081 Copying "/2017-03-07/FIMT0307.zip" to local directory started.
. 2017-03-07 23:50:44.081 Binary transfer mode selected.
. 2017-03-07 23:50:44.081 Starting download of /2017-03-07/FIMT0307.zip
> 2017-03-07 23:50:44.081 TYPE I
< 2017-03-07 23:50:44.127 200 Type set to I.
> 2017-03-07 23:50:44.127 PASV
< 2017-03-07 23:50:44.237 227 Entering Passive Mode (88,84,92,45,38,35)
> 2017-03-07 23:50:44.237 RETR FIMT0307.zip
. 2017-03-07 23:50:44.237 m_pProxyLayer changed state from 0 to 1
. 2017-03-07 23:50:44.237 m_pProxyLayer changed state from 1 to 2
. 2017-03-07 23:50:44.237 m_pProxyLayer changed state from 2 to 4
< 2017-03-07 23:50:44.361 150 Data connection accepted from 129.35.231.3:51760; transfer starting for /2017-03-07/FIMT0307.zip (63211 bytes)
. 2017-03-07 23:50:44.361 m_pSslLayer changed state from 0 to 4
. 2017-03-07 23:50:44.502 SSL connection established
< 2017-03-07 23:50:44.752 226 File sent ok.
. 2017-03-07 23:50:44.752 Download successful
. 2017-03-07 23:50:44.752 Got reply 1 to the command 4
. 2017-03-07 23:50:44.752 Session upkeep
. 2017-03-07 23:50:44.752 Listing file "FIIT0307.zip".
. 2017-03-07 23:50:44.752 File: "/2017-03-07/FIIT0307.zip"
. 2017-03-07 23:50:44.752 Copying "/2017-03-07/FIIT0307.zip" to local directory started.
. 2017-03-07 23:50:44.752 Binary transfer mode selected.
. 2017-03-07 23:50:44.752 Starting download of /2017-03-07/FIIT0307.zip
> 2017-03-07 23:50:44.752 TYPE I
< 2017-03-07 23:50:44.798 200 Type set to I.
> 2017-03-07 23:50:44.798 PASV
< 2017-03-07 23:50:44.908 227 Entering Passive Mode (88,84,92,45,37,69)
> 2017-03-07 23:50:44.908 RETR FIIT0307.zip
. 2017-03-07 23:50:44.908 m_pProxyLayer changed state from 0 to 1
. 2017-03-07 23:50:44.908 m_pProxyLayer changed state from 1 to 2
. 2017-03-07 23:50:44.908 m_pProxyLayer changed state from 2 to 4
< 2017-03-07 23:50:45.001 150 Data connection accepted from 129.35.231.3:51761; transfer starting for /2017-03-07/FIIT0307.zip (511 bytes)
. 2017-03-07 23:50:45.001 m_pSslLayer changed state from 0 to 4
. 2017-03-07 23:50:45.110 SSL connection established
. 2017-03-07 23:50:45.110 m_pSslLayer changed state from 4 to 5
< 2017-03-07 23:50:45.157 226 File sent ok.
. 2017-03-07 23:50:45.157 Download successful
. 2017-03-07 23:50:45.157 Got reply 1 to the command 4
. 2017-03-07 23:50:45.173 Session upkeep
. 2017-03-07 23:50:45.173 Listing file "SIIT0307.zip".
. 2017-03-07 23:50:45.173 File: "/2017-03-07/SIIT0307.zip"
. 2017-03-07 23:50:45.173 Copying "/2017-03-07/SIIT0307.zip" to local directory started.
. 2017-03-07 23:50:45.173 Binary transfer mode selected.
. 2017-03-07 23:50:45.173 Starting download of /2017-03-07/SIIT0307.zip
> 2017-03-07 23:50:45.173 TYPE I
< 2017-03-07 23:50:45.204 200 Type set to I.
> 2017-03-07 23:50:45.204 PASV
< 2017-03-07 23:50:45.344 227 Entering Passive Mode (88,84,92,45,38,241)
> 2017-03-07 23:50:45.344 RETR SIIT0307.zip
. 2017-03-07 23:50:45.344 m_pProxyLayer changed state from 0 to 1
. 2017-03-07 23:50:45.344 m_pProxyLayer changed state from 1 to 2
. 2017-03-07 23:50:45.344 m_pProxyLayer changed state from 2 to 4
< 2017-03-07 23:50:45.516 150 Data connection accepted from 129.35.231.3:51763; transfer starting for /2017-03-07/SIIT0307.zip (614 bytes)
. 2017-03-07 23:50:45.516 m_pSslLayer changed state from 0 to 4
. 2017-03-07 23:50:45.625 SSL connection established
. 2017-03-07 23:50:45.625 m_pSslLayer changed state from 4 to 5
< 2017-03-07 23:50:45.672 226 File sent ok.
. 2017-03-07 23:50:45.672 Download successful
. 2017-03-07 23:50:45.672 Got reply 1 to the command 4
. 2017-03-07 23:50:45.672 Session upkeep
. 2017-03-07 23:50:45.672 Listing file "SIMT0307.zip".
. 2017-03-07 23:50:45.672 File: "/2017-03-07/SIMT0307.zip"
. 2017-03-07 23:50:45.672 Copying "/2017-03-07/SIMT0307.zip" to local directory started.
. 2017-03-07 23:50:45.672 Binary transfer mode selected.
. 2017-03-07 23:50:45.672 Starting download of /2017-03-07/SIMT0307.zip
> 2017-03-07 23:50:45.672 TYPE I
< 2017-03-07 23:50:45.719 200 Type set to I.
> 2017-03-07 23:50:45.719 PASV
< 2017-03-07 23:50:45.828 227 Entering Passive Mode (88,84,92,45,37,34)
> 2017-03-07 23:50:45.828 RETR SIMT0307.zip
. 2017-03-07 23:50:45.828 m_pProxyLayer changed state from 0 to 1
. 2017-03-07 23:50:45.828 m_pProxyLayer changed state from 1 to 2
. 2017-03-07 23:50:45.828 m_pProxyLayer changed state from 2 to 4
< 2017-03-07 23:50:45.922 150 Data connection accepted from 129.35.231.3:51764; transfer starting for /2017-03-07/SIMT0307.zip (114643 bytes)
. 2017-03-07 23:50:45.922 m_pSslLayer changed state from 0 to 4
. 2017-03-07 23:50:46.015 SSL connection established
. 2017-03-07 23:50:46.234 m_pSslLayer changed state from 4 to 6
. 2017-03-07 23:50:46.234 Copying files from remote side failed.
. 2017-03-07 23:50:46.234 Got reply 4 to the command 4
< 2017-03-07 23:50:46.265 226 File sent ok.
* 2017-03-07 23:50:46.265 (ExtException) Copying files from remote side failed.
* 2017-03-07 23:50:46.265 File sent ok.
. 2017-03-07 23:50:46.265 Asking user:
. 2017-03-07 23:50:46.265 Error transferring file '/2017-03-07/SIMT0307.zip'. ("Copying files from remote side failed.","File sent ok.")
* 2017-03-07 23:50:46.265 (EScpSkipFile) Error transferring file '/2017-03-07/SIMT0307.zip'.
* 2017-03-07 23:50:46.265 Copying files from remote side failed.
* 2017-03-07 23:50:46.265 File sent ok.
. 2017-03-07 23:50:46.265 Session upkeep
. 2017-03-07 23:50:46.265 Listing file "IEXT0307.zip".
. 2017-03-07 23:50:46.265 File: "/2017-03-07/IEXT0307.zip"
. 2017-03-07 23:50:46.265 Copying "/2017-03-07/IEXT0307.zip" to local directory started.
. 2017-03-07 23:50:46.265 Binary transfer mode selected.
. 2017-03-07 23:50:46.265 Starting download of /2017-03-07/IEXT0307.zip
> 2017-03-07 23:50:46.265 TYPE I
> 2017-03-07 23:50:46.265 PASV
< 2017-03-07 23:50:46.312 200 Type set to I.
. 2017-03-07 23:50:46.312 Could not retrieve directory listing
. 2017-03-07 23:50:46.312 Copying files from remote side failed.
. 2017-03-07 23:50:46.312 Got reply 4 to the command 4
* 2017-03-07 23:50:46.312 (ExtException) Could not retrieve directory listing
* 2017-03-07 23:50:46.312 Copying files from remote side failed.
* 2017-03-07 23:50:46.312 Type set to I.
. 2017-03-07 23:50:46.312 Asking user:
. 2017-03-07 23:50:46.312 Error transferring file '/2017-03-07/IEXT0307.zip'. ("Could not retrieve directory listing","Copying files from remote side failed.","Type set to I.")
* 2017-03-07 23:50:46.312 (EScpSkipFile) Error transferring file '/2017-03-07/IEXT0307.zip'.
* 2017-03-07 23:50:46.312 Could not retrieve directory listing
* 2017-03-07 23:50:46.312 Copying files from remote side failed.
* 2017-03-07 23:50:46.312 Type set to I.
. 2017-03-07 23:50:46.312 Session upkeep
. 2017-03-07 23:50:46.327 Session upkeep
. 2017-03-07 23:50:46.327 Got reply 1004 to the command 4
. 2017-03-07 23:50:46.327 Disconnected from server



I am wondering about two things:
1) port range for data connection is not correctly defined on network firewall or remote FTP
2) firewall or antivirus software on FTP server side cuts the outbound(maybe inbound) traffic.

Looking to hear any ideas, THX
martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 27059
Location: Prague, Czechia
dodin wrote:
I am trying to connect from windows server to remote FTP server behind NAT(using proxy) and download files.

Please, start by upgrading. You are using an old version of WinSCP.
If that does not help, start a new thread and post a complete log file showing both scenarios.
Advertisements

You can post new topics in this forum

Search

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License