Clones fail with suboptimal pack - out of memory

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

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:

1 2 3 4 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

    1 2 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:

Updated on March 24, 2025

Still need help?

The Atlassian Community is here for you.