Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git clone fails with "index-pack" failed?

Tags:

git

clone

So I created a remote repo that's not bare (because I need redmine to be able to read it), and it's set to be shared with the group (so git init --shared=group). I was able to push to the remote repo and now I'm trying to clone it.

If I clone it over the net I get this:

remote: Counting objects: 4648, done. remote: Compressing objects: 100% (2837/2837), done. error: git-upload-pack: git-pack-objects died with error.B/s   fatal: git-upload-pack: aborting due to possible repository corruption on the remote side. remote: aborting due to possible repository corruption on the remote side. fatal: early EOF fatal: index-pack failed 

I'm able to clone it locally without a problem, and I ran "git fsck", which only reports some dangling trees/blobs, which I understand aren't a problem. What could be causing this? I'm still able to pull from it, just not clone. I should note the remote git version is 1.5.6.5 while local is 1.6.0.4

I tried cloning my local copy of the repo, stripping out the .git folder and pushing to a new repo, then cloning the new repo and I get the same error, which leads me to believe it may be a file in the repo that's causing git-upload-pack to fail...

Edit: I have a number of windows binaries in the repo, because I just built the python modules and then stuck them in there so everyone else didn't have to build them as well. If I remove the windows binaries and push to a new repo, I can clone again, perhaps that gives a clue. Trying to narrow down exactly what file is causing the problem now.

like image 484
gct Avatar asked Dec 22 '09 02:12

gct


People also ask

What is git buffer size?

The default is 1MB.

How do I Clone a bitbucket repository in Visual Studio 2022?

Use the start window Open Visual Studio. On the start window, select Clone a repository. Enter or type the repository location, and then select the Clone button. You might be asked for your user sign-in information in the Git User Information dialog box.

What is git fetch -- Unshallow?

Git provides a fetch --unshallow command which solves the problem, so we just need to run git fetch --unshallow in the repository before running r10k. However, some of our (older) GitLab installs don't make shallow clones. Instead, they make full clones with a single detached branch, so we need fetch --all instead.


2 Answers

The way I solved this problem is this: My git daemon is running on windows, and clients are on other computers.

I found a workaround (but it will only work on windows).

Start git daemon with verbose from cmd.exe:

"C:\Program Files\Git\bin\sh.exe" --login -i -c 'git.exe daemon --verbose  ' 

Not tested, if it works directly in git bash. Maybe it will.

Then (before starting any clone, pull, fetch,...) select some text in the window (note: "Quick Edit Mode" must be enabled (can be found in: cmd.exe --> Properties (click the top left corner of your cmd window) --> Edit Options)) in which git daemon runs. That will prevent it from printing any further messages in that window.

When the output thread of git daemon is blocked that way, then the error does not happen

like image 102
Martin Avatar answered Sep 19 '22 14:09

Martin


Does "git gc" complain?

like image 42
Yann Ramin Avatar answered Sep 16 '22 14:09

Yann Ramin