A directory exists at the same location when creating repository
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
Symptoms
Creating a repository fails with an error that a directory exists at the same location and the following appears in the atlassian-bitbucket-YYYY-MM-DD.log
:
1
2
2014-09-18 23:16:27,865 DEBUG [http-bio-7990-exec-169] user @1WE6GQ3x1396x14813x0 76eaji 10.10.255.179,127.0.0.1 "POST /projects/PROJ/repos HTTP/1.1" c.a.s.i.w.a.RepositoryAdminController Exception occurred
com.atlassian.bitbucket.repository.IllegalRepositoryStateException: Cannot create repository platform-core at /var/atlassian/application-data/bitbucket/shared/data/repositories/15; a directory exists at the same location
Cause
The sequence number used for the next repository ID has become out of sync between the database and file system.
Resolution
Shutdown Bitbucket Server
Execute the following SQL against your Bitbucket Server database
1 2 3
UPDATE id_sequence SET next_val = (select max(id) from repository) + 20 WHERE sequence_name = 'repository';
Start Bitbucket Server
Was this helpful?