Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)


Topic review


Your SFTP server is probably broken. You can workaround the problem either the way you do (by limiting the speed). Or more reliable would be to set the SFTPMaxPacketSize session settings. It seems that the server can handle packets about 5 KB size correctly, so this should do:
open ... -rawsettings SFTPMaxPacketSize=5120

Log without limit attached.

Interestingly, the transfer failed here both with and without the limit...

I've tried to anonymise both log files so excuse some strange formatting or login/folder/server entries.

Thanks for your reply.
I can upload all files (large and small) with both WinSCP GUI and another SFTP client.
I am not able to ascertain the remote SFTP type as it is not within my control.

Log with limit attached.
Log without limit attached on next post.

Re: Upload stalls at 100% - Limiting speed fixes

Please post /loglevel=1 log files both with and without the speed limit. Can you upload the files successfully in WinSCP GUI or in any other SFTP client? What SFTP server is that?

Upload stalls at 100% - Limiting speed fixes

I am trying to run an automated SFTP on a schedule via a batch script using the WinSCP command line utility.
If the file is more than a 5kb in size it fails with the error below.

Command line entry - (anonymised)
"C:\Program Files (x86)\WinSCP\" ^
  /log="%sftplog%.log" /ini=nul ^
  /command ^
    "open sftp://USER:PW%%21@SERVER/ -hostkey=""ssh-rsa 2048 0RfZIfLXm9WeAHEHpBtmZvUbjk7J187TEj0g6bsiy8M="" -timeout=120 -rawsettings SendBuf=0 SshSimple=0" ^
    "lcd ""LOCALDIRECTORY""" ^
    "cd REMOTEDIR" ^
    "rm %UploadType%*.csv" ^
    "put -speed=5 %UploadType%*.csv" ^

Error -
. 2021-06-22 18:38:09.499 Network error: Software caused connection abort
. 2021-06-22 18:38:09.499 Connection was lost, asking what to do.

Things I've tried:
* Added a timeout of 120 seconds
* Changed "Optimize connection buffer size"

Adding the parameter -speed=5 to the put command to limit upload transfer to 5kb/s stops the issue occurring. This is fine for the time being as file sizes are very small but going forward this may cause an issue with timings.

Log file attached - I've anonymised users/servers/directories


* The files I'm transferring are very small CSV files (less than 100kb)
* Manually transferring using the GUI works fine.
* Issue occurred at version 5.17. Updated to 5.19 with no resolution.