Git clone reports "git upload-pack: aborting due to possible repository corruption on the remote side"

When I clone one repo from remote side:
‘’’
remote: Enumerating objects: 421, done.

remote: fatal: mmap failed: No such device

error: git upload-pack: git-pack-objects died with error.\nfatal: 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
‘’’
How can I to resolve this on server side?

Our server is running on docker with version gitlab-ce:12.0.8-ce.0.

Thanks.

Hi,

somehow the remote repository objects cannot be fetched. The mmap error is misleading (out of memory), it could rather point to a zero byte file or empty directory.

Try checking the project’s repository via https://docs.gitlab.com/ee/administration/repository_checks.html
Also, investigate on the mentioned logs whether to see if the verification worked.

Cheers,
Michael

Thanks Michael. Yes, I run the “git fsck” on the server side, it always reports “git fsck fatal: mmap failed: no such device”. And when I run another repo which is larger than this corruption repo. It’s fine. I have no idea why this happens.

B.R.
Tommy

Hi,

when you say “run” do you mean via CLI command and shell access? If so, I’d suggest to run git gc && git fsck --full too.

And if that does not help, I highly recommend restoring an older version from your backups into a temporary location and checking whether you have a working copy of the past.

Cheers,
Michael

Hi Michael:
Yes, I just run this command via CLI command. However, when I run this command as your suggestion:

I think the only way is to recover the legacy backup. One thing I’m still not confirm, I use the following command from the help doc to do the backup:

Is there any method to only recovery the designed repo from the file such as 1578334980_2020_01_06_12.0.8_gitlab_backup.tar? I know how to recovery the whole repos, but I don’t know how to recovery specified one, could you please give me some advice?

Thanks and BR.
Tommy