12

I've seen a couple of similar questions to this, but haven't been able to solve my problem so am asking again.

I added a load of new files to an existing git-enabled project and am trying to push them up. When I do the push, it compresses them, then writes them, then when it gets to %100 it fails out with this error:

error: index-pack died of signal 9 332.28 MiB | 5712 KiB/s   
error: pack-objects died with strange error
error: failed to push some refs to     '<username>@<my repo location'

Things i have tried so far:

  1. going to the repo and making sure everything is writable, like suggested here

  2. setting the binary -delta option on some filetypes in .gitattributes

  3. moving some of the folders out (and git committing the delete) with a view to adding them back individually later.

I'm kind of out of ideas... :/ Any suggestions? Grateful for any advice - max

EDIT - I've since discovered that this is due to dreamhost killing the push due to excessive memory consumption (i did this by copying my app folder to the repo server on dreamhost and doing the push from there).

I've found some pages, - that talk about a NO_MMAP=1 option in git to help prevent this, but they talk about it in terms of configuring git when it's installed. Can i set this option in an existing git install? Is it part of the config for the git-inited app that's doing the push or is it part of the config for the repo?

EDIT 2 - following the instructions on the page above, I downloaded and made my own local git binaries, with the NO_MMAP=1 option set.

I made sure these were before the dreamhost-installed versions in my path, and "which git" shows my local version, so far so good. But, i get exactly the same problem.

Do i need to do something with my repo to make the NO_MMAP option work, or is the problem something else do you think?

4
  • 2
    Do you maintain the host that you are trying to push to? Signal 9 is a somewhat strong signal to be sending and you need to figure who/what on the remote host is sending that signal to the index-pack process. Checking dmesg or the contents of /var/log on the machine might reveal something.
    – Emil Sit
    Nov 2, 2011 at 18:13
  • What OS is the server on? You could use procmon on windows to see what's happening on the filesystem, etc., or maybe figure out a way to use strace/ltrace on linux or similar systems? Nov 2, 2011 at 18:15
  • @EmilSit - as an experiment i just copied my git app folder to the same server where the repo is, and changed its config to point to the local repo folder, so that my push was just happening on the server and didn't require any http requests. I got this: Yikes! One of your processes (git, pid 7746) was just killed for excessive resource usage. Please contact DreamHost Support for details. As you can see it's a shared dreamhost server (so my colleague doesn't own it as such but he owns that shared bit at least). Nov 3, 2011 at 10:56
  • 1
    Presumably the resource in question is memory. Is there a way to make the push use less memory? Nov 3, 2011 at 10:58

7 Answers 7

9

Sometimes this happens with an enterprise github as well due to load issues. I found a good way is to split the clone into two operations, which makes for lighter load on the server.

First, do a shallow clone: git clone --depth 1 myRepo.git

Next, enter the clone, and get all the rest of the history to make a full clone: cd myRepo && git fetch --unshallow

If you have an old version of git which does not support the --unshallow flag, then you can instead do something like git fetch --depth=1000000 or some other suitably large number.

Some more alternatives are discussed in this blog post: https://blogs.atlassian.com/2014/05/handle-big-repositories-git/

6

Git is somewhat memory intensive for certain operations, trading memory usage to get improved disk or network performance. (See for example some discussion on this other SO question.)

In this case, I think you and your colleagues are effectively doing a different cost trade-off: you are trading off using a professionally managed Git hosting service (such as GitHub or BitBucket) for either perceived financial savings or some other convenience (perhaps deployment?).

My recommendation, if you are not comfortable following the kinds of recommendations on the wiki/blog-post that you've cited, is to move to GitHub or Bitbucket. (I think those posts offer technically accurate solutions, FWIW.) Bitbucket offers free unlimited private repositories so there's no real cost reason to use Dreamhost for your Git hosting.

If you need some sort of deployment solution to go along with the hosting, you can engineer something that takes pushes and automatically updates just the working directory to Dreamhost for hosting, without incurring the full cost of hosting a Git repository (and all of your history) on Dreamhost.

3
  • Thanks Emil. Your answer (not github in particular but "leave dreamhost") is pretty much what i've discovered. I solved the problem by moving the git repo temporarily to the same server that was trying to do the push (a pain in the ass) and dreamhost did actually increase my memory limits after a customer support email, which was cool. But apparently they have installed a new procwatch daemon which is to blame for this in the first place. Nov 4, 2011 at 10:57
  • Thanks for the tip. I increased the memory for my VM and it solved the problem.
    – greg
    Mar 3, 2018 at 10:23
  • I confirm It's RAM related. A tiny machine for CI with .5Gb RAM produced this problem. After upgrading to 1Gb, problem disappeared.
    – laconbass
    Sep 21, 2022 at 17:40
3

Mac Users

In my case I had used brew install git which messed up the git from xcode

Running brew uninstall git fixed the issue

3
  • That seems like a mistake. The Git from homebrew is likely to be a lot better than the Git from Xcode.
    – matt
    Feb 9, 2021 at 22:11
  • Yes, that's true, but I think it was because there was 2 versions of git installed somehow Feb 10, 2021 at 23:50
  • I had this issue when Big Sur updated and I had git installed from homebrew. I had to reinstall Xcode command line tools and remove homebrew git for it to work again.
    – Clay
    Feb 11, 2021 at 21:34
1

If you're using the Dreamhost server to keep bare repositories you can add and commit locally and then rsync your .git directory up to DH. After it finishes go into the server's [repository name].git/config and change core.bare from false to true.

Not sure exactly what you'd do if you want work trees on the server, it hasn't come up for me.

1

I had this problem when I uninstalled Xcode. But reinstalling XCode didn't resolve the issue.

Then fixed it by just running brew uninstall git

0

I had this problem, but mine was caused by problems with the Capfile - capistrano had been updated and the changes were not reflected in the capfile.

Updating the capfile to the latest standards fixed...

0

I ran into this error as well. The solution for me was the increase the memory capacity on my server. After doing so, the error went away.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.