Connecting to host takes 30 seconds using SFTP

Advertisement

StevenNelson
Joined:
Posts:
3

Connecting to host takes 30 seconds using SFTP

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

Reply with quote

Advertisement

StevenNelson
Joined:
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

Reply with quote

StevenNelson
Joined:
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

Reply with quote

Advertisement

martin
Site Admin
martin avatar

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

Reply with quote

ebtech
Guest

martin 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

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
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.

Reply with quote

Advertisement

You can post new topics in this forum