WinSCP Network error: Software caused connection abort

WinSCP Network error: Software caused connection abort

我有一个预定的工作,每天通过 WinSCP 执行安全文件传输。该流程以 2 个 ssrs 文件共享订阅开始,这会在本地目录中删除 2 个文件。然后我安排的 sql 服务器代理作业启动一个 powershell 脚本,该脚本启动 winscp sftp 将 2 个文件传输到远程 SFTP 服务器。

工作和文件传输在 2 个月内都工作正常,直到上周随机出现工作在某些天(但不是其他天)开始失败。日志显示一个神秘的网络错误 "Software caused connection abort"。我在这里查看了 winscp 的支持文档 https://winscp.net/eng/docs/message_software_caused_connection_abort, here https://winscp.net/eng/docs/message_unexpected_close here https://winscp.net/eng/docs/faq_connection_refused and other sources here https://www.hostingride.in/content/solved-network-error-software-caused-connection-abort-winscp-error-putty-keepalives

根据我找到的建议:

a) 向 windows 防火墙添加了例外以允许 winscp 通过。

b) 在 WinSCP 高级站点设置中的 Keepalives 下启用 "Executing dummy protocol commands"

c) 将服务器响应超时和保持活动之间的秒数增加到每个 360 秒

None 解决了这个问题。奇怪的是,文件传输并不是每天都失败。 运行 作业反复(相同的代码)通常失败但偶尔会成功(见附件的 powershell 屏幕截图)

如果有人熟悉如何解决此问题,请告诉我。请参阅随附的日志条目和 powershell 屏幕截图。

. 2019-04-25 16:39:28.997 --------------------------------------------------------------------------
. 2019-04-25 16:39:28.998 Looking up host "REDACTED" for SSH connection
. 2019-04-25 16:39:29.002 Connecting to REDACTED port 22
. 2019-04-25 16:39:29.062 We claim version: SSH-2.0-WinSCP_release_5.13.1
. 2019-04-25 16:39:29.122 Network error: Software caused connection abort
. 2019-04-25 16:39:33.594 --------------------------------------------------------------------------
. 2019-04-25 16:39:33.594 WinSCP Version 5.13.1 (Build 8265) (OS 6.2.9200 - Windows Server 2012 Standard)
. 2019-04-25 16:39:33.594 Configuration: HKCU\Software\Martin Prikryl\WinSCP 2\
. 2019-04-25 16:39:33.594 Log level: Normal
. 2019-04-25 16:39:33.594 Local account: REDACTED\ebarnes
. 2019-04-25 16:39:33.594 Working directory: D:\Div32_Daily_Reports
. 2019-04-25 16:39:33.594 Process ID: 205196
. 2019-04-25 16:39:33.595 Command-line: "D:\Div32_Daily_Reports\WinSCP.exe" /console=5.13.1 /consoleinstance=_5176_503 "/script=SyncTo_bics_inventory_v2.txt" "/log=D:\Div32_Daily_Reports\winscp_log_bics_inventory.txt" 
. 2019-04-25 16:39:33.595 Time zone: Current: GMT+0 (Coordinated Universal Time), No DST
. 2019-04-25 16:39:33.595 Login time: Thursday, April 25, 2019 4:39:33 PM
. 2019-04-25 16:39:33.595 --------------------------------------------------------------------------
. 2019-04-25 16:39:33.595 Script: Retrospectively logging previous script records:
> 2019-04-25 16:39:33.595 Script: option batch abort
< 2019-04-25 16:39:33.595 Script: batch           abort     
> 2019-04-25 16:39:33.595 Script: option confirm off
< 2019-04-25 16:39:33.595 Script: confirm         off       
> 2019-04-25 16:39:33.595 Script: open sftp://a427721x:***@REDACTED -hostkey="ssh-rsa 2048 ad:b3:c7:a1:ff:43:5c:71:d6:a7:50:6c:1a:c8:d1:70"
. 2019-04-25 16:39:33.595 --------------------------------------------------------------------------
. 2019-04-25 16:39:33.595 Session name: a427721x@REDACTED (Ad-Hoc site)
. 2019-04-25 16:39:33.595 Host name: REDACTED (Port: 22)
. 2019-04-25 16:39:33.595 User name: a427721x (Password: Yes, Key file: No, Passphrase: No)
. 2019-04-25 16:39:33.595 Tunnel: No
. 2019-04-25 16:39:33.595 Transfer Protocol: SFTP
. 2019-04-25 16:39:33.595 Ping type: Off, Ping interval: 30 sec; Timeout: 15 sec
. 2019-04-25 16:39:33.595 Disable Nagle: No
. 2019-04-25 16:39:33.595 Proxy: None
. 2019-04-25 16:39:33.595 Send buffer: 262144
. 2019-04-25 16:39:33.595 SSH protocol version: 2; Compression: No
. 2019-04-25 16:39:33.595 Bypass authentication: No
. 2019-04-25 16:39:33.595 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: Yes
. 2019-04-25 16:39:33.595 GSSAPI: Forwarding: No; Libs: gssapi32,sspi,custom; Custom: 
. 2019-04-25 16:39:33.595 Ciphers: aes,chacha20,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2019-04-25 16:39:33.595 KEX: ecdh,dh-gex-sha1,dh-group14-sha1,rsa,WARN,dh-group1-sha1
. 2019-04-25 16:39:33.595 SSH Bugs: Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto
. 2019-04-25 16:39:33.595 Simple channel: Yes
. 2019-04-25 16:39:33.595 Return code variable: Autodetect; Lookup user groups: Auto
. 2019-04-25 16:39:33.595 Shell: default
. 2019-04-25 16:39:33.595 EOL: LF, UTF: Auto
. 2019-04-25 16:39:33.595 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes; Follow directory symlinks: No
. 2019-04-25 16:39:33.595 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2019-04-25 16:39:33.595 SFTP Bugs: Auto,Auto
. 2019-04-25 16:39:33.595 SFTP Server: default
. 2019-04-25 16:39:33.595 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2019-04-25 16:39:33.595 Cache directory changes: Yes, Permanent: Yes
. 2019-04-25 16:39:33.595 Recycle bin: Delete to: No, Overwritten to: No, Bin path: 
. 2019-04-25 16:39:33.595 DST mode: Unix
. 2019-04-25 16:39:33.595 --------------------------------------------------------------------------
. 2019-04-25 16:39:33.596 Looking up host "REDACTED" for SSH connection
. 2019-04-25 16:39:33.600 Connecting to REDACTED port 22
. 2019-04-25 16:39:33.660 We claim version: SSH-2.0-WinSCP_release_5.13.1
. 2019-04-25 16:39:33.720 Network error: Software caused connection abort
. 2019-04-25 16:39:37.840 --------------------------------------------------------------------------

回答:因为这是一个server-side问题,所以这个项目没有立即解决的办法。解决方案是与对方确认他们的 SFTP 服务器配置正确,因为 client-side 请求正在正确发起。