Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Ambari Ldap sync error: javax.naming.InvalidNameException

avatar
Rising Star
"href" : "http://127.0.0.1:8080/api/v1/ldap_sync_events/17",
  "Event" : {
  "id" : 17,
  "specs" : [
  {
  "names" : "HDP_Admin,HDP_Developer,HDP_Users",
  "sync_type" : "specific",
  "principal_type" : "groups"
  },
  {
  "names" : "user1,user2,user3",
  "sync_type" : "specific",
  "principal_type" : "users"
  }
  ],
  "status" : "ERROR",
  "status_detail" : "Caught exception running LDAP sync. Invalid name: /ldap.xxxxx.com:389; nested exception is javax.naming.InvalidNameException: Invalid name: /ldap.xxx.com:389",
  "summary" : {
  "groups" : {
  "created" : null,
  "removed" : null,
  "updated" : null
  },
  "memberships" : {
  "created" : null,
  "removed" : null
  },
  "users" : {
  "created" : null,
  "removed" : null,
  "updated" : null
  }
  },
  "sync_time" : {
  "end" : 1449508883644,
  "start" : 1449508883642
  }
1 ACCEPTED SOLUTION

avatar
Master Mentor
@Mike Li

I believe you are giving ldap url as Primary URL* {host:port} (ldap://ldap.xxxxxxx.com:389): ldap://ldap.xxxxx.com:389

Please see the following format.

Primary URL* {host:port} xxxxx:389 ( You don't need to give ldap://xxxxx:389)

http://docs.hortonworks.com/HDPDocuments/Ambari-2.1.2.1/bk_Ambari_Security_Guide/content/_setting_up...

authentication.ldap.primaryUrlserver:portThe hostname and port for the LDAP or AD server. Example: my.ldap.server:389

View solution in original post

8 REPLIES 8

avatar
Master Mentor

@Mike Li

Please verify ldap url as it looks like there is typo or url is not correct

avatar
Rising Star

This is the ldap url, did not see anything wrong with it:

authentication.ldap.primaryUrl=ldap.xxxx.com:389

avatar
Master Mentor

@Mike Li

Could you run ambari-server sync and then paste entries from log? May be, something wrong with DN.

This is sample from my demo env

641-screen-shot-2015-12-07-at-32117-pm.png

avatar
Master Mentor

@Mike Li As mentioned earlier

Please check url. You are mentioning ldap://host:389

please provide host:389 instead ladp://host:389

avatar
Rising Star

ambari-server-20151207.zip--setup-----

sudo /usr/sbin/ambari-server setup-ldap

Using python/usr/bin/python2.7

Setting up LDAP properties...

Primary URL* {host:port} (ldap://ldap.xxxxxxx.com:389): ldap://ldap.xxxxx.com:389

Secondary URL {host:port} :

Use SSL* [true/false] (false): false

User object class* (user): user

User name attribute* (sAMAccountName): sAMAccountName

Group object class* (group): group

Group name attribute* (cn): cn

Group member attribute* (member):

Distinguished name attribute* (DistinguishedName):

Base DN* (dc=CENTENE,dc=com):

Referral method [follow/ignore] (follow):

Bind anonymously* [true/false] (false):

Manager DN* (CN=xxxxxx,OU=LDAP,DC=xxxxxxx,DC=com):

Enter Manager Password* :

Re-enter password:

====================

Review Settings

====================

authentication.ldap.managerDn: CN=xxxuser,OU=LDAP,DC=xxxxxx,DC=com

authentication.ldap.managerPassword: *****

Save settings [y/n] (y)? y

Saving...done

Ambari Server 'setup-ldap' completed successfully.

====Log file======================

see attachment.

avatar
Master Mentor
@Mike Li

I believe you are giving ldap url as Primary URL* {host:port} (ldap://ldap.xxxxxxx.com:389): ldap://ldap.xxxxx.com:389

Please see the following format.

Primary URL* {host:port} xxxxx:389 ( You don't need to give ldap://xxxxx:389)

http://docs.hortonworks.com/HDPDocuments/Ambari-2.1.2.1/bk_Ambari_Security_Guide/content/_setting_up...

authentication.ldap.primaryUrlserver:portThe hostname and port for the LDAP or AD server. Example: my.ldap.server:389

avatar
Rising Star

After changing to server:port ,it works. Thank you!

avatar

All,

I think you may have missed an important thing:

sudo /usr/sbin/ambari-server setup-ldap

Using python/usr/bin/python2.7

Setting up LDAP properties...

We only support python 2.6.6, using 2.7 causes many many issues. Please use python 2.6.6. Also, I suggest you do an ldapsearch to test your settings:

ldapsearch -x -H ldap://ldap.xxxxx.com -b dc=CENTENE,dc=com -D "CN=xxxxxx,OU=LDAP,DC=xxxxxxx,DC=com" -W "(sAMAccountName=<User-to-search-for>)"