28

I'm able to pull but Unable to git push

$ git push -u origin master
Counting objects: 2031, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (1367/1367), done.
remote: fatal: early EOF
Writing objects: 100% (2031/2031), 34.33 MiB | 100.00 KiB/s, done.
Total 2031 (delta 659), reused 1056 (delta 324)
error: unpack failed: index-pack abnormal exit
To https://*********.git
 ! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to 'https://*********

I have tried :

  • git repack
  • git git config --global core.compression 0

I have already referred to the following links but nothing is working for me

Git push failed - unpack-objects abnormal exit

fatal: early EOF fatal: index-pack failed

Git push fails with "fatal: early EOF" when PUSHing but only on one file

Other git users are able to push to the same repo, usually this problem occurs when in commit large no of new files are added

None of the above solutions have helped and I'm stuck.

Thanks

EDIT

Also tried

[core] 
packedGitLimit = 512m 
packedGitWindowSize = 512m 
[pack] 
deltaCacheSize = 2047m 
packSizeLimit = 2047m 
windowMemory = 2047m
1

10 Answers 10

26

Try using the --no-thin option of git push.

$ git push --no-thin

From https://git-scm.com/docs/git-push:

--[no-]thin

These options are passed to git-send-pack[1]. A thin transfer significantly reduces the amount of sent data when the sender and receiver share many of the same objects in common. The default is --thin.

Our team has struggled with this same issue and has tried all of the fixes/workarounds mentioned in the OP links, with various success. What works for some didn't work for others, nor would it work for the same person a few months later. So far, the --no-thin option has been working well.

Sign up to request clarification or add additional context in comments.

Comments

3

Maybe the entire folder permissions are not set, chown -R git:git /your path

Comments

1

The problem comes from the version of NFS your Vagrant NFS mount. You have to use version 4 which is not available in Windows. Use temporarily default synced folders on Windows instead of NFS.

Comments

1

Unpacker error means the owner of remote directory is not compatible with current user that git use its permission not set correct. It usually helps:

 sudo chown -R yourOwner:yourOwner yourgitDirectory

Comments

1

I would like to add one more possible source of error. If you run your git server on some small memory device, it is very likely for it to run out of memory during unpacking large files.

If you encounter this error, you might want to use dmesg command on linux to see if you have something similar to this:

Out of memory: Killed process 102198 (git) total-vm:344988kB, anon-rss:231720kB, file-rss:0kB, shmem-rss:0kB, UID:1001 pgtables:516kB oom_score_adj:0

If you do have this out of memory situation, you probably need consider setup a large swap file for git server.

1 Comment

Among a plethora of answers, server memory is the main source of issues for serverside git failures with pull or push requests. During client pull server memory can be controlled with core.bigFileThreshold or pack.windowMemory in the server repository config file. During client push the server will do git unpack-objects, and the memory allocation will depend on the largest file in the pack. I don't understand that after so many years this hasn't been made more efficient in git. The bottom line is that in that case increasing physical or swap memory is the only solution.
1

This Works for me totally fine, git push --no-thin alone was giving the same error.

git gc 
git push --no-thin

Comments

0

If you are the git administrator, connect on the server hosting the git repository. There, go into objects folder. There should have folder with root owner, which is your problem.

Change folder owner to be equal to other on the folder (not root).

2 Comments

I'm not the git administrator , other git users are able to push to the same repo, usually this problem occurs when in commit large no of files are added
Ok. I knew this issue with root rights but not with number of files. Sorry. You can split your commit to work around the issue
0

In my case, I was on a shared hosting, I just asked my hosting company to reset my "Number Of Processes" which wast about 90% full and it worked for me. Maybe this might help somebody

Comments

0

It is a very old topic, but I recently run into a git push problem with very similar error message, howerwer, not exactly the same.

In my case, the error message was the following:

Enumerating objects: 445, done.
Counting objects: 100% (445/445), done.
Delta compression using up to 8 threads
Compressing objects: 100% (363/363), done.
remote: fatal: write error: Bad file descriptor
error: remote unpack failed: index-pack abnormal exit
To ssh://****************.git
 ! [remote rejected] test -> test (unpacker error)

I found a solution to this error message, so I leave it here, maybe it can help for others. In my case, the main git repository, where I tried to push, had a lot of copied repositories from other sources as subfolders. I have already deleted the .git folders an .gitignore files in the subfolders, but it wasn't enough, I encountered the same error again. I found out that you have to delete all the CHANGELOG.md files too, because it can make such anomalies like this.

If, in your case, it isn't the solution, maybe it can spare some time for others.

Comments

0

In my case this seems to have been a permissions issue, possibly caused by adding external files to the directory that my git user wasn't the owner of. To solve this on Windows, you'll need to take ownership of all the files in your git directory. The easiest way to do this is using the invaluable Take Ownership context menu item. If you don't already have it installed, you should, specifically the Add_Shift+Right-Click_Take_Ownership_to_context_menu.reg version - I've lost count of how many times it's saved me.

After downloading and installing the registry file by double-clicking it, hold the Shift button while right-clicking on your Git folder's parent directory, then click the Take ownership menu item that appears. Although this opens several instances of CMD that run concurrently, it will still take a few minutes depending on the size of your folder - and subfolders like node_modules and cache data like Laravel's storage in particular add a lot of overhead. Once the commands have finished running and all the CMD windows have closed themselves, run git push again as normal - it should now succeed without errors.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.