"A directory to use as a work tree for <PROJECT_KEY>/<REPO_SLUG> could not be created" is reported due to insufficient disk space

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

The message "A directory to use as a work tree for <PROJECT_KEY>/<REPO_SLUG> could not be created" is shown while performing the following actions through the Bitbucket UI:

Merging a pull request

The merge can't be completed and will display the message in the "Merge pull request" dialog box:

(Auto-migrated image: description temporarily unavailable)

Editing files through the in-browser editor and committing changes

Changes made through the built-in browser editor are not committed.

A popup error message will show up:

(Auto-migrated image: description temporarily unavailable)

The same message is then displayed in the "Commit file" dialog:

(Auto-migrated image: description temporarily unavailable)

Diagnosis

Bitbucket application logs will show warnings that there is not enough space in the file system. 

Samples would be log entries indicating caching has been temporarily disabled due to insufficient space.

1 2021-01-20 12:30:00,044 WARN [git-hook-callback:thread-13] user *9XYZISx835x1790145x0 10.94.196.14 "POST /scm/PROJECT1/repo1.git/git-upload-pack HTTP/1.1" c.a.util.contentcache.ContentCache 1265: Caching has been temporarily disabled because there is not enough free space on /var/atlassian/application-data/bitbucket/caches/scm/123 (34480000 bytes free)

Cause

For both cases, the actions cannot be completed because there is not enough space in the Bitbucket Home directory to create a new work directory for performing background operations.

Solution

Ensure that there is sufficient disk space in the Bitbucket Home directory.

Updated on March 21, 2025

Still need help?

The Atlassian Community is here for you.