Topic "Connecting to host takes 30 seconds using SFTP"

Author Message
StevenNelson
[View user's profile]

Joined: 2015-02-03
Posts: 3
Version: WinSCP.exe = 5.5.6.0, WinSCPnet.dll = 5.5.6.0

I've being trying to get to the bottom of the issue of why WinScp takes 30 seconds to connect to the host before uploading a file. This isn't a new issue and has always happened, so not sure if its an issue with the environment I'm running in or if we are missing a WinSCP setting.

Previously FTP uploads were being carried out using the GUI, (which also exhibited this behaviour), but I've coding a C# implementation and experience the same issue no matter which raw settings I change. I've attached the log and debug files, (with some masking), but the pertinent part from the file is:

. 2015-02-20 09:10:50.740 --------------------------------------------------------------------------
. 2015-02-20 09:10:50.741 Looking up host "secureftp.testserver.com"
. 2015-02-20 09:10:50.751 Connecting to 123.456.789.012 port 8080
. 2015-02-20 09:11:21.475 Server version: SSH-2.0-OpenSSH_4.0

. 2015-02-20 09:11:21.475 Using SSH protocol version 2
. 2015-02-20 09:11:21.475 We claim version: SSH-2.0-WinSCP_release_5.5.6
. 2015-02-20 09:11:21.759 Doing Diffie-Hellman group exchange
. 2015-02-20 09:11:21.955 Doing Diffie-Hellman key exchange with hash SHA-1
. 2015-02-20 09:11:22.260 Verifying host key rsa2 123456MASKED
. 2015-02-20 09:11:22.260 Host key matches configured key

So the FTP does work its just the initial connection appears to be waiting for 30 seconds then continues. I'm setting up the session Options as described in the documentation, (obviously you can't see the variables below but you get the idea):

Protocol = protocol,
PortNumber = roct.ConnectionPort,
HostName = roct.ConnectionHost,
UserName = roct.ConnectionUsername,
Password = roct.ConnectionPassword,
FtpMode = WinSCP.FtpMode.Passive,
Timeout = TimeSpan.FromSeconds(200),
SshHostKeyFingerprint = roct.ConnectionSshHostKeyFingerprint

and Raw settings:

sessionOptions.AddRawSettings("ProxyMethod", rocpt.ProxyMethodWinScp.ToString());
sessionOptions.AddRawSettings("ProxyHost", rocpt.ProxyHost);
sessionOptions.AddRawSettings("ProxyPort", rocpt.ProxyPort.ToString());
sessionOptions.AddRawSettings("SendBuf", "262144");
sessionOptions.AddRawSettings("PingIntervalSecs", "5");

I tried changing the pingIntervalSecs to 5 as I can see from the logs that it was defaulting to 30 and was hoping this may resolve the issue, but this made no difference.

Is there another raw setting to change, or is the issue at the other server, or an issue with the Proxy or a firewall which you can deduce from the attached log/debug?

Thanks for your help,
Steven
Debug.txt (73.38 KB) Private file

Description: Debug File

Log.txt (8.17 KB) Private file

Description: Log file

Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Please attach a log file from GUI, with Debug 2 log level.
http://winscp.net/eng/docs/ui_pref_logging
_________________
Martin Prikryl
StevenNelson
[View user's profile]

Joined: 2015-02-03
Posts: 3
I've attached the log as requested, just connecting to the site. Again part of the log that has the delay, (looking for network events):

. 2015-02-20 12:30:56.029 Waiting for the server to continue with the initialization
. 2015-02-20 12:30:56.029 Looking for incoming data
. 2015-02-20 12:30:56.030 Looking for network events
. 2015-02-20 12:31:26.358 Detected network event

. 2015-02-20 12:31:26.358 Enumerating network events for socket 836
. 2015-02-20 12:31:26.358 Enumerated 1 network events making 1 cumulative events for socket 836
. 2015-02-20 12:31:26.358 Handling network read event on socket 836 with error 0
. 2015-02-20 12:31:26.358 Server version: SSH-2.0-OpenSSH_4.0

Thanks again,
Steven
Log123055.log (82.65 KB) Private file

Description: Log with debug Level 2

martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Can you try any other SSH/SFTP client for comparison?
_________________
Martin Prikryl
StevenNelson
[View user's profile]

Joined: 2015-02-03
Posts: 3
I've tried the same procedure with Filezilla, which is producing the same 30 second delay. So presuming both products don't share an underlying component with the same issue, I'm guessing this is probably a problem with our proxy, (which I don't have access to)? Is that a common scenario, or could there potentially be another network area I should focus on?

Thanks for your help,
Steven
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Well actually WinSCP and FileZilla share common code for SSH. Maybe you can try another client, Cyberduck for example.
_________________
Martin Prikryl
ebtech

Guest


prikryl wrote:
Well actually WinSCP and FileZilla share common code for SSH. Maybe you can try another client, Cyberduck for example.


Anything come out of this? I'm seeing the same issue tried using WinSCP and Core FTP; makes no difference in time for "Looking for network events".

Thanks
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
ebtech wrote:
Anything come out of this? I'm seeing the same issue tried using WinSCP and Core FTP; makes no difference in time for "Looking for network events".

Core FTP server? Did you try another SFTP client?

Please attach a full log file showing the problem (using the latest version of WinSCP).

To generate log file, enable logging, log in to your server and do the operation and only the operation that causes the error. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.
Advertisements

You can post new topics in this forum






Search Site

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