ohmyzsh: git clone fails with transfer.fsckobjects = true: zeroPaddedFilemode

Running Git 2.7.4:

% git clone https://github.com/robbyrussell/oh-my-zsh.git .oh-my-zsh 
Cloning into '.oh-my-zsh'...
remote: Counting objects: 15624, done.
error: object 2b7227859263b6aabcc28355b0b994995b7148b6: zeroPaddedFilemode: contains zero-padded file modes
fatal: Error in object
fatal: index-pack failed

Workaround: use the tarball/zip archive…

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 16 (11 by maintainers)

Commits related to this issue

Most upvoted comments

I’ve found the official documentation for that fsck.zeroPaddedFilemode setting, it’s at git-config (look for fsck.<msg-id>).

Now, I’ve seen this setting works when doing a git fsck manually: the error message doesn’t appear again. But it still happens with the fsckobjects = true setting, so I have the suspicion that there’s a bug here.

Investigating further…

@johnramsden:

It becomes a huge problem when attempting to use automation tools such as package managers or built systems.

I have been using this in my scripts (see for example install_ohmyzsh.sh#L70):

git clone --depth=1 https://github.com/robbyrussell/oh-my-zsh.git

It does not clone the whole repo history, just the latest version, which should be ok anyway for automated installs. (I am quite sure I did not come up with this myself, but I am unable to retrace it to the original source).

Alternatively there is the command suggested in this StackOverflow answer, pointed out above by @kevinburke:

git clone --config transfer.fsckobjects=false \
    --config receive.fsckobjects=false \
    --config fetch.fsckobjects=false \
    git://github.com/robbyrussell/oh-my-zsh.git

Ok, so it seems there’s a bug on git’s behavior when fetching: https://github.com/holman/dotfiles/issues/231#issuecomment-210259671.

I can’t do anything else but recommend you to override those *.fsckobjects settings (set them to false), in just the OMZ repository at least.

cd $ZSH; git config transfer.fsckObjects false

There’s no other solution to that annoying error that doesn’t involve everybody’s OMZ setups catching fire.

FWIW, if you want to work around this and leave your global git config alone, you can follow these instructions: http://stackoverflow.com/q/41029654/329700

I don’t know the internals but this may hit other users, see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=813157 for the discussion where Debian is considering making this the default. So unfortunately this could become a wider problem.

The fsck.zeroPaddedFilemode = ignore setting didn’t work for me with transfer.fsckobjects set to true, sorry. Git 2.7.4. man git says that the general fsck.msg-id setting is supported for this kind of use case but I can’t find any online cites of the specific solution you suggested so maybe the message ID is wrong? Or 2.7.4 is broken in some way? How did you verify your solution, and with what Git version?

% git clone -c fsck.zeroPaddedFilemode=ignore https://github.com/robbyrussell/oh-my-zsh.git /tmp/o
Cloning into '/tmp/o'...
remote: Counting objects: 15624, done.
error: object 2b7227859263b6aabcc28355b0b994995b7148b6: zeroPaddedFilemode: contains zero-padded file modes
fatal: Error in object
fatal: index-pack failed