-
-
Notifications
You must be signed in to change notification settings - Fork 940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSHException Channel was closed intermittent behavior #511
Comments
Any luck on this? I'm getting a SocketException:
|
I am having a similar problem with Azure but not with all hosts. It is also intermittent. Sometimes i get this error and sometimes i already get the error on Connect: Couln't connect to SFTP A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond I have set up our own SFTP server (freeFTPd) and could replicate the problem. Running the same code on my dev machine I never experience the problem. |
I am having a similar problem with Azure Function with some request but not all. below is code, do I need to use static or singleton sftp client to overcome from this issue?
|
Sorry for being late to this party. Were you able to rule out network issues? |
Anyone got solution for this issue?? I am also facing same issue (Calling Renci from Azure function). Although credentials works fine with same code in Dev and Test environment and files successfully transferring to server but after deploying in UAT it got failed with this error :( |
@sachetpatil1 I only get this error intermittently now, but I have not updated to the latest version. But when switching to .Net Core 2 years ago I got it the whole time. So I took the latest version of the code, not the nuget) and applied the change suggested here: I still have not merged the last version and tested it with the last fixes and/or that change. This seems like this could be an Azure (SNAT?) related issue (agressively low timeout settings perhaps?), but it would be nice if the client library could cope with it, e.g. through a retry (if that is possible), chattier keep-alives or something in that direction. I have also gotten a similar error when downloading av large file, like 200 mb which I think is odd. I am running that download inside an async thread, I don't know if that is relevant. |
@mikaelliljedahl After so much investigation, we decided to speak with our Azure admin team (different organisation) and got to know that they restricted FTP server to connect external resourves in firewall so that App service IP was not allowed to connect FTP server. We requested them to whitelist that IP and it worked. I feel there is no issue in Renci dll regarding connection to external ftp. Now we are able to send all files but not sure how much file size it can handle (Curently we are sending max 100 mb file). |
I was getting this error from windows server and I found the solution on this page ; https://superuser.com/a/1733719/1747814 |
my code :
error: 引发的异常:“Renci.SshNet.Common.SshException”(位于 Renci.SshNet.dll 中) |
For those of you facing this issue, check my comment here #1107 (comment). TL;DR:
FWIW: |
We are connecting to a client SFTP and prior to this week had nothing but successful transactions.
We are now experiencing intermittent exceptions. We are calling this functionality from an Azure function, and the files are streamed from Azure storage, but i don't believe that has any impact on the issue.
I have tried both synchronous and asynchronous methods and had success locally, and on majority of live test cases, but when it fails, I don't have an idea of what the problem may be. Any thoughts would be much appreciated.
My code is below:
sftpClient.Connect();
var uploadPath = $"{sftpFolder}/{fileName}";
sftpClient.UploadFile(stream, uploadPath);
sftpClient.Disconnect();
Alternatively, I tried instead:
sftpClient.Connect();
var uploadPath = $"{sftpFolder}/{fileName}";
var returnVal = sftpClient.BeginUploadFile(stream, uploadPath, new AsyncCallback(x => FileTransferred(x, log, fileName, uploadPath)));
The text was updated successfully, but these errors were encountered: