Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

LDAP Sync failes with ERROR: Exiting with exit code 1. REASON: Caught exception running LDAP sync.

LDAP Sync failes with ERROR: Exiting with exit code 1. REASON: Caught exception running LDAP sync.

Contributor

Hi,

I am getting the below error when I am trying to do ldap sync. Please help me to fix the issue.

$ sudo ambari-server sync-ldap --all Using python /usr/bin/python Syncing with LDAP... Enter Ambari Admin login: admin Enter Ambari Admin password: Syncing all............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................ERROR: Exiting with exit code 1. REASON: Caught exception running LDAP sync. XXXXXXXX:636; socket closed; nested exception is javax.naming.ServiceUnavailableException: XXXXXXXX:636; socket closed

Ambari-server log:

ERROR [pool-18-thread-2] LdapSyncEventResourceProvider:460 - Caught exception running LDAP sync. org.springframework.ldap.ServiceUnavailableException: XXXXXXXX:636; socket closed; nested exception is javax.naming.ServiceUnavailableException: XXXXXXXX:636; socket closed at org.springframework.ldap.support.LdapUtils.convertLdapException(LdapUtils.java:223) at org.springframework.ldap.core.support.AbstractContextSource.createContext(AbstractContextSource.java:356) at org.springframework.ldap.core.support.AbstractContextSource.doGetContext(AbstractContextSource.java:140) at org.springframework.ldap.core.support.AbstractContextSource.getReadOnlyContext(AbstractContextSource.java:159) at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:357) at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:309) at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:642) at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:578) at org.apache.ambari.server.security.ldap.AmbariLdapDataPopulator.getFilteredLdapUsers(AmbariLdapDataPopulator.java:667) at org.apache.ambari.server.security.ldap.AmbariLdapDataPopulator.getLdapUserByMemberAttr(AmbariLdapDataPopulator.java:480) at org.apache.ambari.server.security.ldap.AmbariLdapDataPopulator.refreshGroupMembers(AmbariLdapDataPopulator.java:381) at org.apache.ambari.server.security.ldap.AmbariLdapDataPopulator.synchronizeAllLdapGroups(AmbariLdapDataPopulator.java:194) at org.apache.ambari.server.controller.AmbariManagementControllerImpl.synchronizeLdapUsersAndGroups(AmbariManagementControllerImpl.java:5191) at org.apache.ambari.server.controller.internal.LdapSyncEventResourceProvider.syncLdap(LdapSyncEventResourceProvider.java:490) at org.apache.ambari.server.controller.internal.LdapSyncEventResourceProvider.processSyncEvents(LdapSyncEventResourceProvider.java:448) at org.apache.ambari.server.controller.internal.LdapSyncEventResourceProvider.access$000(LdapSyncEventResourceProvider.java:65) at org.apache.ambari.server.controller.internal.LdapSyncEventResourceProvider$1.run(LdapSyncEventResourceProvider.java:259) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: javax.naming.ServiceUnavailableException: XXXXXXXX:636; socket closed at com.sun.jndi.ldap.Connection.readReply(Connection.java:454) at com.sun.jndi.ldap.LdapClient.ldapBind(LdapClient.java:365) at com.sun.jndi.ldap.LdapClient.authenticate(LdapClient.java:214) at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2791) at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:319)

4 REPLIES 4
Highlighted

Re: LDAP Sync failes with ERROR: Exiting with exit code 1. REASON: Caught exception running LDAP sync.

Contributor

@Sankaru Thumuluru

Could you please check the connectivity between ambari-server and your ldap.

# telnet <ldap_url> <port>

Re: LDAP Sync failes with ERROR: Exiting with exit code 1. REASON: Caught exception running LDAP sync.

Contributor

Hi Rishi,

Yes.. I am able to telnet and if I use the vastool command, I can see the users and groups and able to do ambari-server sync-ldap --groups ambari-server sync-ldap --users. when I use ambari-server sync-ldap -all, I am getting the error.

Thanks,

Sankar.

Re: LDAP Sync failes with ERROR: Exiting with exit code 1. REASON: Caught exception running LDAP sync.

Guru

@Sankaru Thumuluru

Try this, it worked in one such scenarios:

1. Run "ambari-server setup-ldap"

2. when you get to authentication.ldap.groupMembershipAttr, set it to only one attribute // Like authentication.ldap.groupMembershipAttr=memberof

3. For authentication.ldap.managerPassword= <type your password>

4. Encrypt password in this step:

- ambari-server setup-security > select option 2 and restart ambari server

5. Try logging again.

Re: LDAP Sync failes with ERROR: Exiting with exit code 1. REASON: Caught exception running LDAP sync.

Contributor

@Shyam Sunder Rai

I set the parameter to Group member attribute* (memberUid): member.