Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git clone ends with Broken Pipe

Tags:

git

git-clone

ssh

I have a very big git repository and want to clone from it. On one machine (ArchLinux with git version 2.2.2) everything works fine...

Cloning into 'foo'
remote: Counting objects: 2372505, done
remote: Compressing objects: 100% (456914/456914), done.
Receiving objects: 100% (2372505/2372505), 3.81 GiB | 6.20 MiB/s, done.
...

... but on another machine (Ubuntu with git version 2.3.0, also tried with 1.7.0.4), I only see the following:

Cloning into 'foo'
remote: Counting objects: 2372505, done.

and after some hours, it ends with

Write failed: Broken pipe
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

Any idea what's the problem?

By the way:

  • The remote end is a gitlab server.
  • I'm using SSH in both cases.
  • The first (working) machine is connected via VPN (100 MBit/s).
  • The second (non-working) machine is in the same gigabit-subnet as the gitlab server.
like image 334
Ethan Leroy Avatar asked Feb 09 '15 07:02

Ethan Leroy


2 Answers

Solved! I used a DNS name for connecting to the gitlab server, and what I didn't know: This name has been resolved to the external IP of the same server, so, the server and the client were not in the same subnet.

So, the client connected to the external IP of the server, so the firewall had to NAT it back to the server.

The solution was quite simple: I just added the hostname with the internal ip to the client machine's /etc/hosts file and from that on the clone worked like a charm.

like image 117
Ethan Leroy Avatar answered Sep 21 '22 17:09

Ethan Leroy


Regarding GitLab, this thread mentions (for a similar error)

I solved that issue (unable to checkout large repo' via HTTP) by editing git/config/unicorn.yml and setting timeout to 120, when it was previously 30, and restarting the gitab service.

If this is not only about the Git hosting server, but about Git itself, then you have other options to try:

  • The remote end hung up unexpectedly while git cloning
  • fatal: early EOF fatal: index-pack failed
like image 42
VonC Avatar answered Sep 20 '22 17:09

VonC