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

RE: Problem storing and retrieving data from DB



First, Thank you for the quick response! 

> I am assuming that there is a typo there and points 1 and 2 should 
> really be talking about /var/lib/ldap as the directory.
Correct!

> I believe the admin guide 
> states that you need to use slapadd to get the very root of your 
> database installed.  So, try the following:
Actually, the OpenLDAP 2.1 Admin Guide (20 August 2002) section 7 seems to
state  that one can create the DB over LDAP while the DB is online(section
7.1, which has been failing for me), *or* using the slapadd utility in an
off-line mode(section 7.2, which you mentioned). But, something was wrong
with my execution of the instructions in section 7.1 as I indicated in my
original request for help. So, I am following your instructions. 

> 1) normalize the dn's in your ldif file 
>    (that is, remove the embedded spaces)
> 2) service ldap stop (or just kill off all slapd processes)

> 3) slapadd -f ldap00.ldif
Instruction number 3 kept on failing with a message (I used the -d -1 flag
with the slapadd command): "
  =>str2entry
  Str2entry -1 has no dn
  Slapadd: (could not parse entry (line=55)
  Slapadd shutdown: initiated"
And some other lines.

Line 55 was the last line in my target ldif file. Just by guessing, I used
the dos2unix utility on the ldif file, and this error went away!  :)


>4) chown -R ldap:ldap /var/lib/ldap
>5) start slapd (either as you did or "service ldap start")
>6) do the ldapsearch

This seems to work! I will examine the output in detail tomorrow.

Thank you, again, for your help!

Mehrad


-----Original Message-----
From: Frank Swasey [mailto:Frank.Swasey@uvm.edu] 
Sent: Monday, February 24, 2003 12:16 PM
To: Yasrebi, Mehrad
Cc: 'openldap-software@OpenLDAP.org'
Subject: Re: Problem storing and retrieving data from DB


Today at 9:09am, Yasrebi, Mehrad wrote:

> 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.

I am assuming that there is a typo there and points 1 and 2 should 
really be talking about /var/lib/ldap as the directory.

Given the slapd.conf file you included below, there should have been 
both the dn2id.gdbm and cn.gdbm files in that directory.

You are having an error doing the ldapadd.  I believe the admin guide 
states that you need to use slapadd to get the very root of your 
database installed.  So, try the following:

1) normalize the dn's in your ldif file (that is, remove the embedded 
spaces)

2) service ldap stop (or just kill off all slapd processes)

3) slapadd -f ldap00.ldif

4) chown -R ldap:ldap /var/lib/ldap

5) start slapd (either as you did or "service ldap start")

6) do the ldapsearch

> 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).

Correct, this is (usually) just complaining that TCP6 isn't configured 
on your system.  You can completely eliminate this error message by 
building openldap without tcp6 support.

> 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.

Absolutely NOT!  /etc/ldap.conf is used by the nss-ldap package and 
/etc/openldap/ldap.conf is used by the openldap client programs.

-- 
Frank Swasey                    | http://www.uvm.edu/~fcs
Systems Programmer              | Always remember: You are UNIQUE,
University of Vermont           |    just like everyone else.
                    === God Bless Us All ===