#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2006
    Posts
    11
    Rep Power
    0

    Question LDAP: No such object(32) ? ?


    Hi,
    I'm trying to setup a Ldap server but unable to resolve "No such object(32)" error. I'm using RHEL 4.0 update 1. The ldap.conf and slapd.conf files are as follows --

    ldap.conf
    #################
    HOST 127.0.0.1
    BASE dc=example,dc=com
    ROOTBINDDN cn=ldapusr,dc=example,dc=com
    ############################

    slapd.conf
    ###################
    include /etc/openldap/schema/core.schema
    include /etc/openldap/schema/cosine.schema
    include /etc/openldap/schema/inetorgperson.schema
    include /etc/openldap/schema/nis.schema

    allow bind_v2

    pidfile /var/run/slapd.pid
    argsfile /var/run/slapd.args

    access to * by *

    database bdb
    suffix dc=example,dc=com
    rootdn cn=ldapusr,dc=example,dc=com
    rootpw {SSHA}5o0UZi3kjXNZxvdiH8n51ZNlBzC6NegU
    directory /var/lib/ldap

    index ou,cn,mail,surname,givenname eq,pres,sub
    index uidNumber,gidNumber,loginShell eq,pres
    index uid,memberUid eq,pres,sub
    index nisMapName,nisMapEntry eq,pres,sub
    #########################################

    The ldap service is started successfully.

    root@localhost openldap]# service ldap start
    Checking configuration files for : config file testing succeeded
    Starting slapd: [ OK ]

    ldap.log
    #########
    Jul 30 08:35:51 localhost slapd[27627]: @(#) $OpenLDAP: slapd 2.2.13 (Aug 19 2004 21:22:15) $ root@porky.build.redhat.com:/usr/src/build/440386-i386/BUILD/openldap-2.2.13/openldap-2.2.13/build-servers/servers/slapd
    Jul 30 08:35:51 localhost slapd[27627]: bdb_initialize: Sleepycat Software: Berkeley DB 4.2.52: (December 3, 2003)
    Jul 30 08:35:51 localhost slapd[27627]: bdb_initialize: Sleepycat Software: Berkeley DB 4.2.52: (December 3, 2003)
    Jul 30 08:35:51 localhost slapd[27627]: bdb_db_init: Initializing BDB database
    Jul 30 08:35:51 localhost slapd[27628]: slapd starting



    Bur ldapsearch is showing the following error.
    [root@localhost openldap]# ldapsearch -x -b "dc=example,dc=com"
    # extended LDIF
    #
    # LDAPv3
    # base <dc=example,dc=com> with scope sub
    # filter: (objectclass=*)
    # requesting: ALL
    #

    # search result
    search: 2
    result: 32 No such object

    # numResponses: 1



    ldap.log
    ##############
    Jul 30 08:37:10 localhost slapd[27628]: conn=0 fd=10 ACCEPT from IP=127.0.0.1:33282 (IP=0.0.0.0:389)
    Jul 30 08:37:10 localhost slapd[27628]: conn=0 op=0 BIND dn="" method=128
    Jul 30 08:37:10 localhost slapd[27628]: conn=0 op=0 RESULT tag=97 err=0 text=
    Jul 30 08:37:10 localhost slapd[27628]: conn=0 op=1 SRCH base="dc=example,dc=com" scope=2 deref=0 filter="(objectClass=*)"
    Jul 30 08:37:10 localhost slapd[27628]: conn=0 op=1 SEARCH RESULT tag=101 err=32 nentries=0 text=
    Jul 30 08:37:10 localhost slapd[27628]: conn=0 op=2 UNBIND
    Jul 30 08:37:10 localhost slapd[27628]: conn=0 fd=10 closed



    If I try to add any entry the same error is encountered.
    example.idlf
    #############
    dn: cn=fred walter,dc=example,dc=com
    cn: fred walter
    ObjectClass: person
    sn: walter
    #######################


    [root@localhost openldap]# ldapadd -x -D "cn=ldapusr,dc=example,dc=com" -W -f example.ldif
    Enter LDAP Password:
    adding new entry "cn=fred walter,dc=example,dc=com"
    ldap_add: No such object (32)



    ldap.log
    #############
    Jul 30 08:45:09 localhost slapd[27628]: conn=6 fd=10 ACCEPT from IP=127.0.0.1:33288 (IP=0.0.0.0:389)
    Jul 30 08:45:09 localhost slapd[27628]: conn=6 op=0 BIND dn="cn=ldapusr,dc=example,dc=com" method=128
    Jul 30 08:45:09 localhost slapd[27628]: conn=6 op=0 BIND dn="cn=ldapusr,dc=example,dc=com" mech=SIMPLE ssf=0
    Jul 30 08:45:09 localhost slapd[27628]: conn=6 op=0 RESULT tag=97 err=0 text=
    Jul 30 08:45:09 localhost slapd[27628]: conn=6 op=1 ADD dn="cn=fred walter,dc=example,dc=com"
    Jul 30 08:45:09 localhost slapd[27628]: conn=6 op=1 RESULT tag=105 err=32 text=
    Jul 30 08:45:09 localhost slapd[27628]: conn=6 op=2 UNBIND
    Jul 30 08:45:09 localhost slapd[27628]: conn=6 fd=10 closed


    Can anyone please help me?
    thank you,
    Joydeep
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2006
    Posts
    142
    Rep Power
    30
    Is your base dn correct?
    Did you put
    cn=fred walter,dc=example,dc=com
    instead of
    uid=fred walter,dc=example,dc=com?
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2006
    Posts
    11
    Rep Power
    0
    sorry joe, i'm late to reply u. my server configurartion is same as whatever i'v posted in the web. any suggestions??
    regards ... joy
  6. #4
  7. Psycho Canadian
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Jan 2001
    Location
    Canada
    Posts
    4,846
    Rep Power
    635
    dc=example,dc=com is not there by default, you have to add it as the first entry. Your when you are trying to add you are assuming dc=example,dc=com is there, just remove the fred walter and try again
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2006
    Posts
    11
    Rep Power
    0
    thanks viper. ur suggestion has worked. i'm able to add entries successfully

    i'v one more doubt. why ldapsearch does not show any result though entries were made successfully?
  10. #6
  11. Psycho Canadian
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Jan 2001
    Location
    Canada
    Posts
    4,846
    Rep Power
    635
    what search are you running, and what is the entry that was made?
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2006
    Posts
    11
    Rep Power
    0
    The following is my ldif file. All the entries hass been created succesfully

    **********
    dn: dc=example,dc=com
    ObjectClass: dcObject
    ObjectClass: organization
    dc: example
    o : Example

    dn: ou=Engineering,dc=example,dc=com
    ObjectClass: OrganizationalUnit
    ou: Engineering

    dn: ou=Sales,dc=example,dc=com
    ObjectClass: OrganizationalUnit
    ou: Sales

    dn: cn=John Smith,ou=Engineering,dc=example,dc=com
    ObjectClass: person
    cn: John Smith
    sn: Smith

    dn: cn=Peter Jenson,ou=Sales,dc=example,dc=com
    ObjectClass: person
    cn: Peter Jenson
    sn: Jenson
    *************

    Now Ldapsearch gives the following result --
    [root@localhost openldap]# ldapsearch -x
    # extended LDIF
    #
    # LDAPv3
    # base <> with scope sub
    # filter: (objectclass=*)
    # requesting: ALL
    #

    # search result
    search: 2
    result: 0 Success

    # numResponses: 1


    ------ldap.log------
    Sep 8 06:36:36 localhost slapd[2100]: conn=8 fd=10 ACCEPT from IP=127.0.0.1:32789 (IP=0.0.0.0:389)
    Sep 8 06:36:36 localhost slapd[2100]: conn=8 op=0 BIND dn="" method=128
    Sep 8 06:36:36 localhost slapd[2100]: conn=8 op=0 RESULT tag=97 err=0 text=
    Sep 8 06:36:36 localhost slapd[2100]: conn=8 op=1 SRCH base="dc=example,dc=com" scope=2 deref=0 filter="(objectClass=*)"
    Sep 8 06:36:36 localhost slapd[2100]: conn=8 op=1 SEARCH RESULT tag=101 err=0 nentries=0 text=
    Sep 8 06:36:36 localhost slapd[2100]: conn=8 op=2 UNBIND
    Sep 8 06:36:36 localhost slapd[2100]: conn=8 fd=10 closed




    ldapsearch -x "cn=John Smith"
    # extended LDIF
    #
    # LDAPv3
    # base <> with scope sub
    # filter: cn=John Smith
    # requesting: ALL
    #

    # search result
    search: 2
    result: 0 Success

    # numResponses: 1

    ---ldap.log---------
    Sep 8 06:35:46 localhost slapd[2100]: conn=7 fd=10 ACCEPT from IP=127.0.0.1:32788 (IP=0.0.0.0:389)
    Sep 8 06:35:46 localhost slapd[2100]: conn=7 op=0 BIND dn="" method=128
    Sep 8 06:35:46 localhost slapd[2100]: conn=7 op=0 RESULT tag=97 err=0 text=
    Sep 8 06:35:46 localhost slapd[2100]: conn=7 op=1 SRCH base="dc=example,dc=com" scope=2 deref=0 filter="(cn=john smith)"
    Sep 8 06:35:46 localhost slapd[2100]: conn=7 op=1 SEARCH RESULT tag=101 err=0 nentries=0 text=
    Sep 8 06:35:46 localhost slapd[2100]: conn=7 op=2 UNBIND
    Sep 8 06:35:46 localhost slapd[2100]: conn=7 fd=10 closed



    can u tell me why it's not listing the existing entries in the database.

    regards,

    Joydeep
  14. #8
  15. Psycho Canadian
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Jan 2001
    Location
    Canada
    Posts
    4,846
    Rep Power
    635
    Make sure to include -D otherwise, if the entries were created with a -D it won't show them. (as in permission denied)

    I think you are missing the attributes.

    ldapsearch -x -D "your=dn" "cn=John Smith" *
  16. #9
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2006
    Posts
    11
    Rep Power
    0

    It worked


    Thanks Viper. It has worked. Thank you once again for ur valuable time. As i'm busy with my office work, i'm not able to carry out this work regularly. Whenever i'll get time i'll come back to disturb you.

    regards,

    Joydeep
  18. #10
  19. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    1
    Rep Power
    0
    Hi Joydeep/Viper_SB,
    I am new on openLDAP server.
    Can you please tell me how can i add new entries in openLDAP?
    Thanks in advance.

IMN logo majestic logo threadwatch logo seochat tools logo