简体   繁体   English

连接不一致,将文件从Azure上传到Amazon SFTP站点(WinSCP)

[英]Inconsistent Connection Uploading file FROM Azure to Amazon SFTP Site (WinSCP)

I have searched the StackOverflow site for this specific issue, but no luck. 我已经在StackOverflow网站上搜索了此特定问题,但是没有运气。 There are items close, but nothing quite handles my issue. 有些项目已经结束,但是没有什么能解决我的问题。

I have a C# application which uses the latest WinSCP (5.7.5) Nuget. 我有一个使用最新的WinSCP(5.7.5)Nuget的C#应用​​程序。 The application is running on an Azure server, and trying to upload multiple files to an Amazon SFTP site. 该应用程序正在Azure服务器上运行,并尝试将多个文件上传到Amazon SFTP站点。

For testing, I send 3 files, with a new connection for each. 为了进行测试,我发送了3个文件,每个文件都有一个新的连接。 I typically get 1 out of 3 connected and sent immediately and successfully, the other two pause for around 10 seconds and give me a Connection Time Out error. 我通常每3个连接中就有1个立即成功发送并发送,另外两个暂停约10秒钟,并出现连接超时错误。 Note that it seems to ignore the timeout setting. 请注意,它似乎忽略了超时设置。

If I run the same application locally, (not in Azure), it runs consistently every time. 如果我在本地(而不是在Azure中)运行相同的应用程序,则每次都将一致地运行。

Any ideas? 有任何想法吗? I don't really have access to the Amazon FTP site to change settings or anything. 我实际上无权访问Amazon FTP站点以更改设置或任何其他操作。 I have tried Passive/Non-Passive mode and disabled the firewall on my Azure server. 我尝试了被动/非被动模式,并禁用了Azure服务器上的防火墙。

    WinSCP.SessionRemoteException: Network error: Connection to "xxx-xx-xxx-xx-xxx.c
    ompute-1.amazonaws.com" timed out.
       at WinSCP.SessionLogReader.Read(LogReadFlags flags)
       at WinSCP.ElementLogReader.Read(LogReadFlags flags)
       at WinSCP.SessionElementLogReader.Read(LogReadFlags flags)
       at WinSCP.CustomLogReader.TryWaitForNonEmptyElement(String localName, LogRead
    Flags flags)
       at WinSCP.CustomLogReader.WaitForGroupAndCreateLogReader()
       at WinSCP.Session.Open(SessionOptions sessionOptions)
       at FTPTesting.Program.FtpFiles(String file, String destination) in c:\_git\as
    setbook.joel_sandbox\FTPTesting\Program.cs:line 47

Well guys, I did some more testing. 伙计们,我做了更多测试。 Just out of curiosity I spun up a nearly identical Azure machine, and moved my FTP application to it. 出于好奇,我启动了一台几乎相同的Azure机器,然后将我的FTP应用程序移动到了它。

No errors at all. 完全没有错误。 It ran for hours with no messages. 它运行了几个小时,没有任何消息。 I kept it running on the first bad Azure machine as well, and it was still generating intermittent errors. 我也让它继续在第一台损坏的Azure机器上运行,并且它仍然会产生间歇性错误。

I don't quite know how azure resources are allocated, but the error continued on the old machine, even after stopping and starting the machine. 我不太清楚天蓝色的资源是如何分配的,但是即使在停止和启动机器之后,旧机器上的错误仍然继续。 The new machine never threw error an error... 新机器永远不会向错误抛出错误。

I kept both machines running overnight. 我让两台机器都隔夜运转。 And after a while the old machine quit throwing errors, and hasn't thrown an error since. 过了一会儿,旧机器退出并抛出错误,此后再也没有抛出错误。 Could it be self-healing or something, after having errors for such a long time? 在这么长时间的错误之后,会自我修复还是什么?

I'd been dealing with the intermittent errors for weeks, so it wasn't just something funny yesterday. 我已经处理了数周的间歇性错误,所以昨天的事情不仅仅有趣。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM