Unable to create repository with error "Operation not permitted fatal: could not set 'core.repositoryformatversion' to '0'" on Bitbucket Data Center

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

While creating a repository we see "chmod on /var/atlassian/application-data/shared-home/data/repositories/18/config.lock failed: Operation not permitted fatal: could not set 'core.repositoryformatversion' to '0'" error in Bitbucket Data Center UI.

Environment

Tested on Bitbucket Data Center 8.9.10

Applies to Bitbucket Data Center 8.x

Diagnosis

Please navigate to the following directories and verify the user name, group name, and permissions on directory and sub-directories including files. For the <repo_id>, go to Bitbucket UI → select the Repository → Repository SettingsLocation (in the end path, you will get the ID of the repository)

1 2 3 a. /var/atlassian/application-data/bitbucket/shared/ and run ls -lart command. b. /var/atlassian/application-data/bitbucket/shared/data/repositories/ and run ls -lart command. c. /var/atlassian/application-data/bitbucket/shared/data/repositories/<repo_id>/ and run ls -lart command.

Cause

This issue generally occurs due to incorrect username, group name, and permissions on directories, sub-directories including files on Bitbucket Home or sub-directories, and files inside Bitbucket Home. This can happen when Bitbucket is started with different users instead of atlbitbucket user.

For example: Bitbucket started with the root user and user and group details retain with the root user instead of atlbitbucket.

Solution

Providing the correct user name, group name and permissions on the directory, sub-directories including files on Bitbucket Home in recursive order should resolve this issue.

To do that, please follow the below example and commands:

1 2 3 chown -R atlbitbucket:atlbitbucket /var/atlassian/application-data -- please replace the atlbitbucket with valid user if any. chmod -R 774 /var/atlassian/application-data

Updated on March 5, 2025

Still need help?

The Atlassian Community is here for you.