Ldapsearch Error code 32 and 49

cas, ldap, openldap

Solution

Error 32 usually means, the referenced object does not exist. I.e. You entered a bad DN value for something that needed a correct DN value.

Error 49, is the generic login failed, and each LDAP server adds subcodes or other error messages unique to itself, and you get the fun of understanding those cases.

So your DN for Admin is likely incorrect.

Problem

I have an error, when I'm executing the next code ``` ldapsearch -xLLL -D "cn=admin,dc=geobolivia,dc=gob,dc=bo" -W > dump-geobolivia.ldif ``` the error that I have is the ``` No such object (32) ``` and the error that appear in the syslog file is the next ``` Dec 19 18:49:00 geobolivia slapd[3045]: conn=1050 op=103 SRCH base="ou=users,dc=geobolivia,dc=gob,dc=bo" scope=1 deref=3 filter="(&(objectClass=*)(mail=*@*)(givenName=*))" Dec 19 18:49:00 geobolivia slapd[3045]: <= bdb_substring_candidates: (mail) not indexed Dec 19 18:49:00 geobolivia slapd[3045]: conn=1050 op=103 SEARCH RESULT tag=101 err=0 nentries=2 text= Dec 19 18:49:00 geobolivia slapd[3045]: conn=1050 op=104 SRCH base="ou=groups,dc=geobolivia,dc=gob,dc=bo" scope=1 deref=3 filter="(&(objectClass=posixGroup)(cn=el_*))" Dec 19 18:49:00 geobolivia slapd[3045]: <= bdb_substring_candidates: (cn) not indexed Dec 19 18:49:00 geobolivia slapd[3045]: conn=1050 op=104 SEARCH RESULT tag=101 err=0 nentries=0 text= Dec 19 18:49:01 geobolivia slapd[3045]: conn=1078 fd=22 ACCEPT from IP=127.0.0.1:57379 (IP=127.0.0.1:389) Dec 19 18:49:01 geobolivia slapd[3045]: conn=1078 op=0 BIND dn="cn=admin,dc=geobolivia,dc=gob,dc=bo" method=128 Dec 19 18:49:01 geobolivia slapd[3045]: conn=1078 op=0 BIND dn="cn=admin,dc=geobolivia,dc=gob,dc=bo" mech=SIMPLE ssf=0 Dec 19 18:49:01 geobolivia slapd[3045]: conn=1078 op=0 RESULT tag=97 err=0 text= Dec 19 18:49:01 geobolivia slapd[3045]: conn=1078 op=1 SRCH base="" scope=2 deref=0 filter="(objectClass=*)" Dec 19 18:49:01 geobolivia slapd[3045]: conn=1078 op=1 SEARCH RESULT tag=101 err=32 nentries=0 text= Dec 19 18:49:01 geobolivia slapd[3045]: conn=1078 op=2 UNBIND Dec 19 18:49:01 geobolivia slapd[3045]: conn=1078 fd=22 closed ``` I read in some post that i have to add the in the code the ou=users ``` ldapsearch -xLLL -D "cn=admin,ou=users,dc=geobolivia,dc=gob,dc=bo" -W > dump-geobolivia.ldif ``` and when I do that, the error that I have is the ``` ldap_bind: Invalid credentials (49) ``` and the log is ``` Dec 19 18:58:43 geobolivia slapd[3045]: conn=1080 fd=17 ACCEPT from IP=127.0.0.1:57515 (IP=127.0.0.1:389) Dec 19 18:58:43 geobolivia slapd[3045]: conn=1080 op=0 BIND dn="cn=admin,ou=users,dc=geobolivia,dc=gob,dc=bo" method=128 Dec 19 18:58:43 geobolivia slapd[3045]: conn=1080 op=0 RESULT tag=97 err=49 text= Dec 19 18:58:43 geobolivia slapd[3045]: conn=1080 op=1 UNBIND Dec 19 18:58:43 geobolivia slapd[3045]: conn=1080 fd=17 closed ``` I'm using bind9 as DNS server and I think that's the problem but I don't know how to solve that.

Original source