sshnet / sshnet/SSH.NET

MAC Error when SftpClient.DownloadFile(UWP)

Aperta
#1,017 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
C#
Stelle
4.4k
Fork
993
Merge medio
9g 21h
PR unite (30g)
1

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia riproducendo il caso x64 UWP con SftpClient.DownloadFile e confrontalo con SftpClient.OpenRead usando i dettagli forniti del server OpenSSH 7.9. Traccia il fallimento da SftpClient.InternalDownloadFile passando per SftpSession.GetCanonicalPath e RequestRealPath; il lavoro è completato quando l’errore MAC è spiegato e il percorso di trasferimento interessato funziona senza l’eccezione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
csharp
Ambito
networking
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.