We use a WinSCP script to automate the upload of files, and the log that it generates shows that about every third attempt to upload files to WingFTP will be successful, but any of the other attempts will consistently return the error above.Remote side unexpectedly closed network connection
The WinSCP client provides the following information about the connection it's making to WingFTP:
In addition, the following is the log file that WinSCP generates when it connects and encounters the error:File transfer protocol = SFTP-3
Cryptographic protocol = SSH-2
SSH implementation = WingFTPServer
Encryption algorithm = AES-256 SDCTR (AES-NI accelerated)
Compression = No
------------------------------------------------------------
Can change permissions = Yes
Can change owner/group = Yes
Can execute arbitrary command = No
Can create symbolic/hard link = Yes/No
Can lookup user groups = No
Can duplicate remote files = No
Can check available space = No
Can calculate file checksum = No
Native text (ASCII) mode transfers = No
------------------------------------------------------------
Additional information
The server does not support any SFTP extension.
What could be wrong in this case?. 2020-04-08 06:37:51.543 WinSCP Version 5.17.3 (Build 10325) (OS 10.0.14393 - Windows Server 2016 Standard)
. 2020-04-08 06:37:51.543 Configuration: HKCU\Software\Martin Prikryl\WinSCP 2\
. 2020-04-08 06:37:51.543 Log level: Normal
. 2020-04-08 06:37:51.543 Local account: **REDACTED**
. 2020-04-08 06:37:51.543 Working directory: C:\ISMUtilities\Data
. 2020-04-08 06:37:51.543 Process ID: 8316
. 2020-04-08 06:37:51.543 Command-line: "C:\Program Files (x86)\WinSCP\WinSCP.exe" /console=5.17.3 /consoleinstance=_4276_372 "/script=C:\ISMUtilities\Data\WinSCPAutomationScript.txt" "/log=C:\ISMUtilities\Data\WinSCP.log"
. 2020-04-08 06:37:51.543 Time zone: Current: GMT-4, Standard: GMT-5 (Eastern Standard Time), DST: GMT-4 (Eastern Daylight Time), DST Start: 3/8/2020, DST End: 11/1/2020
. 2020-04-08 06:37:51.543 Login time: Wednesday, April 8, 2020 6:37:51 AM
. 2020-04-08 06:37:51.543 --------------------------------------------------------------------------
. 2020-04-08 06:37:51.543 Script: Retrospectively logging previous script records:
> 2020-04-08 06:37:51.543 Script: option batch abort
< 2020-04-08 06:37:51.543 Script: batch abort
> 2020-04-08 06:37:51.543 Script: option confirm off
< 2020-04-08 06:37:51.543 Script: confirm off
> 2020-04-08 06:37:51.543 Script: open sftp://**REDACTED**:**REDACTED**/ -hostkey="**REDACTED**" -rawsettings FSProtocol=2 SendBuf=0 SshSimple=0
. 2020-04-08 06:37:51.543 --------------------------------------------------------------------------
. 2020-04-08 06:37:51.543 Session name: **REDACTED** (Ad-Hoc site)
. 2020-04-08 06:37:51.543 Host name: **REDACTED** (Port: 22)
. 2020-04-08 06:37:51.543 User name: **REDACTED** (Password: Yes, Key file: No, Passphrase: No)
. 2020-04-08 06:37:51.543 Tunnel: No
. 2020-04-08 06:37:51.543 Transfer Protocol: SFTP
. 2020-04-08 06:37:51.543 Ping type: Off, Ping interval: 30 sec; Timeout: 15 sec
. 2020-04-08 06:37:51.543 Disable Nagle: No
. 2020-04-08 06:37:51.543 Proxy: None
. 2020-04-08 06:37:51.543 Send buffer: 0
. 2020-04-08 06:37:51.543 SSH protocol version: 2; Compression: No
. 2020-04-08 06:37:51.543 Bypass authentication: No
. 2020-04-08 06:37:51.543 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: Yes
. 2020-04-08 06:37:51.543 GSSAPI: Forwarding: No; Libs: gssapi32,sspi,custom; Custom:
. 2020-04-08 06:37:51.543 Ciphers: aes,chacha20,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2020-04-08 06:37:51.543 KEX: ecdh,dh-gex-sha1,dh-group14-sha1,rsa,WARN,dh-group1-sha1
. 2020-04-08 06:37:51.543 SSH Bugs: Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto
. 2020-04-08 06:37:51.543 Simple channel: No
. 2020-04-08 06:37:51.543 Return code variable: Autodetect; Lookup user groups: Auto
. 2020-04-08 06:37:51.543 Shell: default
. 2020-04-08 06:37:51.543 EOL: LF, UTF: Auto
. 2020-04-08 06:37:51.543 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes; Follow directory symlinks: No
. 2020-04-08 06:37:51.543 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No; Exit code 1 is error: No
. 2020-04-08 06:37:51.543 SFTP Bugs: Auto,Auto
. 2020-04-08 06:37:51.543 SFTP Server: default
. 2020-04-08 06:37:51.543 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2020-04-08 06:37:51.543 Cache directory changes: Yes, Permanent: Yes
. 2020-04-08 06:37:51.543 Recycle bin: Delete to: No, Overwritten to: No, Bin path:
. 2020-04-08 06:37:51.543 DST mode: Unix
. 2020-04-08 06:37:51.543 --------------------------------------------------------------------------
. 2020-04-08 06:37:51.543 Looking up host "**REDACTED**" for SSH connection
. 2020-04-08 06:37:51.559 Connecting to **REDACTED** port 22
. 2020-04-08 06:37:51.559 We claim version: SSH-2.0-WinSCP_release_5.17.3
. 2020-04-08 06:37:51.559 Remote version: SSH-2.0-WingFTPServer
. 2020-04-08 06:37:51.559 Using SSH protocol version 2
. 2020-04-08 06:37:51.559 No GSSAPI security context available
. 2020-04-08 06:37:51.559 Have a known host key of type ecdsa-sha2-nistp256
. 2020-04-08 06:37:51.559 Doing ECDH key exchange with curve Curve25519 and hash SHA-256
. 2020-04-08 06:37:51.637 Server also has ssh-rsa host key, but we don't know it
. 2020-04-08 06:37:51.637 Host key fingerprint is:
. 2020-04-08 06:37:51.637 **REDACTED**
. 2020-04-08 06:37:51.637 Host key matches cached key
. 2020-04-08 06:37:51.637 Initialised AES-256 SDCTR (AES-NI accelerated) outbound encryption
. 2020-04-08 06:37:51.637 Initialised HMAC-SHA-256 outbound MAC algorithm
. 2020-04-08 06:37:51.637 Initialised AES-256 SDCTR (AES-NI accelerated) inbound encryption
. 2020-04-08 06:37:51.637 Initialised HMAC-SHA-256 inbound MAC algorithm
! 2020-04-08 06:37:51.653 Using username "**REDACTED**".
. 2020-04-08 06:37:51.653 Server offered these authentication methods: publickey,password
. 2020-04-08 06:37:51.653 Prompt (password, "SSH password", <no instructions>, "&Password: ")
. 2020-04-08 06:37:51.653 Using stored password.
. 2020-04-08 06:37:51.653 Sent password
. 2020-04-08 06:37:51.653 Access granted
. 2020-04-08 06:37:51.653 Opening main session channel
. 2020-04-08 06:37:51.653 Opened main channel
. 2020-04-08 06:37:51.653 Started a shell/command
. 2020-04-08 06:37:51.653 --------------------------------------------------------------------------
. 2020-04-08 06:37:51.653 Using SFTP protocol.
. 2020-04-08 06:37:51.653 Doing startup conversation with host.
> 2020-04-08 06:37:51.653 Type: SSH_FXP_INIT, Size: 5, Number: -1
< 2020-04-08 06:37:51.668 Type: SSH_FXP_VERSION, Size: 5, Number: -1
. 2020-04-08 06:37:51.668 SFTP version 3 negotiated.
. 2020-04-08 06:37:51.668 We believe the server has signed timestamps bug
. 2020-04-08 06:37:51.668 We will use UTF-8 strings until server sends an invalid UTF-8 string as with SFTP version 3 and older UTF-8 strings are not mandatory
. 2020-04-08 06:37:51.668 Getting current directory name.
. 2020-04-08 06:37:51.668 Getting real path for '.'
> 2020-04-08 06:37:51.668 Type: SSH_FXP_REALPATH, Size: 10, Number: 16
< 2020-04-08 06:37:51.668 Type: SSH_FXP_NAME, Size: 23, Number: 16
. 2020-04-08 06:37:51.668 Real path is '/'
. 2020-04-08 06:37:51.668 Startup conversation with host finished.
< 2020-04-08 06:37:51.668 Script: Active session: [1] **REDACTED**
> 2020-04-08 06:37:51.668 Script: option transfer binary
< 2020-04-08 06:37:51.668 Script: transfer binary
> 2020-04-08 06:37:51.684 Script: put -nopreservetime -nopermissions "C:\ISMUtilities\Data\newcontactinfo.csv"
. 2020-04-08 06:37:51.684 Copying 1 files/directories to remote directory "/" - total size: 258,302
. 2020-04-08 06:37:51.684 PrTime: No; PrRO: No; Rght: rw-r--r--; PrR: No (No); FnCs: N; RIC: 0100; Resume: S (102400); CalcS: No; Mask:
. 2020-04-08 06:37:51.684 TM: B; ClAr: No; RemEOF: No; RemBOM: No; CPS: 0; NewerOnly: No; EncryptNewFiles: Yes; ExcludeHiddenFiles: No; ExcludeEmptyDirectories: No; InclM: ; ResumeL: 0
. 2020-04-08 06:37:51.684 AscM: *.*html; *.htm; *.txt; *.php; *.php3; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex; *.pl; *.js; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml
. 2020-04-08 06:37:51.684 Getting real path for '/'
> 2020-04-08 06:37:51.684 Type: SSH_FXP_REALPATH, Size: 10, Number: 6416
< 2020-04-08 06:37:51.684 Type: SSH_FXP_NAME, Size: 23, Number: 6416
. 2020-04-08 06:37:51.684 Real path is '/'
. 2020-04-08 06:37:51.684 File: 'C:\ISMUtilities\Data\newcontactinfo.csv' [2020-04-08T06:00:14.179Z] [258302]
. 2020-04-08 06:37:51.684 Copying "C:\ISMUtilities\Data\newcontactinfo.csv" to remote directory started.
. 2020-04-08 06:37:51.684 Binary transfer mode selected.
. 2020-04-08 06:37:51.684 Checking existence of file.
> 2020-04-08 06:37:51.684 Type: SSH_FXP_LSTAT, Size: 28, Number: 6663
< 2020-04-08 06:37:51.684 Type: SSH_FXP_ATTRS, Size: 37, Number: 6663
. 2020-04-08 06:37:51.684 File exists: newcontactinfo.csv;-;258302;2020-04-08T10:37:48.000Z;3;"" [0];"" [0];rw-rw-rw-;1
. 2020-04-08 06:37:51.684 Checking existence of partially transferred file.
> 2020-04-08 06:37:51.684 Type: SSH_FXP_LSTAT, Size: 37, Number: 6919
< 2020-04-08 06:37:51.684 Type: SSH_FXP_STATUS, Size: 32, Number: 6919
< 2020-04-08 06:37:51.684 Status code: 2
. 2020-04-08 06:37:51.684 Opening remote file.
> 2020-04-08 06:37:51.684 Type: SSH_FXP_OPEN, Size: 53, Number: 7171
< 2020-04-08 06:37:51.684 Type: SSH_FXP_HANDLE, Size: 39, Number: 7171
> 2020-04-08 06:37:51.684 Type: SSH_FXP_WRITE, Size: 32819, Number: 7686
. 2020-04-08 06:37:51.684 7 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packets.
> 2020-04-08 06:37:51.684 Type: SSH_FXP_CLOSE, Size: 39, Number: 9732
< 2020-04-08 06:37:51.684 Type: SSH_FXP_STATUS, Size: 25, Number: 7686
< 2020-04-08 06:37:51.684 Status code: 0
< 2020-04-08 06:37:51.684 Type: SSH_FXP_STATUS, Size: 25, Number: 7942
< 2020-04-08 06:37:51.684 Status code: 0
< 2020-04-08 06:37:51.715 Type: SSH_FXP_STATUS, Size: 25, Number: 8198
< 2020-04-08 06:37:51.715 Status code: 0
< 2020-04-08 06:37:51.715 Type: SSH_FXP_STATUS, Size: 25, Number: 8454
< 2020-04-08 06:37:51.715 Status code: 0
< 2020-04-08 06:37:51.715 Type: SSH_FXP_STATUS, Size: 25, Number: 8710
< 2020-04-08 06:37:51.715 Status code: 0
< 2020-04-08 06:37:51.715 Type: SSH_FXP_STATUS, Size: 25, Number: 8966
< 2020-04-08 06:37:51.715 Status code: 0
< 2020-04-08 06:37:51.715 Type: SSH_FXP_STATUS, Size: 25, Number: 9222
< 2020-04-08 06:37:51.715 Status code: 0
< 2020-04-08 06:37:51.715 Type: SSH_FXP_STATUS, Size: 25, Number: 9478
< 2020-04-08 06:37:51.715 Status code: 0
< 2020-04-08 06:37:51.715 Type: SSH_FXP_STATUS, Size: 17, Number: 9732
< 2020-04-08 06:37:51.715 Status code: 0
> 2020-04-08 06:37:51.715 Type: SSH_FXP_REMOVE, Size: 28, Number: 9997
< 2020-04-08 06:37:51.715 Type: SSH_FXP_STATUS, Size: 43, Number: 9997
< 2020-04-08 06:37:51.715 Status code: 0
> 2020-04-08 06:37:51.715 Type: SSH_FXP_RENAME, Size: 60, Number: 10258
< 2020-04-08 06:37:51.715 Type: SSH_FXP_STATUS, Size: 42, Number: 10258
< 2020-04-08 06:37:51.715 Status code: 0
> 2020-04-08 06:37:51.715 Type: SSH_FXP_SETSTAT, Size: 36, Number: 7433
< 2020-04-08 06:37:51.715 Type: SSH_FXP_STATUS, Size: 48, Number: 7433
< 2020-04-08 06:37:51.715 Status code: 0
. 2020-04-08 06:37:51.715 Transfer done: 'C:\ISMUtilities\Data\newcontactinfo.csv' => '/newcontactinfo.csv' [258302]
. 2020-04-08 06:37:51.715 Copying finished: Transferred: 258,302, Elapsed: 0:00:00, CPS: 7,047,937/s
> 2020-04-08 06:37:51.715 Script: close
. 2020-04-08 06:37:51.715 Closing connection.
. 2020-04-08 06:37:51.715 Sending special code: 1
. 2020-04-08 06:37:51.778 Main session channel closed
. 2020-04-08 06:37:51.778 Remote side unexpectedly closed network connection
< 2020-04-08 06:37:51.778 Script: Active session: [1] **REDACTED**
< 2020-04-08 06:37:51.778 Script: Remote side unexpectedly closed network connection
.