LDAP or CROWD Synchronization Fails with java.lang.IllegalStateException: Unable to rename user x to X
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
Symptoms
Synchronization fails and the following appears in atlassian-confluence.log
:
1
2
2013-10-14 13:13:56,551 ERROR [scheduler_Worker-3] [atlassian.crowd.directory.DbCachingDirectoryPoller] pollChanges Error occurred while refreshing the cache for directory [ 622595 ].
java.lang.IllegalStateException: Unable to rename user x to X
Cause
Username case in the cwd_user table is different than the one stored in LDAP.
Workaround 1
Disable incremental synchronization for this user directory and re-run the full synchronization. You can expect it to be completed successfully.
Workaround 2
If workaround 1 fails, please run the following SQL query to manually update the offending entry:
1
2
UPDATE cwd_user set user_name='X' WHERE user_name='x' AND directory_id != (SELECT id FROM cwd_directory WHERE directory_name='Confluence Internal Directory');
UPDATE user_mapping set username='X' WHERE username='x';
After that synchronize your user directory and it should complete successfully.
Was this helpful?