21

I am trying to clone my repository using ssh from bitbucket but whenever i clone the repository i get:

Connection to bitbucket.org closed by remote host.00 KiB/s
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

During cloning repositories of small size it gets cloned but when cloning bigger size repositories gives the error. I also have tried this method:

fatal: early EOF fatal: index-pack failed

but no luck. Could any one help with the issue?

Note:

Http cloning works fine, but that doesn't work in my scenario. I need to clone using only ssh.

Community
  • 1
  • 1
PaladiN
  • 4,625
  • 8
  • 41
  • 66
  • You can check the help at http://stackoverflow.com/questions/21277806/fatal-early-eof-fatal-index-pack-failed – pedrorocha Dec 27 '16 at 17:32
  • Possible duplicate of [fatal: early EOF fatal: index-pack failed](http://stackoverflow.com/questions/21277806/fatal-early-eof-fatal-index-pack-failed) – Jannie Theunissen Mar 15 '17 at 13:56
  • 2
    @JannieT as I have already told the method doesn't work. How does it becomes duplicate of that issue?? Also this post has been here for almost 6 months from now.. – PaladiN Mar 15 '17 at 14:00
  • 1
    I suspect you are having network issues. Your paste of the output is missing parts. How far did it get with `Receiving objects`? What was the download speed before it stoped? To find out if it is a network issue: Does this work on another network? Does it work to download big files from Bitbucket, e.g. the zip file of the repo content? Does downloading big files from elsewhere work? – Jan Zerebecki May 07 '17 at 17:05
  • Try adding `GIT_TRACE_PACKET=1` to the front of your clone command: `GIT_TRACE_PACKET=1 git clone ...`. This will print extra information about what is happening at the network level and may give some insight into what is actually failing. – John Szakmeister Sep 14 '17 at 17:11
  • any solution so far? I'm in the same stage and https://stackoverflow.com/questions/21277806/fatal-early-eof-fatal-index-pack-failed didn't work for me either? – Chetan Jan 26 '21 at 18:02

7 Answers7

0

I fix this issue running: "git fetch origin"

Joel Estramil
  • 313
  • 3
  • 9
0

I solved it by using following command in linux.

git fetch origin
git pull origin master
Ahmad Sharif
  • 4,141
  • 5
  • 37
  • 49
0

I also tried the methods in OPs linked post (fatal: early EOF fatal: index-pack failed). I'm also on bitbucket and these also did not work for me. I found the only solution was to downgrade your git version.

I was previously using 2.39.1.windows.2 and downgraded to 2.31.1.windows.1. I did not try any other versions, but this worked for me.

cam.b
  • 127
  • 9
0

It may be happening due to compression issue. So, first turn off compression:

git config --global core.compression 0

Next, let's do a partial clone to truncate the amount of info coming down:

git clone --depth 1 <repo_URI>

If that works, go into the new directory and retrieve the rest of the clone:

git fetch --unshallow 

or, alternatively,

git fetch --depth=2147483647

Now, do a regular pull:

git pull --all

I ran into a similar problem and this helped me. Hope it solves your problem!

salvi shahzad
  • 1,092
  • 12
  • 20
0

The index pack failed because something interrupted the SSH session. Based on the first line of your posted error (Connection to bitbucket.org closed by remote host.00 KiB/s) I'd suspect that something is blocking outbound port 22 connections. That would also explain why HTTPS works; very few firewalls restrict outbound ports 80 or 443.

Are you able to get anything back from ssh -T git@bitbucket.org from that specific account on that specific machine?

(Sorry for the necro, but this popped up as "unanswered", and while a couple comments address the possibility of network issues, none of the answers do.)

Jim Redmond
  • 4,139
  • 1
  • 14
  • 18
-1

Run git config --global core.compression 9 before git clone git@bitbucket.org:******/*******.git

RASEL RANA
  • 2,112
  • 1
  • 15
  • 17
-3

check this https://confluence.atlassian.com/bitbucketserverkb/git-push-fails-fatal-the-remote-end-hung-up-unexpectedly-779171796.html

git config --global http.postBuffer 157286400

git clone <repository>
g00glen00b
  • 41,995
  • 13
  • 95
  • 133
Rodazzzz
  • 1
  • 1