libgit2sharp icon indicating copy to clipboard operation
libgit2sharp copied to clipboard

Cannot push:failed to write chunk header

Open esynctraining opened this issue 7 years ago • 4 comments

I used 0.25.0-preview-0073 with Core

`using (var repo = new Repository(RepositoryPath)) { // Stage the file Commands.Stage(repo, "*");

// Create the committer's signature and commit
Signature author = new Signature("translator", "example.com", DateTime.Now);
Signature committer = author;

// Commit to the repository
Commit commit = repo.Commit($"Resx files updated {DateTime.Now}", author, committer);

Remote remote = repo.Network.Remotes["origin"];
var options = new PushOptions
{
    CredentialsProvider = (_url, _user, _cred) =>
       new UsernamePasswordCredentials
       {
           Username = _settings.GitUserName,
           Password = _settings.GitPassword
       }
 };
 repo.Network.Push(remote, @"refs/heads/master", options);

} `

And I get error when I try to push a large file ( > 1GB)

LibGit2Sharp.LibGit2SharpException: failed to write chunk header: The connection with the server was terminated abnormally

at LibGit2Sharp.Core.Ensure.HandleError(Int32 result) in C:\projects\libgit2sharp\LibGit2Sharp\Core\Ensure.cs:line 136 at LibGit2Sharp.Core.Proxy.git_remote_push(RemoteHandle remote, IEnumerable1 refSpecs, GitPushOptions opts) in C:\projects\libgit2sharp\LibGit2Sharp\Core\Proxy.cs:line 2225 at LibGit2Sharp.Network.Push(Remote remote, IEnumerable1 pushRefSpecs, PushOptions pushOptions) in C:\projects\libgit2sharp\LibGit2Sharp\Network.cs:line 372 at VA.Services.BitbucketService.<Upload>d__4.MoveNext() in D:\Sources\VA\migrationTool\VA.Services\BitbucketService.cs:line 88

With small file works fine

esynctraining avatar Jan 17 '18 09:01 esynctraining

Same here

omrishsu avatar Sep 22 '18 02:09 omrishsu

Did anyone find a solution to this problem?

adameashraf avatar Oct 24 '18 18:10 adameashraf

I have the following scenario:

  • a webapp in Azure trying to push big commit (320MB) to Azure DevOps
  • the app throws this thread's exception after 10m
  • if I try the same operation in my local the push is succesful.

What can I try to debug this situation?

ecordovas avatar Jun 01 '19 17:06 ecordovas

I have the same problem. This is apparently still a bug in the push operation.

bevcope avatar Mar 23 '23 20:03 bevcope