Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

NullReferenceException when uploading large xml file

未关闭
#1,759 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
30/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
csharp
领域
networking

调研方向

从 Renci.SshNet.SftpClient.InternalUploadFile 开始,以提供的堆栈跟踪作为切入点。在服务器上通过任务复现大型 XML 上传,并将其与小文件和本地运行进行比较;当确定不完整上传和 NullReferenceException 的原因,并且有经过验证的修复或回归测试覆盖时,即视为完成。

由索引模型根据 Issue 内容生成。

描述

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

主要语言
C#
星标
4.4k
派生
993
平均合并
9 天 21 小时
30 天内合并 PR
1

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

sshnet/SSH.NET 的其他 Issue

查看 sshnet/SSH.NET 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。