Directory syncronization fails due to Unbalanced parenthesis
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
JIRA is connected to an LDAP and the directory synchronization fails. The following appears in the atlassian-jira.log
:
1
2
3
4
5
2013-11-19 14:06:08,507 QuartzScheduler_Worker-2 ERROR ServiceRunner [atlassian.crowd.directory.DbCachingDirectoryPoller] Error occurred while refreshing the cache for directory [ 10000 ].
com.atlassian.crowd.exception.OperationFailedException: java.util.concurrent.ExecutionException: com.atlassian.crowd.exception.OperationFailedException: org.springframework.ldap.InvalidSearchFilterException: Unbalanced parenthesis; nested exception is javax.naming.directory.InvalidSearchFilterException: Unbalanced parenthesis; remaining name 'dc=example,dc=com'
at com.atlassian.crowd.directory.ldap.cache.UsnChangedCacheRefresher.synchroniseAllUsers(UsnChangedCacheRefresher.java:166)
...
Caused by: java.util.concurrent.ExecutionException: com.atlassian.crowd.exception.OperationFailedException: org.springframework.ldap.InvalidSearchFilterException: Unbalanced parenthesis; nested exception is javax.naming.directory.InvalidSearchFilterException: Unbalanced parenthesis; remaining name 'dc=example,dc=com'
Cause
This problem is caused by wrong LDAP filter defined either into the User Object Filter or Group Object Filter of your directory configuration.
Resolution
To solve this problem check your search filter. You can see more details about LDAP filters in this documentation.
ℹ️ One of the most common problems in this configuration is related to the negation element (!). Follow is an example of utilization:
1
(&(objectCategory=Person)(sAMAccountName=*)(!(description=test)))
Was this helpful?