Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

NullReferenceException when uploading large xml file

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

Nessuno ha ancora preso questa issue.

Valutazione

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

Direzione di ricerca

Inizia da Renci.SshNet.SftpClient.InternalUploadFile, usando lo stack trace fornito come punto di ingresso. Riproduci un caricamento XML di grandi dimensioni tramite task sul server e confrontalo con file piccoli ed esecuzioni locali; il lavoro è concluso quando la causa del caricamento incompleto e della NullReferenceException è stata identificata ed è disponibile una correzione verificata o una copertura di regressione.

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

Descrizione

System.AggregateException: One or more errors occurred. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Renci.SshNet.SftpClient.InternalUploadFile(Stream input, String path, Flags flags, SftpUploadAsyncResult asyncResult, Action`1 uploadCallback)
--below is our internal stack
at ....UploadFile(Stream input, String path)
at ......Common.Ftp.SftpClient.Upload(Byte[] buffer, String fileName, String remoteFolder, Boolean useDefaultRemoteFolder, Boolean usePassive)
at ......Common.Ftp.FtpService.UploadFileToSftp(Byte[] file, String remotePath, String fileName)
at System.Threading.Tasks.Task.Execute()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait(TimeSpan timeout)
at

Hi

When we try to upload large xml file through tasks in our server, NullReferenceException pops up and made the uploaded file incomplete. The file indeed was uploaded, but it was broken and missed half of the file content.

This issue can not be reproduced in our dev local and only occurred in server, also it won't happen for small xml files(with same encoding and path)

SSH version we used in our company here is 2020.0.2

Could you pls advise what's the possible root cause for it since we could get further callstack details for it

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

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.

Altre issue di sshnet/SSH.NET

Tutte le issue di sshnet/SSH.NET

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.