0

I am unable to pull or fetch code on one of my project.

Command Issued :

$ git pull origin master

Error Messages :

fatal: internal server error
remote: internal server error
fatal: protocol error: bad pack header

Though, I am able to pull patch on the same project and pull & fetch origin master on other project.

Where I can see more detailed logs? And how can I resolve this issue?

[EDIT]

git fsck output :

   Checking object directories: 100% (256/256), done.
   Checking objects: 100% (5155/5155), done.
   dangling blob 788d9159c3698bfcc753969387873989ac68d22f
   dangling blob d554a3844da9322ad6e0789dbec37d7679e9868c
   dangling blob e5d5dd07a27033814fb35be2ee28f38fdc13baca
   dangling blob 2116ab3d9b64d5d609b8ccc309970aeecb9bed2f
   dangling blob 07182a7ec9d47649f46a53c0d356c1b099086ed2
   dangling blob 7358ba2f4a5577183450c36491cf0a8221d4fdf1
   dangling blob 0f9d09248f5694d94d726b77c43bca5fa599ce99
   dangling blob eab7222fdb583fd3b80f693fb7422bfba7360644
   dangling blob c9384efaec1e9cd42e352de79c413140b90037de
   dangling blob 03bd2e76f8a30936d14af97039e2feb4110c87ac

config file :

   [core]
         repositoryformatversion = 0
         filemode = false
         bare = false
         logallrefupdates = true
         symlinks = false
         ignorecase = true
   [remote "origin"]
         url = ssh://<userId>@review.quicinc.com:29418/<projectName>
         fetch = +refs/heads/*:refs/remotes/origin/*
   [branch "master"]
         remote = origin
   merge = refs/heads/master
gambit
  • 85
  • 2
  • 10

3 Answers3

2

This error occurs because you've run out of memory on the server. Maybe because of large files or because of virtual limits.

Try this commands and then try again. Here's the reference.

git config --global pack.windowMemory "100m"
git config --global pack.packSizeLimit "100m"
git config --global pack.threads "1"
Harshal Yeole
  • 4,812
  • 1
  • 21
  • 43
1

I can see dangling blobs but that should be fine. May be the Repo got corrupt, you can try to fix that in case that's the issue. Keep a backup of the config file,

$ cd project
$ cp .git/config .git/config.backup
$ git remote remove origin

Above step is just to relink you repo again.

$ mv .git/config.backup .git/config

Now get all the content again, don't use pull here

$ git fetch

Now execute

$ git pull origin master
Bijendra
  • 9,467
  • 8
  • 39
  • 66
0

The issue is resolved now.

Loose object pruning caused the problem and leading to repo corruption.

The issue is resolved by reverting the tip to the HEAD to previous gerrit at server.

Thanks all for your response.

gambit
  • 85
  • 2
  • 10