$exception {"Failure"} Renci.SshNet.Common.SshException I get exception on downloading the files
Nessuno ha ancora preso questa issue.
- Lingua principale
- C#
- Stelle
- 4.4k
- Fork
- 993
- Merge medio
- 9g 21h
- PR unite (30g)
- 1
Descrizione
Hi team
I'm using the below code for downloading files from the SFTP server.
` DataLakeFileSystemClient fileSystemClient = new DataLakeFileSystemClient(connectionString, "container");
DataLakeDirectoryClient processDirectory = fileSystemClient.GetDirectoryClient("testProcessDir");
using (var sftp = new SftpClient(host, username, password))
{
sftp.Connect();
var files = sftp.ListDirectory(remoteDirectory);
foreach (var file in files)
{
string remoteFileName = file.Name;
if (!file.Name.StartsWith(".") && (DateTime.UtcNow - file.LastWriteTimeUtc).TotalHours < 1)
{
DataLakeFileClient newfile = processDirectory.CreateFile(file.Name);
using (Stream stream = newfile.OpenWrite(overwrite: true))
{
sftp.DownloadFile(remoteDirectory + remoteFileName, stream);
}
}
}`
After downloading 1 or few files it gives execption as $exception {"Failure"} Renci.SshNet.Common.SshException
at Renci.SshNet.Sftp.SftpFileReader.Read()
at Renci.SshNet.SftpClient.InternalDownloadFile(String path, Stream output, SftpDownloadAsyncResult asyncResult, Action1 downloadCallback)
at Renci.SshNet.SftpClient.DownloadFile(String path, Stream output, Action1 downloadCallback)
at _111111111111.Program.DownloadAll() in D:\workspace\ExampleProjects\111111111111\111111111111\Program.cs:line 75
at _111111111111.Program.Main(String[] args) in D:\workspace\ExampleProjects\111111111111\111111111111\Program.cs:line 15
Please suggest something with which I could download all the files.
Thanks,
Mukesh
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con lo stack trace in Renci.SshNet.Sftp.SftpFileReader.Read() e SftpClient.DownloadFile(), quindi esamina il chiamante alle righe 75 e 15 di Program.cs. Riproduci il ciclo con un server SFTP equivalente e determina perché il download di più file genera SshException("Failure"); il lavoro è terminato quando viene identificata una causa riproducibile o i dettagli diagnostici necessari.
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
- Da chiarire
- Idoneità per principianti
- 22/100