# openldap backup fails - slap_startup? [SOLVED]

## ExecutorElassus

so, when i try to upgrade openldap, it says i should back up my databases. fair enough, and it even gives me some instructions:

```

 *  1. /etc/init.d/slurpd stop ; /etc/init.d/slapd stop

 *  2. slapcat -l /root/ldapdump.1146658275.raw

 *  3. egrep -v '^entryCSN:' </root/ldapdump.1146658275.raw >/root/ldapdump.114$

 ...etc...

```

but when i get to step 2, i get this:

```
$ slapcat -l /root/ldapdump.1146628259.raw

slap_startup failed

```

well, okay. but now what? being a total newbie at openldap/slapcat/slurpcat/whatever, i have no idea why it failed, so i can't fix it, and thus can't upgrade.

can anybody offer some tips? using the -v flag does nothing.

thanks,

EELast edited by ExecutorElassus on Tue May 09, 2006 4:15 am; edited 1 time in total

----------

## patroy

I'm having the same issue...

```
!!! ERROR: net-nds/openldap-2.3.21 failed.

Call stack:

  ebuild.sh, line 1541:   Called dyn_setup

  ebuild.sh, line 657:   Called pkg_setup

  openldap-2.3.21.ebuild, line 125:   Called openldap_find_versiontags

  openldap-2.3.21.ebuild, line 95:   Called openldap_upgrade_howto

  openldap-2.3.21.ebuild, line 70:   Called die
```

```
slapcat -l /root/ldapdump.1146802336.raw

slap_startup failed
```

I don't recall ever using slapcat so I'm at a total loss. I trying to find some info through google. So we'll see.

----------

## patroy

I'm still stuck...

I've looked everywhere that I can think of to no avail.

Maybe we should file a bug report?

Are you installing the same version as me 2.3.21?

I've tried re-installing the installed instance to see if that would allow me to run slapcat, but nothing changed.

Have you had any luck?

----------

## ExecutorElassus

just synced again today, still no change.

i'm using 2.3.21, and i filed this bug. 

hope something comes through, and i'm glad i'm not the only one with this.

cheers,

EE

----------

## gfa

```
$ slapcat -l /root/ldapdump.1146628259.raw

slap_startup failed

```

if you change your berkeley db version??? (asuming that your are using bdb as backend)

then, you should recompile your openldap

note that 2.3.20 is considered stable, not 2.3.21

http://www.openldap.org/software/download/

----------

## ExecutorElassus

recompiled openldap (i've been using 2.2.28-r4 all this time), still no go.

and yes, gfa, i'm using ~arch. 

any idea how to get slapcat/slap_startup to tell me why it failed?

thanks,

EE

----------

## gfa

your slapd starts?? if you make a search aganist the slapd, it awsers??

then, you could do a ldapsearch that retrieve all the tree to a ldif file, erase/move /var/lib/openldap-data update openldap , then import the ldif with slapadd

good luck

----------

## ExecutorElassus

the steps to move openldap-data, and import the ldif using slapadd, are later in the instructions than the problem i'm having. the full instructions i get are:

```
 * 

 * A (possible old) installation of OpenLDAP was detected,

 * installation will not proceed for now.

 * 

 * As major version upgrades can corrupt your database,

 * you need to dump your database and re-create it afterwards.

 * 

 *  1. /etc/init.d/slurpd stop ; /etc/init.d/slapd stop

 *  2. slapcat -l /root/ldapdump.1146959550.raw

 *  3. egrep -v '^entryCSN:' </root/ldapdump.1146959550.raw >/root/ldapdump.1146959550

 *  4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup

 *  5. emerge --update \=net-nds/openldap-2.3.21

 *  6. etc-update, and ensure that you apply the changes

 *  7. slapadd -l /root/ldapdump.1146959550

 *  8. chown ldap:ldap /var/lib/openldap-data/*

 *  9. /etc/init.d/slapd start

 * 10. check that your data is intact.

 * 11. set up the new replication system.

 * 

```

the steps you're describing are 4,5, and 7. i can't get past 2.

thanks,

EE

----------

## patroy

I'm still looking around.

two things I'm wondering though.

1) when you carried out step one where you given

