VBA --- Timeout waiting for WinSCP to respond

Advertisement

Guest

VBA --- Timeout waiting for WinSCP to respond

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.

Reply with quote

Advertisement

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

Re: VBA --- Timeout waiting for WinSCP to respond

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.

Reply with quote

martin
Site Admin
martin avatar

Re: VBA --- Timeout waiting for WinSCP to respond

We need corresponding debug log files too. See my previous post.

Reply with quote

Advertisement

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

Re: VBA --- Timeout waiting for WinSCP to respond

Try to run just a simple script file like:

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

with script.txt:

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.

Reply with quote

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

Reply with quote

Advertisement

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.

Reply with quote

Advertisement

You can post new topics in this forum