[Date Prev][Date Next] [Chronological] [Thread] [Top]

Problem storing and retrieving data from DB



Title: Message
Hi there!
 
I am new to OpenLDAP, and I have been trying to get the toy examples going. But, I am
having some problems. Having searched the archives here, I suspect that my
problem/error is rather simple, but I am at a loss as to what is wrong!
So, I hope this is the right forum for me to understand what the problem is.
 
I use "ldapsearch" before and after using "ldapadd", and can not find any
records added in. Some info about the "directory"  may be useful:
  1) /var/lib is owned by "ldap" user and group.
  2) /var/lib has only one file ("dn2id.gdbm"), even after ldapadd!
  3) All of the /usr/bin/ldap* commands are owned by root user and group.
 
Note: Based on reading these problem reports, I am led to expect that the
message  "daemon: socket() failed errno=97 (Address family not supported by protocol)" message
is not  a problem (re: msg by Kurt D. Zeilenga on 02 Nov, 2000).
 
Also, I wonder whether the reason that I have two ldap.conf files
is due to having two separate and likely uncooperative
ldap (client and server) packages in Linux.
 
Thanks, in advance, for any help that may be forthcoming!
 
Mehrad
 
 
Platform
-----------
OpenLDAP Version: 2.0.25
OS: RH Linux 8
 
 
/etc/ldap.conf   (#comments removed)
--------------------------------------------------
host 127.0.0.1
base dc=example,dc=com
 
 
 
/etc/openldap/ldap.conf  (#comments removed)
---------------------------------------------------------------
HOST 127.0.0.1
BASE dc=example,dc=com
 
 

slapd.conf
----------
database        ldbm
suffix          "dc=example,dc=com"
rootdn          "cn=Manager,dc=example,dc=com"
rootpw          secret
directory       /var/lib/ldap
index   cn                      pres,eq
 

Starting the daemon
--------------------
slapd -d 1 -d 4 -d 32 -d 256 -d 1024 -d 2048 -u ldap
@(#) $OpenLDAP: slapd 2.0.25-Release (Mon Aug 26 23:18:40 EDT 2002) $
       
root@daffy.perf.redhat.com:/usr/src/build/141199-i386/BUILD/openldap-2.0.25/build-krb5/servers/slapd
daemon_init: <null>
daemon_init: listen on
ldap:///
daemon_init: 1 listeners to open...
ldap_url_parse_ext(
ldap:///)
daemon: socket() failed errno=97 (Address family not supported by protocol)
daemon: initialized
ldap:///
daemon_init: 1 listeners opened
slapd init: initiated server.
slap_sasl_init: initialized!
slapd startup: initiated.
slapd starting
 

Target LDIF file (from the tutorial on www.sbfsbo.com/mike )
----------------
# File: ldif00.ldif
 
# Root node
dn: dc=example,dc=com
objectclass: organization
objectclass: dcObject
o: example.com
dc: example.com
 
# The IT branch node
dn: ou=IT, dc=example,dc=com
objectclass: organizationalUnit
ou: IT
 
# The Sales branch node
dn: ou=Sales, dc=example,dc=com
objectclass: organizationalUnit
ou: Sales
 
# The Super-User's node
dn: cn=Manager, dc=example,dc=com
objectclass: organizationalRole
cn: Manager
 

# A leaf node
dn: cn=Michael Yee, ou=IT, dc=example,dc=com
objectclass: person
cn: Michael Yee
sn: Yee
 
# Another leaf node
dn: cn=Rick Francis, ou=IT, dc=example,dc=com
objectclass: person
cn: Rick Francis
sn: Francis
 
# Yet another leaf node
dn: cn=Dhananjay Kulkarni, ou=Sales, dc=example,dc=com
objectclass: person
cn: Dhananjay Kulkarni
sn: Kulkarni
 

dn: cn=Wil Cooley, ou=Sales, dc=example,dc=com
objectclass: person
cn: Wil Cooley
sn: Cooley
 
# Finally, geez!
dn: cn=Jennifer Jones, ou=Sales, dc=example,dc=com
objectclass: person
cn: Jennifer Jones
cn: Jenny Jones
cn: Jenny Smith
sn: Jones
 
 
 
Check for DB contents, add records (LDIF file) to the DB, and attempt retrieval
-------------------------------------------------------------------------------
# ldapsearch -x -LL -b 'dc=example,dc=com' '(cn=*)'
version: 1
 
No such object (32)
# ldapadd -x -D "cn=Manager,dc=example,dc=com" -W -f ldif00.ldif
Enter LDAP Password:
# ldapsearch -x -LL -b 'dc=example,dc=com' '(cn=*)'
version: 1
 
No such object (32)
#
 
 
 
slapd Messages (for ldapadd and 2nd ldapsearch)
-----------------------------------------------
daemon: conn=1 fd=9 connection from IP=127.0.0.1:1051 (IP=0.0.0.0:389)
accepted.connection_get(9)
connection_get(9): got connid=1
connection_read(9): checking for input on id=1
ber_get_next
ber_get_next: tag 0x30 len 46 contents:
ber_get_next
ber_get_next on fd 9 failed errno=11 (Resource temporarily unavailable)
do_bind
ber_scanf fmt ({iat) ber:
ber_scanf fmt (o}) ber:
do_bind: version=3 dn="cn=Manager,dc=example,dc=com" method=128
conn=1 op=0 BIND dn="CN=MANAGER,DC=EXAMPLE,DC=COM" method=128
==> ldbm_back_bind: dn: cn=Manager,dc=example,dc=com
dn2entry_r: dn: "CN=MANAGER,DC=EXAMPLE,DC=COM"
=> dn2id( "CN=MANAGER,DC=EXAMPLE,DC=COM" )
=> ldbm_cache_open( "/var/lib/ldap/dn2id.gdbm", 34, 600 )
<= ldbm_cache_open (cache 0)
<= dn2id NOID
dn2entry_r: dn: "DC=EXAMPLE,DC=COM"
=> dn2id( "DC=EXAMPLE,DC=COM" )
=> ldbm_cache_open( "/var/lib/ldap/dn2id.gdbm", 34, 600 )
<= ldbm_cache_open (cache 0)
<= dn2id NOID
do_bind: v3 bind: "cn=Manager,dc=example,dc=com" to
"cn=Manager,dc=example,dc=com"
send_ldap_result: conn=1 op=0 p=3
send_ldap_result: 0::
send_ldap_response: msgid=1 tag=97 err=0
ber_flush: 14 bytes to sd 9
conn=1 op=0 RESULT tag=97 err=0 text=
connection_get(9)
connection_get(9): got connid=1
connection_read(9): checking for input on id=1
ber_get_next
ber_get_next: tag 0x30 len 5 contents:
ber_get_next
ber_get_next on fd 9 failed errno=0 (Success)
connection_read(9): input error=-2 id=1, closing.
connection_closing: readying conn=1 sd=9 for close
connection_close: deferring conn=1 sd=9
do_unbind
conn=1 op=1 UNBIND
connection_resched: attempting closing conn=1 sd=9
connection_close: conn=1 sd=9
conn=-1 fd=9 closed
daemon: conn=2 fd=9 connection from IP=127.0.0.1:1052 (IP=0.0.0.0:389)
accepted.connection_get(9)
connection_get(9): got connid=2
connection_read(9): checking for input on id=2
ber_get_next
ber_get_next: tag 0x30 len 12 contents:
ber_get_next
ber_get_next on fd 9 failed errno=11 (Resource temporarily unavailable)
do_bind
ber_scanf fmt ({iat) ber:
ber_scanf fmt (o}) ber:
do_bind: version=3 dn="" method=128
conn=2 op=0 BIND dn="" method=128
send_ldap_result: conn=2 op=0 p=3
send_ldap_result: 0::
send_ldap_response: msgid=1 tag=97 err=0
ber_flush: 14 bytes to sd 9
conn=2 op=0 RESULT tag=97 err=0 text=
do_bind: v3 anonymous bind
connection_get(9)
connection_get(9): got connid=2
connection_read(9): checking for input on id=2
ber_get_next
ber_get_next: tag 0x30 len 45 contents:
ber_get_next
ber_get_next on fd 9 failed errno=11 (Resource temporarily unavailable)
do_search
ber_scanf fmt ({aiiiib) ber:
SRCH "dc=example,dc=com" 2 0    0 0 0
begin get_filter
PRESENT
ber_scanf fmt (o) ber:
end get_filter 0
    filter: (cn=*)
ber_scanf fmt ({v}}) ber:
    attrs:
conn=2 op=1 SRCH base="dc=example,dc=com" scope=2 filter="(cn=*)"
=> ldbm_back_search
dn2entry_r: dn: "DC=EXAMPLE,DC=COM"
=> dn2id( "DC=EXAMPLE,DC=COM" )
=> ldbm_cache_open( "/var/lib/ldap/dn2id.gdbm", 34, 600 )
<= ldbm_cache_open (cache 0)
<= dn2id NOID
send_ldap_result: conn=2 op=1 p=3
send_ldap_result: 10::
send_ldap_response: msgid=2 tag=101 err=32
ber_flush: 14 bytes to sd 9
conn=2 op=1 RESULT tag=101 err=32 text=
connection_get(9)
connection_get(9): got connid=2
connection_read(9): checking for input on id=2
ber_get_next
ber_get_next: tag 0x30 len 5 contents:
ber_get_next
ber_get_next on fd 9 failed errno=11 (Resource temporarily unavailable)
do_unbind
conn=2 op=2 UNBIND
connection_closing: readying conn=2 sd=9 for close
connection_resched: attempting closing conn=2 sd=9
connection_close: conn=2 sd=9
conn=-1 fd=9 closed