```
 * WARNING:  slurpd has not yet been started.

 * WARNING:  slapd has not yet been started.

```

Just curious...

2) Do you or anyone know what kind of damage would happen if I where to say just force this upgrade. Other than the possibility of having to rebuild the entire database. Which I don't even know what is in the database at this moment.

It seems to me that if slurpd/slapd was never turned on. Then I was presumably never using it and that there won't be much of a database if any to rebuild...

----------

## ExecutorElassus

there's a new ebuild (2.3.21-r1) that fixes this issue. go forth, sync, and be merry.

cheers,

EE

----------

## patroy

It didn't fix the problem for me...

What are your "use" options...

I'm still getting the exact same error.

```
These are the packages that would be merged, in order:

Calculating world dependencies... done!

[ebuild     U ] net-nds/openldap-2.3.21-r1 [2.2.28-r4] USE="berkdb crypt gdbm perl readline ssl tcpd -debug -ipv6 -kerberos -minimal -odbc -overlays% -samba -sasl -slp" 0 kB

Total size of downloads: 0 kB

Would you like to merge these packages? [Yes/No] y

>>> Emerging (1 of 1) net-nds/openldap-2.3.21-r1 to /

>>> checking ebuild checksums ;-)

>>> checking auxfile checksums ;-)

>>> checking miscfile checksums ;-)

>>> checking openldap-2.3.21.tgz ;-)

 *

 * A (possible old) installation of OpenLDAP was detected,

 * installation will not proceed for now.

 *

 * As major version upgrades can corrupt your database,

 * you need to dump your database and re-create it afterwards.

 *

 *  1. /etc/init.d/slurpd stop ; /etc/init.d/slapd stop

 *  2. slapcat -l /root/ldapdump.1147199370.raw

 *  3. egrep -v '^entryCSN:' </root/ldapdump.1147199370.raw >/root/ldapdump.1147199370

 *  4. mv /var/lib/openldap-data/ /var/lib/openldap-data-backup/

 *  5. emerge --update \=net-nds/openldap-2.3.21

 *  6. etc-update, and ensure that you apply the changes

 *  7. slapadd -l /root/ldapdump.1147199370

 *  8. chown ldap:ldap /var/lib/openldap-data/*

 *  9. /etc/init.d/slapd start

 * 10. check that your data is intact.

 * 11. set up the new replication system.

 *

!!! ERROR: net-nds/openldap-2.3.21-r1 failed.

Call stack:

  ebuild.sh, line 1543:   Called dyn_setup

  ebuild.sh, line 659:   Called pkg_setup

  openldap-2.3.21-r1.ebuild, line 132:   Called openldap_find_versiontags

  openldap-2.3.21-r1.ebuild, line 96:   Called openldap_upgrade_howto

  openldap-2.3.21-r1.ebuild, line 70:   Called die

!!! You need to upgrade your database first

!!! If you need support, post the topmost build error, and the call stack if relevant.
```

Any suggestions?!?...

----------

## ExecutorElassus

you need to set USE="minimal" for this workaround, at least according to this bug.

try that, and see if it helps.

cheers,

EE

----------

## gfa

 *ExecutorElassus wrote:*   

> the steps to move openldap-data, and import the ldif using slapadd, are later in the instructions than the problem i'm having. the full instructions i get are:
> 
> ```
>  * 
> 
> ...

 

im saying that replace slapcat & sed (steps 2&3) with a ldapsearch, an slapcat withouth entryCSN is exactly the same than ldapsearch of all the tree.

----------

## patroy

I've tried with the minimal USE flag and still the exact same message.

----------

## neowarez

yes .. I have the same problem.. I already use the minimal flag and it outputs the same.

----------

## patroy

Well for me it seems that what solved the problem was, re-emerging the original instance of openldap with the minimal flag then emerging the new one with the flag as well.

I don't know of an easier way.

Hope it helps.

----------

