How to fix missing External User Directory in the Bitbucket GUI
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
Summary
The External User Directory in the Bitbucket server is not visible in the GUI but the logs show the user directory is still active and the Users are being synced successfully.
Environment
6.7.1
Diagnosis
- Run the following SQL query this will show all the data related to directory listing in the UI
SELECT * FROM cwd_application INNER JOIN cwd_app_dir_mapping ON cwd_application.id = cwd_app_dir_mapping.application_id INNER JOIN cwd_directory cd on cwd_app_dir_mapping.directory_id = cd.id;
Check if you have a duplicated value on LIST_INDEX column for the CWD_APP_DIR_MAPPING table. This column should not have duplicated values.
SELECT * FROM cwd_app_dir_mapping;
The column should have distinct values from 0 to the number of user directories -1 (e.g 0,1,2 if you have 3 user directories)
id application_id directory_id list_index is_allow_all 65537 1 32769 0 T 262145 1 229377 1 T 753665 1 720899 2 T 753667 1 720897 2 T
Cause
The root cause is still unclear but the issue is the list_index column shouldn't have a duplicate value and fixing the duplicate value will show the missing External directory back on the GUI.
Resolution
Remove the duplicates by updating the LIST_INDEX column. It should have values starting from 0 and then incremented by 1 (example 0,1,2,3,... etc).
UPDATE cwd_app_dir_mapping SET list_index=3 WHERE id=753667;