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 - This article 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.
*Fisheye および Crucible は除く
要約
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.
環境
Tested on Bitbucket Data Center 8.9.10
Applies to Bitbucket Data Center 8.x
診断
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 Settings → Location (in the end path, you will get the ID of the repository)
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.
原因
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
.
ソリューション
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:
chown -R atlbitbucket:atlbitbucket /var/atlassian/application-data -- please replace the atlbitbucket with valid user if any.
chmod -R 774 /var/atlassian/application-data