Proxy request failed, can't connect through proxy server

Advertisement

keviejay
Joined:
Posts:
3

Proxy request failed, can't connect through proxy server

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.

Reply with quote

Advertisement

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

Re: Proxy request failed, can't connect through proxy server

Please attach a full log file both from GUI and code (using the latest version of WinSCP).

Reply with quote

Advertisement

dodin
Guest

similar issue

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 :) 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...

Reply with quote

dodin
Guest

similar issue - update

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

Reply with quote

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

Re: similar issue

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.

Reply with quote

aasir
Guest

proxy server

[quote="dodin"]Hello,

getting really lost here :/
[b]
I am trying to connect from windows server to remote FTP server behind NAT(using proxy) and download files.

Getting error like:[/b]
< 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.


[b]Using GUI sometimes I cannot connect or I can connect for a while(sometimes also list few directories) but then error message comes:[/b]
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)

[b]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 :) 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...[/b][/quote][list][size=9][/size]

Reply with quote

Advertisement

You can post new topics in this forum