Git clone of GitHub repo fails on macOS

I’m experiencing a git clone failure on macOS, but not Linux or Windows:

$ git clone https://github.com/sqlcipher/sqlcipher.git
Cloning into 'sqlcipher'...
remote: Enumerating objects: 25, done.
remote: Counting objects: 100% (25/25), done.
remote: Compressing objects: 100% (24/24), done.
error: object e35e28f52d20df27561b2780f6b9c86669a9de21: zeroPaddedFilemode: contains zero-padded file modes
fatal: fsck error in packed object

I tried on two different mac laptops: an older one running macOS 10.13 and a newer one running 10.15, had the same failure.

I then tried on a Windows 10 laptop and on a Linux laptop (Ubuntu 20.04) and both clones were successful.

Is there a known problem, or does anyone know what might be the problem?

I am not experiencing this problem on macOS with other GitHub repos, and I’m daily working with quite a few by way of nested submodules.

Hi @michaelb

We have tried cloning the same repository on several macOS machines here, none have presented that issue. As GitHub is the host, maybe they were experiencing an issue during your clone? Would you try again and let us know your results? Additionally, what version of the git client are you using on macOS? If an update is available for your git client, you might try upgrading to see if that changes the behavior.

Hello @developernotes,

On my macOS 10.15 laptop

$ git --version
git version 2.28.0

On my macOS 10.13 laptop

$ git --version
git version 2.27.0

I just tried again, and I am still having the same problem (exact same failure result/output in terminals on both laptops) as reported yesterday.

Hi @michaelb

Can you try running this adjustment in your shell, then attempt a new clone of the repository:

git config --global fsck.zeroPaddedFilemode ignore

I didn’t reply earlier because the problem mysteriously went away, and I assumed that it had been a problem on GitHub’s end, as you originally guessed.

Today it started happening again:

Cloning into '/path/to/sqlcipher'...
error: object e35e28f52d20df27561b2780f6b9c86669a9de21: zeroPaddedFilemode: contains zero-padded file modes
fatal: fsck error in packed object

I tried modifying my global git config as you suggested, but it doesn’t help.

For reasons unknown it doesn’t happen during clones on macOS machines in GitHub Actions.

I noticed this in my global git config:

[transfer]                                                                                                                                                       
      fsckobjects = true

I added it so long ago that I barely remember doing it. After disabling that section of my global config, I was able to clone the sqlcipher repo successfully.

I also removed the [fsck] section I added a few minutes ago per your suggestion and was still able to clone successfully.

As to the true nature of the problem and why it seems to be intermittent… I have no clue.

Hi @michaelb

Thanks for getting back to us about both your global git config and your ability to clone the repo. Glad to hear you are able to proceed without issue now!