User and Group objects still exist in the database even after they are deleted from the Bamboo Data Center UI
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles 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
This article explains why user and group objects may still be present in the Bamboo Data Center SQL database even after being deleted in the application.
Environment
- Bamboo Data Center
- SQL Database
Diagnosis
When a user or group is deleted in Bamboo, objects and their access are removed from the application, but when checking the data on the Database by running any of the SQL queries outlined in the KB article below, such users can still be seen as available.
Cause
Whenever a user or group stored in Bamboo's Internal Crowd instance is deleted, they are actually marked for deletion. After this action has been in place for 7 days, a CrowdDeletedEntityCleanupJob
is triggered at 4 a.m. to permanently delete these objects from the database. This safety measure procedure allows customers to re-add users within a reasonable recovery period if they were deleted by accident, ensuring that no configuration, profile, or access information is lost. For example:
2025-03-10 04:00:01,932 INFO [scheduler_Worker-12] [CrowdDeletedEntityCleanupJob] Cleaning up after Crowd entities deleted 7 days ago
Solution
The steps below are available from Bamboo 6.8.0 and later. If you have removed users when on a Bamboo version earlier than 6.8.0 please contact the Atlassian Support to discuss a cleanup strategy.
How to control the deleted users and group purge criteria
If you want to remove certain users and groups sooner, you can add a specific system property to Bamboo to set the duration for the deletion action. A daily job will then run at 4 a.m. to purge deleted objects based on the specified threshold.
Set how long a deleted user or group must remain on the system
-Dbamboo.crowd.deleted.entity.timeout.days=7
Note: Modifying system properties requires a restart of the application.
It is also possible to modify the cleanup job schedule to a different time by adding the following system property
Modify it to the hour you want to run it. Use 24h format
-Dbamboo.crowd.deleted.entity.cleanup.hour=4
You can also run the cleanup Job as an ad-hoc action via Bamboo REST
Trigger the CrowdDeletedEntityCleanupJob immediately
$ curl -u admin:password -p -H "Content-Type: application/json" -X POST -d '{"name": "CrowdDeletedEntityCleanupJob", "groupName": "CrowdDeletedEntityCleanupGroup"}' -k 'https://<Bamboo_URL>/rest/admin/latest/scheduler/jobs/trigger'
How to check the users that are marked for deletion directly via SQL
Bamboo will create the CROWD_DELETED_ENTITY
table whenever users or groups are scheduled for deletion. It will use the information from this table to support the CrowdDeletedEntityCleanupJob
. If you want to confirm which users and groups are set to be deleted, you can execute the following query in the Bamboo database:
SELECT * FROM CROWD_DELETED_ENTITY
ORDER BY CROWD_DELETED_ENTITY_ID