8

sorry to trouble you genius..

i am coming across a common problem that there is many solution on stack overflow, but those solution all does not suit for me. So at the end i have no choice but ask help from you genius again on the stack overflow.

  1. i have a cloned repository on my server.
  2. when i changed some code on my development machine and push to the remote git repository, everything worked smoothly.
  3. the error start from when i pull data from the server. On the server, i command git pull the following error show up:

remote: Counting objects: 66, done. remote: Compressing objects: 100% (65/65), done. Connection to bitbucket.org closed by remote host. fatal: The remote end hung up unexpectedly fatal: early EOF fatal: unpack-objects failed

  1. i tried this sloution: fatal: early EOF fatal: index-pack failed but i get error form step 2 git clone --depth 1 <repo_URI>

the error is :

Cloning into 'sinolife'... remote: Counting objects: 2783, done. remote: Compressing objects: 100% (2199/2199), done. 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

  1. I also get a solution that there isn't enough swap memory. so i create a swap memory. At the beginning the swap is 0...After i config the swap, the free -m result is:

         total       used       free     shared    buffers     cached
    

Mem: 993 930 63 0 21 57

-/+ buffers/cache: 851 142

Swap: 499 16 483

but i also get the some error.

$git pull

remote: Counting objects: 66, done.
remote: Compressing objects: 100% (65/65), done.
Connection to bitbucket.org closed by remote host.
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: unpack-objects failed

$git clone

Cloning into 'sinolife'...
remote: Counting objects: 2783, done.
remote: Compressing objects: 100% (2199/2199), done.
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
  1. also The remote end hung up unexpectedly while git cloning, follow the step ,but error come again. the following is my git config file

$git config -l

http.postbuffer=524288000
user.email= myemail@myemail.com
core.compression=0
core.compression=-1
core.compression=-1
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.compression=-1
core.packedgitlimit=512m
core.packedgitwindowsize=512m
remote.origin.url= my repository
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
pack.deltacachesize=2047m
pack.packsizelimit=2047m
pack.windowmemory=2047m
  1. my environment:

    uname -a

    Linux VM-87-192-ubuntu 3.13.0-86-generic #131-Ubuntu SMP Thu May 12 23:33:13 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

    git --version

    git version 2.11.0

8. hope some one can help me give my some hint.

9. question abstract

i have a git repository, and already cloned in the server, but when git pull

remote: Counting objects: 66, done.
remote: Compressing objects: 100% (65/65), done.
Connection to bitbucket.org closed by remote host.
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: unpack-objects failed

when start a new clone git clone

Cloning into 'sinolife'...
remote: Counting objects: 2057, done.
remote: Compressing objects: 100% (1740/1740), done.
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
Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
wuxianghou
  • 93
  • 1
  • 1
  • 5
  • 1
    Your output shows that you are using bitbucket.org for your remote; have you contacted their support? They seem to get this a lot so may have more experience dealing with this error, and surely they're better positioned than us to troubleshoot a connection with their servers – Mark Adelsberger Jan 11 '17 at 14:07
  • @Mark Adelsberger thank you for your advice..I can clone the repository on my development machine, there for, i conclude there is no connection issue to the server.. any way i will contact bitbucket for more help, thanks... – wuxianghou Jan 11 '17 at 14:31
  • 4
    @wuxianghou Have you solve your problem? I got this problem too... – Yuga Jun 26 '17 at 06:50
  • I use [gitblit](http://gitblit.com/) get the same issue so often(`fatal: unpack-objects failed`). Previous time pulling changes to complete new branch helped me. But this time I cannot get rid of it(( – valijon Oct 10 '19 at 11:08
  • Ok, I managed to solve it again: jump to your previous commit. create there temporary branch. `git pull origin your_branch`. `git checkout your_branch` and pull again. I don't know why, but it solves the issue – valijon Oct 10 '19 at 11:13
  • @valijon can you please post an answer? If you solved this problem, your solution should not (just) be a comment. – Mike 'Pomax' Kamermans Jul 10 '20 at 22:36

3 Answers3

3

You can fix the problem by choosing EITHER of these to increase postBuffer size:

In terminal:

$ git config --global http.postBuffer 1048576000

OR modify gitconfig file:

$ vim ~/.gitconfig # open gitconfig with ur favorite IDE

Add the following lines to at the end of gitconfig file:

[http]
        postBuffer = 1048576000
Farid Alijani
  • 839
  • 1
  • 7
  • 25
  • 1
    thank you. This solved the problem for me, though I had to use a bigger number than was mentioned in your answer. – fountainhead May 03 '22 at 09:40
0

Try to extend the postbuffer of http to double? That works for me.

git config --global http.postBuffer 1048576000
Mystic Lin
  • 365
  • 4
  • 15
0

Some Times Network Connection Matters. you need to make sure whether you have proper internet connection or not. I too faced the same issue and resolved it via changing my Interne

Rishabh Gupta
  • 119
  • 1
  • 5