Confluence - Crowd inconsistent synchronization - Unmatched braces in the pattern
Problem
Confluence/Jira fails to sync with Crowd/LDAP servers or inconsistently syncs missing groups and users
The following appears in the atlassian-confluence.log
:
2014-08-20 20:22:06,091 QuartzScheduler_Worker-0 INFO ServiceRunner [atlassian.crowd.directory.DbCachingRemoteChangeOperations] removed [ 1 ] user members from [ xxxxxxx ] in [ 1ms ]
2014-08-20 20:22:06,154 QuartzScheduler_Worker-0 INFO ServiceRunner [atlassian.crowd.directory.DbCachingRemoteChangeOperations] removed [ 1 ] user members from [ xxxxxxx ] in [ 1ms ]
2014-08-20 20:22:06,502 QuartzScheduler_Worker-0 INFO ServiceRunner [atlassian.crowd.directory.DbCachingRemoteDirectory] failed synchronisation complete for directory [ xxxxxx ] in [ 124364ms ]
2014-08-20 20:22:06,613 QuartzScheduler_Worker-0 ERROR ServiceRunner [atlassian.crowd.directory.DbCachingDirectoryPoller] Error occurred while refreshing the cache for directory [ xxxxxx ].
java.lang.IllegalArgumentException: Unmatched braces in the pattern.
Diagnosis
You should see an attempt to remove or add users from a group right before a failed synchronization and the "Unmatched braces in the pattern" as we can see above.
- Add the class "com.atlassian.crowd.directory" and set to DEBUG in Administration -> Logging and Profiling
Force a new synchronization with the affected directory
Search in the latest logs for the last sync attempt and locate the error message. You should see something like this:
[atlassian.crowd.directory.DbCachingRemoteChangeOperations] synchronising [ 0 ] user members for group [ thisisa{test{group ]
- If you have curly brackets in the group/user name as we can see above, you are affected by this issue.
Cause
This issue is caused due to curly brackets ( { ) being used in the name of some group or user in the directory (Crowd or LDAP).
Resolution
- Remove/Rename the group/user containing the curly brackets in the affected directory and sync the application again.