Bitbucket cannot clone repository "fatal: early EOF fatal: index-pack failed"
Asked Answered
M

7

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.

Maroc answered 26/8, 2016 at 7:5 Comment(6)
You can check the help at #21278306Islington
Possible duplicate of fatal: early EOF fatal: index-pack failedSkylight
@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..Maroc
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?Landy
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.Jackquelinejackrabbit
any solution so far? I'm in the same stage and #21278306 didn't work for me either?Monogram
M
1

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 [email protected] 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.)

Moist answered 29/3, 2023 at 17:15 Comment(0)
O
0

Run git config --global core.compression 9 before git clone [email protected]:******/*******.git

Olszewski answered 17/7, 2017 at 6:12 Comment(1)
Have you actually tested this before posting it here?Misnomer
T
0

I fix this issue running: "git fetch origin"

Tailpiece answered 3/8, 2017 at 13:55 Comment(1)
fetch wouldn't work, because repository is not cloned yet.Barker
U
0

I solved it by using following command in linux.

git fetch origin
git pull origin master
Uella answered 30/1, 2021 at 12:50 Comment(0)
O
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.

Okapi answered 31/1, 2023 at 23:54 Comment(0)
D
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!

Dud answered 12/2, 2023 at 11:7 Comment(0)
D
-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>
Disfavor answered 14/9, 2017 at 17:7 Comment(1)
The poster is interested in making this work for ssh, so the http post buffer doesn't factor into this.Jackquelinejackrabbit

© 2022 - 2024 — McMap. All rights reserved.