How to investigate missing users from Bamboo Internal directory
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 purpose of this article is to provide steps to investigate missing users from Bamboo internal directory. Please note this page is only for users which are created in Bamboo internal directory and the below steps are not applicable for users coming from external directory like ( Ldap, Azure, Crowd ) etc.
Environment
Applicable for all supported version of Bamboo.
Diagnosis
1) The first step toward diagnosis is to understand the structure of these users in DB, the below query should return null results which means these users are not present in Bamboo DB anymore.
select * from cwd_user where user_name in ('user1','user2')
select * from cwd_user where lower_user_name in ('user1','user1')
Please replace user1, user2 with the correct usernames which are reported being missing.
2) The second is to check if these users were deleted, the entry would be found in crowd_deleted_entity table.
select * from crowd_deleted_entity where entity_name in ('user1','user2')
The result would be displayed as below, it will tell exactly at what time the users were deleted
Cause
Now from the diagnosis we know the time at which the users were deleted, any delete action would be captured in <bamboo-home>logs>atlassian-bamboo-access.log file
When any user is deleted from any Admin user below information is captured in the atlassian-bamboo-access.log file.
2023-11-07 08:20:06,156 INFO [http-nio-8085-exec-23] [AccessLogFilter] 10.10.0.1 Adminuser DELETE http://localhost:8085/rest/api/latest/admin/users/ankit 435889kb
Now from the above log information we see the Admin user deleted the user which was reported as missing, this way we can know the cause of the users which are missing.
There are multiple ways in which you can filter out these results from atlassian-bamboo-access.log file.
1) The timestamp is known from the DB results in the diagnosis section, look for the same time stamp in atlassian-bamboo-access.log file to see what action happened
2) Do a grep "user1" atlassian-bamboo-access*.log, the last result would give you what happened to the user. Here user1 is the user which is reported missing.
3) Do a grep "DELETE" atlassian-bamboo-access*.log, this will list all the delete actions which were performed and you can filter from that.
Solution
If a user is deleted, the only option left is to recreate the user again in Bamboo internal directory.