Topic "VBA --- Timeout waiting for WinSCP to respond"

Author Message
Guest




Hello,

I've implemented WinSCP .NET Assembly for VBA, trying to upload files from a local folder through SFTP, but I'm getting "Timeout waiting for WinSCP to respond" when I try to upload a number of files bigger than 150 - 200.
Of course, I've tried using .TimeoutInMilliseconds and I've increased it and tested even with 900000.

If I transfer only 100 files, it's ok with values much much lower than 900000. BTW, what is the MAX value for TimeoutInMilliseconds?
When I get the timeout error, it fails without transferring any file, so this makes me understand that it fails at the part when WinSCP evaluates the number of files & dimension it has to transfer, before starting the transfer.

The files are .zip and have in average 110 KB, so the transferred values are not so big, between 20MB-45MB per day.

With mySessionOptions
.Protocol = Protocol_Sftp
.TimeoutInMilliseconds = 600000
.HostName = "xx.xxx.xxx.xx"
.UserName = "xxxxx"
.GiveUpSecurityAndAcceptAnySshHostKey = True
.SshPrivateKeyPath = "C:/xxxx/PrivateKey.ppk"
End With

And the transfer is done like:

' Upload files
Dim myTransferOptions As New TransferOptions
myTransferOptions.TransferMode = TransferMode_Binary

Dim transferResult As TransferOperationResult
Set transferResult = mySession.PutFiles("\\local\path\*", "/in/", False, myTransferOptions)

Thanks in advance for your advices.
Advertisements
martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26911
Location: Prague, Czechia
Please attach a full session and debug log file showing the problem (using the latest version of WinSCP).

To generate the log files, set Session.SessionLogPath and Session.DebugLogPath. Submit the logs with your post as an attachment. You may want to remove data you consider sensitive (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.
Guest




Hi, I generated a log today, when it failed, having to upload 287 files.
Log_1403.txt (10.83 KB) [Download]

Description: (none)

Guest




And a log when it had only 84 files to transfer, and, of course, it worked.
Log_1103.txt (175.09 KB) [Download]

Description: (none)

martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26911
Location: Prague, Czechia
We need corresponding debug log files too. See my previous post.
Guest




Hi,

Added logs + debug for both cases OK & NOK.
Thanks,
Logs.zip (511.38 KB) Private file

Description: (none)

martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26911
Location: Prague, Czechia
Try to run just a simple script file like:

winscp.com /log=session.log /ini=nul /script=script.txt

with script.txt:

Code:
open "sftp://user@xx.xxx.xxx.xx" -hostkey="*" -privatekey="C:/xxxx/PrivateKey.ppk" -timeout=600
put  -nopermissions -preservetime -transfer="binary" -- "\\xxxx\*" "/in/"


What does it do? Post a log file.
Guest




Added. Thanks.
session.log (649.53 KB) Private file

Description: (none)

martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26911
Location: Prague, Czechia
Thanks for your report.

Can you send me an email, so I can send you back a debug version of WinSCP to track the problem? Please include link back to this topic in your email. Also note in this topic that you have sent the email. Thanks.

You will find my address (if you log in) in my forum profile.
EviluSH
[View user's profile]

Joined: 2017-03-03
Posts: 1
hi martin,

mail sent.

Thanks.
Guest




I think I solved the problem. It was on server side, due to automatic transfer resume.

"With SFTP protocol, when automatic transfer resume is enabled, WinSCP first uploads the file to a temporary file with .filepart extension. Only after the transfer is completed the file is renamed to its actual name."

I've deactivated this, and I live the VBA code here, for future uses:

TransferOptions.ResumeSupport.State = TransferResumeSupportState.TransferResumeSupportState_Off

Thanks, Martin, for all your help.
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