libgit2 / libgit2/libgit2sharp

Push fails with "No error message has been provided by the native library" when trying to push large files

Đang mở
#2,012 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
C#
Star
3.5k
Fork
925
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

I am not able to push large files to origin with pre-release 0.27.0-preview-0182. The same code worked with latest stable release
Ending up with exception and message: "No error message has been provided by the native library"
Tried to push a new json file which is 18MB large.
I did not check what file size is the breaking point, but if needed can try to investigate that too.

Adding reproduction steps with snippets of my code, hope this is enough, otherwise please ask for more.

Reproduction steps
  1. Clone repository and create branch
Repository.Clone(githubRepoUrl, $"./{folderName}", 
  new CloneOptions { CredentialsProvider = _gitHubClientWrapper.CredentialsProvider() });

using (var repo = new Repository($"./{folderName}"))
{
  repo.CreateBranch(newBranchName);
}
  1. Create large file. I just generated a large list of objects serialized into json. Got around 18mb of json file.
  2. Commit and push the branch to origin
using (var repo = new Repository($"./{folderName}"))
{
	Branch branch = repo.Branches[newBranchName];
	Commands.Checkout(repo, branch);
	Commands.Stage(repo, "*");
	Signature committer = new Signature("Github bot", "@bot", DateTime.Now);

	try
	{
		repo.Commit("Comit message", committer, committer);
		Remote remote = repo.Network.Remotes["origin"];
		repo.Branches.Update(branch, b => b.Remote = remote.Name, b => b.UpstreamBranch = branch.CanonicalName);
		repo.Network.Push(branch, new PushOptions
		{
			CredentialsProvider = _gitHubClientWrapper.CredentialsProvider(),
		});

	}
	catch (EmptyCommitException)
	{
		_logger.LogInformation("There's nothing to commit.");
		return;
	}
}
Expected behavior

Push is successful.

Actual behavior

Push fails with exception and message "No error message has been provided by the native library"

Version of LibGit2Sharp (release number or SHA1)

0.27.0-preview-0182

Operating system(s) tested; .NET runtime tested

Windows11, .NET 7

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Tái hiện lỗi bằng cách clone một repository, tạo một tệp JSON khoảng 18 MB, commit tệp đó và gọi repo.Network.Push với PushOptions được hiển thị trên 0.27.0-preview-0182; so sánh các bước tương tự với bản phát hành ổn định mới nhất. Truy vết các entry point của Repository và repo.Network.Push, đồng thời xác định liệu hồi quy nằm ở phần xử lý push hay ở việc báo cáo lỗi native; được xem là hoàn tất khi push tệp lớn thành công hoặc báo cáo một lỗi hữu ích, có thể hành động.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
csharp, git
Lĩnh vực
devtools
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.