libgit2 / libgit2/libgit2sharp

Exception when pushing to remote

Open
#824 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
3.5k
Forks
925
PR merge metrics
No merged PRs in 30d

Description

I am getting the following exception when pushing to a running git daemon (with receive-pack enabled). the exception only occurs when the daemon is running on a separate machine, not when I run the deamon on the same machine as I am pushing to.

LibGit2Sharp.LibGit2SharpException: Error receiving socket data: An existing connection was forcibly closed by the remote host.

at LibGit2Sharp.Core.Ensure.HandleError(Int32 result)
at LibGit2Sharp.Core.Proxy.git_push_finish(PushSafeHandle push)
at LibGit2Sharp.Network.Push(Remote remote, IEnumerable1 pushRefSpecs, PushOptions pushOptions, Signature signature, String logMessage) at LibGit2Sharp.Network.Push(Remote remote, String pushRefSpec, PushOptions pushOptions, Signature signature, String logMessage) at LibGit2Sharp.NetworkExtensions.Push(Network network, IEnumerable1 branches, PushOptions pushOptions)

the git daemon is run using this command: git daemon --base-path=. --enable=receive-pack --export-all --verbose

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at Network.Push and the git_push_finish call shown in the stack trace. Reproduce the push against a separate machine using the provided git daemon command, compare it with a same-machine push, and trace where the remote closes the connection. Done means the remote push no longer raises this exception and the differing environments are covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, git
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.