Search code examples
gitgitlabgitlab-cigitlab-ci-runner

GitLab and GitLab Runner 15.11 git clone - git checkout - error: fatal: fetch-pack: invalid index-pack output


After upgrading GitLab to v15.11.12 and GitLab Runners to v15.11.1, I have started seeing the following error in some of the jobs which were working fine before: fatal: fetch-pack: invalid index-pack output.

What is the reason for this? Why am I seeing this? It happens on git clone or git checkout.


Solution

  • I have found the following 4 solutions:

    • Increase CPU and/or Memory request and limit for GitLab Runner containers (build, service, and/or helper).
    • Set GIT_DEPTH in the GitLab CI job to 1.
    • Update git configuration as follows before running git checkout or git clone:
      • git config --global core.packedGitLimit 128m
        git config --global core.packedGitWindowSize 128m
        git config --global pack.deltaCacheSize 128m
        git config --global pack.packSizeLimit 128m
        git config --global pack.windowMemory 128m
        git config --global http.postbuffer 5m
        
    • Move out the large files from the git repository and store them somewhere else.