Clones fail with suboptimal pack - out of memory

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform Notice: Server and Data Center Only - This article only applies to Atlassian products on the server and data center platforms.

    

Summary

When attempting to clone a repository being hosted via Bitbucket Server/Data Center, the clone fails.

Environment

  • Any version of Bitbucket Server or Bitbucket Data Center
  • Any git version
  • The below error will be printed for any standard git clone command issued via the command line, but the clone will fail for any git client used to complete the clone - though possibly with a different error.
  • It's likely that only certain repositories are impacted (namely large repositories).

Diagnosis

The following can be seen in the console after running the standard git clone command against this repository:

remote: warning: suboptimal pack - out of memory
remote: aborting due to possible repository corruption on the remote side.
fatal: early EOF
fatal: index-pack failed

The above error likely does not occur, however, for smaller repositories - such as a new repository with no files added to it yet.

Cause

The above error can be seen for a variety of reasons, such as a large repository or not enough system resources - namely to where git is unable to create the pack files necessary to complete the clone operation.

Solution

Lower the pack size limit and window memory with the following steps.

  1. Locate the repository on disk. The path to the repository should be in the "Repository Settings" on the repository page in the Bitbucket UI.
  2. Navigate to that location
  3. Run the following

    git config pack.windowMemory 1g
    git config pack.packSizeLimit 2g
  4. If the clone still fails, lower the values until you are able to clone.

These changes will survive Bitbucket restarts.

If you continue to receive an "early EOF" error that doesn't include the previous lines with "suboptimal pack - out of memory", it's recommended you also review the following knowledge article along with the other 'early EOF' errors listed in our Troubleshooting Git documentation:

Last modified on Jan 19, 2021

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.