Joe Joe - 1 year ago 234
Git Question

The remote end hung up unexpectedly while git cloning


client repeatedly fails with the following error after trying to clone the repository for some time.

What could be the issue here?

Note: I have registered my SSH key with the GIT hosting provider

Receiving objects: 13% (1309/10065), 796.00 KiB | 6 KiB/s
fatal: The remote end hung up unexpectedly

Answer Source

With this kind of error, I usually start by raising the postBuffer size:

git config --global http.postBuffer 524288000

# some comments below report having to double the value:
git config --global http.postBuffer 1048576000

From the git config man page:


Maximum size in bytes of the buffer used by smart HTTP transports when POSTing data to the remote system.
For requests larger than this buffer size, HTTP/1.1 and Transfer-Encoding: chunked is used to avoid creating a massive pack file locally. Default is 1 MiB, which is sufficient for most requests.

Even for clone, that can have an effect, and in this instance, the OP Joe reports:

[clone] works fine now

Note: if something went wrong on the server side, and if the server uses Git 2.5+ (Q2 2015), the error message might be more explicit.
See "Git cloning: remote end hung up unexpectedly, tried changing postBuffer but still failing".

Kulai (in the comments) points out to this Atlassian Troubleshooting Git page, which adds:

Error code 56 indicates a curl receive error of CURLE_RECV_ERROR which means there was some issue that prevented the data from being received during the clone process.
Typically this is caused by a network setting, firewall, VPN client, or anti-virus that is terminating the connection before all data has been transferred.

It also mentions the following environment variable, order to help with the debugging process.

# Linux
export GIT_TRACE=1

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download