Fisheye users get disabled after username change in LDAP
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
This workaround was tested by Atlassian on Fisheye versions 3.7.0, 3.8.0, and 3.8.1 only. We cannot provide support if the scripts are executed on other versions.
Problem
Fisheye users get disabled after their username changes within LDAP, once one of the involved users logs in with the new username, Fisheye/Crucible creates a new account for it and the old one appears as deleted.
Diagnosis
Environment:
- Fisheye/ Crucible uses JIRA for user authentication and LDAP to synchronise users.
- Automatic synchronisation is active in Fisheye/Crucible
Diagnostic Steps:
Change the username in LDAP for one or more users (eg. username from uppercase to lowercase).
Cause
Auto-add users into Fisheye is set to 'true' so, when the user connects for the first time with the new LDAP username Fisheye creates a new user for him.
Workaround
The script provided modifies the Fisheye database content and is not intended as a best practice but only as a last resort. Please be aware that repeated use may prevent the correct behaviour of your instance.
One possible workaround is that you fix the situation directly in the Database following this procedure:
Always back up your data before performing any modifications to the database. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.
- Stop Fisheye/Crucible instance
Locate the ID of both the old user and new user in the database:
select new_user.cru_user_id, old_user.cru_user_id from cru_user old_user cross join cru_user new_user where old_user.cru_user_name = 'OLD_USER_NAME - to be modified' and new_user.cru_user_name = 'NEW_USER_NAME - to be removed'
Follow the procedure corresponding to the database you are using
- Start Fisheye/Crucible instance
Reindex Crucible
Administration > Crucible > Re-index
Resolution
To prevent the problem the best practice is to follow some basic guidelines when it comes to renaming users in LDAP.
Renaming users when FishEye/Crucible is using external authentication