LDAP sync issues
Asked by Rajesh Kancherla:

I am able to test the connectivity to LDAP. But when I try to run the other tests it is not completing and I see below error in the logs:  
17-Jul-2020 09:57:18.347 WARNING \[Catalina-utility-2\] org.apache.catalina.valves.StuckThreadDetectionValve.notifyStuckThreadDetected Thread \[http-nio-8090-exec-10\] (id=\[213\]) has been active for \[67,258\] milliseconds (since \[7/17/20 9:56 AM\]) to serve the same request for \[[http://xxxxx:8090/plugins/servlet/embedded-crowd/directories/troubleshoot/](http://cdcalv049.na.convergys.com:8090/plugins/servlet/embedded-crowd/directories/troubleshoot/)\] and may be stuck (configured threshold for this StuckThreadDetectionValve is \[60\] seconds). There is/are \[1\] thread(s) in total that are monitored by this Valve and may be stuck.  
java.lang.Throwable  
at java.naming@11.0.7/com.sun.jndi.ldap.pool.Pool.getPooledConnection(Pool.java:131)  
at java.naming@11.0.7/com.sun.jndi.ldap.LdapPoolManager.getLdapClient(LdapPoolManager.java:340)  
at java.naming@11.0.7/com.sun.jndi.ldap.LdapClient.getInstance(LdapClient.java:1602)  
at java.naming@11.0.7/com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2752)  
at java.naming@11.0.7/com.sun.jndi.ldap.LdapCtx.\<init\>(LdapCtx.java:320)  
at java.naming@11.0.7/com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:192)  
at java.naming@11.0.7/com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:210)  
at java.naming@11.0.7/com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:153)  
at java.naming@11.0.7/com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:83)  
at java.naming@11.0.7/javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:719)  
at java.naming@11.0.7/javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:305)  
at java.naming@11.0.7/javax.naming.InitialContext.init(InitialContext.java:236)  
at java.naming@11.0.7/javax.naming.ldap.InitialLdapContext.\<init\>(InitialLdapContext.java:154)  
at org.springframework.ldap.core.support.LdapContextSource.getDirContextInstance(LdapContextSource.java:42)  
at org.springframework.ldap.core.support.AbstractContextSource.createContext(AbstractContextSource.java:343)  
at org.springframework.ldap.core.support.AbstractContextSource.doGetContext(AbstractContextSource.java:139)  
at org.springframework.ldap.core.support.AbstractContextSource.getReadWriteContext(AbstractContextSource.java:174)  
at org.springframework.ldap.transaction.compensating.manager.TransactionAwareContextSourceProxy.getReadWriteContext(TransactionAwareContextSourceProxy.java:88)  
at org.springframework.ldap.transaction.compensating.manager.TransactionAwareContextSourceProxy.getReadOnlyContext(TransactionAwareContextSourceProxy.java:61)  
at com.atlassian.crowd.directory.SpringLDAPConnector.testConnection(SpringLDAPConnector.java:1416)  

If i use default timeout settings I get below error:

17-Jul-2020 10:13:38.434 WARNING \[Catalina-utility-2\] org.apache.catalina.valves.StuckThreadDetectionValve.notifyStuckThreadDetected Thread \[http-nio-8090-exec-5\] (id=\[208\]) has been active for \[66,784\] milliseconds (since \[7/17/20 10:12 AM\]) to serve the same request for \[<http://cdcalv049.na.convergys.com:8090/plugins/servlet/embedded-crowd/directories/troubleshoot/>\] and may be stuck (configured threshold for this StuckThreadDetectionValve is \[60\] seconds). There is/are \[1\] thread(s) in total that are monitored by this Valve and may be stuck.  
java.lang.Throwable  
at java.naming@11.0.7/com.sun.jndi.ldap.pool.Pool.getPooledConnection(Pool.java:131)  
at java.naming@11.0.7/com.sun.jndi.ldap.LdapPoolManager.getLdapClient(LdapPoolManager.java:340)  
at java.naming@11.0.7/com.sun.jndi.ldap.LdapClient.getInstance(LdapClient.java:1602)  
at java.naming@11.0.7/com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2752)  
at java.naming@11.0.7/com.sun.jndi.ldap.LdapCtx.\<init\>(LdapCtx.java:320)

On GUI:

I get this:  
Test basic connection : SucceededTest retrieve user : Failedorg.springframework.ldap.PartialResultException: nested exception is javax.naming.PartialResultException \[Root exception is javax.naming.CommunicationException: concentrix.com:389 \[Root exception is java.net.ConnectException: Connection timed out (Connection timed out)\]\]

Any help will be really appreciated.

Regards,

Rajesh Kancherla.


Answers:
author: Diego
body: Hello there!

As I understand, your connection between Confluence and LDAP is timing out and not working as expected.

I believe that there is a chance that your instance is being affected by the situation described here:
> * [++***\[Confluence Server\] Synchronization with LDAP Server Fails with PartialResultException***++](https://confluence.atlassian.com/confkb/synchronization-with-ldap-server-fails-with-partialresultexception-726565294.html)

Let us hear from you!