WinSCP网络错误:软件导致连接中止

时间:2019-04-25 00:00:18

标签: sftp scp winscp

我有一个计划的工作,每天要通过WinSCP进行安全的文件传输。该流程以2个ssrs文件共享订阅开始,该订阅将2个文件删除到本地目录中。然后,我安排的sql server agent作业启动了一个powershell脚本,该脚本启动了将2个文件的winscp sftp传输到远程SFTP服务器的过程。

作业和文件传输正常工作了2个月,直到上周随机(某天开始该工作开始失败),然后才能正常工作。日志显示一个隐秘的网络错误“软件导致连接中止”。我已经在https://winscp.net/eng/docs/message_software_caused_connection_abort,这里https://winscp.net/eng/docs/message_unexpected_close这里https://winscp.net/eng/docs/faq_connection_refused和这里https://www.hostingride.in/content/solved-network-error-software-caused-connection-abort-winscp-error-putty-keepalives

的其他地方检查了winscp的支持文档。

根据发现的建议我:

a)向Windows防火墙添加了一个例外,以允许winscp通过。

b)在WinSCP高级站点设置的Keepalives下启用了“执行虚拟协议命令”

c)将服务器响应超时和两次保持活动之间的秒数分别提高到360秒

这些都不能解决问题。奇怪的是,文件传输并非每天都持续失败。重复运行作业(相同的代码)通常会失败,但偶尔会成功(请参见随附的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 --------------------------------------------------------------------------

enter image description here

2 个答案:

答案 0 :(得分:0)

回答:由于这是服务器端问题,因此该项目尚无立即解决方案。解决方案是与另一方确认,由于正确启动了客户端请求,因此他们的SFTP服务器已正确配置。

答案 1 :(得分:0)

回答:只要运行这个命令,它就会解决你的问题。

sudo systemctl start sshd.service