Bitbucket fails to start in disaster recovery mode.
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
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
Problem
The following issues are observed in Bitbucket when trying to start in disaster recovery:
- Bitbucket fails to start
Cause
This error is caused by a duplicate value in the database. This might be due to:
- Some corruption in the directory cache.
- Corruption in the database.
Diagnosis - Find duplicated users in the cwd_user table
Diagnosis Query - 1: Find duplicate users in the cwd_user
table that has the same External ID and belong to the same directory:
SELECT directory_id, external_id
FROM cwd_user
GROUP BY directory_id, external_id
HAVING ( COUNT(external_id) > 1)
Diagnosis Query - 2: Find duplicate users in the cwd_user
table that has the same lower_user_name
and belong to the same directory:
SELECT lower_user_name, directory_id
from cwd_user
GROUP BY lower_user_name, directory_id
HAVING (COUNT(lower_user_name) > 1);
Resolution - Deleting the user from the database
Always backup Bitbucket before removing or modifying any data on the database and ensure Bitbucket is shut down.
Once you have completed the above steps, attempt to start Bitbucket to see if the issue has been resolved.
If you continue to experience issues, please contact support.atlassian.com/contact for further help.