MAC Error when SftpClient.DownloadFile(UWP)

オープン
#1,017 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
csharp
領域
networking

調査の方向性

まず、提供された OpenSSH 7.9 サーバーの詳細を使って、SftpClient.DownloadFile で x64 UWP ケースを再現し、SftpClient.OpenRead と比較します。SftpClient.InternalDownloadFile から SftpSession.GetCanonicalPath、RequestRealPath を経由して失敗を追跡します。完了の条件は、MAC エラーの原因が説明され、影響を受ける転送パスが例外なしで動作することです。

索引モデルが issue の本文から書いたものです。

説明

Remote Server Information
Remote SSH Server version: SSH-2.0-OpenSSH_7.9
Remote Operating System distribution name and architecture: Linux aarch64
What kind of access do you have?: Full physical and software access
Does Putty/WinSCP work?: yes

Local Machine Information
Operating System: Windows 10 21H2
.NET SDKs versions installed: 2.1.511, 2.1.801, 5.0.400

Project information
What is your target framework and architecture?: x64 UWP
Is your project multi-threaded/complex?:

Source Code
Sample Code:

Sample Code:
var sftp = new SftpClient(MyIp, MyLogin, MyPassword);
sftp.Connect();
var memStream= new MemoryStream();
sftp.DownloadFile($"/opt/myfile.json", memStream);

Exceptions and Stack Trace/Call Stack:

Renci.SshNet.Common.SshConnectionException: MAC error
   at Renci.SshNet.SubsystemSession.WaitOnHandle(WaitHandle waitHandle, Int32 millisecondsTimeout)
   at Renci.SshNet.Sftp.SftpSession.RequestRealPath(String path, Boolean nullOnError)
   at Renci.SshNet.Sftp.SftpSession.GetCanonicalPath(String path)
   at Renci.SshNet.SftpClient.InternalDownloadFile(String path, Stream output, SftpDownloadAsyncResult asyncResult, Action`1 downloadCallback)
   at Renci.SshNet.SftpClient.DownloadFile(String path, Stream output, Action`1 downloadCallback)
   at RouteLoader2022.Loader.Network.FtpRouteAnalyzer.<>c__DisplayClass0_0.<AnalyzeAsync>b__0() in E:\Repos\RouteLoader2022\RouteLoader2022\Loader\Network\FtpRouteAnalyzer.cs:line 42

File transfer related
Transfer over LAN or Internet?: LAN
File size in bytes: 29876 Bytes
Uploading or Downloading? Downloading
Does remote server have enough space to store the file? Yes
Do you have access to the file being uploaded or downloaded? Yes

Increasingsize of SftpClient.BufferSize doesn't help
When do var readStream = SftpClient.OpenRead and then readStream.Read/ReadByte/ReadAsync same MAC Error exceptions throws

主要言語
C#
スター
4.4k
フォーク
993
平均マージ
9日 21時間
マージ済み PR(30日)
1

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

sshnet/SSH.NET のほかの issue

sshnet/SSH.NET の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。