sshnet / sshnet/SSH.NET

Unexpectedly reached end of file error downloading file from HP Nonstop

Open
#958 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
4.4k
Forks
993
Avg merge
9d 21h
Merged PRs (30d)
1

Description

Hi together!

I've tried to download some files from a HP Nonstop SFTP server. A few of them I'm not able to download. The following stacktrace will be shown:

Renci.SshNet.Common.SshException: Unexpectedly reached end of file.
   bei Renci.SshNet.Sftp.SftpFileReader.Read()
   bei Renci.SshNet.SftpClient.InternalDownloadFile(String path, Stream output, SftpDownloadAsyncResult asyncResult, Action`1 
downloadCallback)
   bei Renci.SshNet.SftpClient.DownloadFile(String path, Stream output, Action`1 downloadCallback)

The call in my app is:

using (var fileStream = File.Create(localDestinationPath))
    _sftpClient.DownloadFile(remotePath, fileStream);

I can download the same file with WinSCP client or if I switch in my test app to chilkat SFTP lib.

Do you have any idea, what's going wrong?

Best regards
Jochen

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at SftpFileReader.Read and SftpClient.InternalDownloadFile, the entry points named in the stack trace, and reproduce the failure against the HP Nonstop SFTP server and affected files. Done means those files download successfully through SftpClient without the unexpected end-of-file error, with coverage for the regression.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.