Clones fail with suboptimal pack - out of memory
Platform Notice: Server and Data Center Only - This article only applies to Atlassian products on the server and data center platforms.
When attempting to clone a repository being hosted via Bitbucket Server/Data Center, the clone fails.
- Any version of Bitbucket Server or Bitbucket Data Center
- Any git version
- The below error will be printed for any standard
git clonecommand 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).
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.
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.
Lower the pack size limit and window memory with the following steps.
- Locate the repository on disk. The path to the repository should be in the "Repository Settings" on the repository page in the Bitbucket UI.
- Navigate to that location
Run the following
git config pack.windowMemory 1g git config pack.packSizeLimit 2g
- 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: