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\WinSCP.com" ^
/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" ^
"exit"
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
Notes:
* 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.