libgit2 / libgit2/libgit2sharp

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

Aperta
#2,012 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
C#
Stelle
3.5k
Fork
925
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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

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

Riproduci il fallimento clonando un repository, creando un file JSON di circa 18 MB, eseguendo il commit e chiamando repo.Network.Push con le PushOptions mostrate su 0.27.0-preview-0182; confronta gli stessi passaggi con l’ultima versione stabile. Traccia i punti di ingresso di Repository e repo.Network.Push e determina se la regressione si trova nella gestione del push o nella segnalazione degli errori nativi; il lavoro è completato quando il push del file di grandi dimensioni riesce o segnala un errore utile e azionabile.

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

Valutazione

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

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.