SSHException Channel was closed intermittent behavior
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 4.4k
- Forks
- 993
- Avg merge
- 9d 21h
- Merged PRs (30d)
- 1
Description
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)));
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reported Connect(), UploadFile(), and BeginUploadFile() calls and compare the intermittent failure in the Azure Function with successful local runs. Capture the complete SSHException context and connection or transfer conditions; done means identifying a reproducible cause and documenting or validating a fix for the intermittent channel closure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp
- Domain
- cloud, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100