Cannot delete an internal directory user in Bamboo with error - The user directory doesn't allow this operation.
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
Cannot delete an internal directory user in Bamboo with the following error appear in GUI
1
2
3
Can't delete user 'testuser'. The user directory doesn't allow this operation.
Please try reloading the page.
Environment
The solution in this article has been tested on version 8.1.2 but may work with other versions of Bamboo.
Diagnosis
Confirm the user directories on Bamboo Server to confirm the user directory is enabled using the below query:
Verify user directories on Bamboo server
1
SELECT * FROM cwd_directory;
Verify the user information on Bamboo database to confirm that the user is created in internal database:
Verify user directories on Bamboo server
1
SELECT * FROM cwd_user WHERE user_name = 'testuser';
Cause
One of the limitations of the current internal user management is that users that have added labels or comments can't be removed.
Solution
Search through the comments and labels made by a user using the below SQL query:
Search comments or labels created by a user
1
2
SELECT * FROM USER_COMMENT WHERE USER_NAME='<username>';
SELECT * FROM BUILDRESULTSUMMARY_LABEL WHERE USER_NAME='<username>';
If found, you can delete them using the below SQL query:
Delete comments or labels
1
2
DELETE FROM USER_COMMENT WHERE USER_NAME='<username>';
DELETE FROM BUILDRESULTSUMMARY_LABEL WHERE USER_NAME='<username>';
ℹ️ Replace <username> with the username you cannot delete
⚠️Always take a database backup before performing manual update or deletion queries.
The following bug BAM-25932 Deleting a Bamboo Internal directory user gives exception - The user directory doesn't allow this operation is reported for working on a permanent solution.
Was this helpful?