Red Hat Bugzilla – Bug 240834
Update of openldap-servers package deletes whole database
Last modified: 2007-11-30 17:07:44 EST
Description of problem:
Update of openldap-servers package will result in empty database. There is a
backup of the database created by the openldap-servers.rpm, but it must be
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. fill your ldap database
2. rpm -Uvh openldap-servers-2.3.27-X where X > 5
3. ldapsearch -x -b "dc=example,dc=com"
the ldap database is empty
the ldap database remains full
There is a bug in openldap.spec - it saves the database to backup in %preun
section and restores it from there in %post. Unfortunately, %post is executed
before %preun, so the database is not restored.
We cannot simply fix %preun for 5.1 release, because it is taken from the old
package openldap-servers-2.3.27-5 (part of RHEL 5.0 release), which is already
installed. I.e. the update from 5.0 to 5.1 will delete the database. We can fix
our release for RHEL 5.1, so any future update (e.g. from 5.1 to 5.2) will be OK.
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release. Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products. This request is not yet committed for inclusion in an Update
Just a note what will happen during update from 5.0 to 5.1:
1. %pre (of NEW version): save backup of the database and delete it (because
the DB format between releases may change) -
2. %post (of NEW version): restore database from backup
3. %preun (of OLD version): backup the database and delete it (this is the bug)
4. %posttrans (of NEW version): restore the backup (this is the bugfix)
Result: database is correctly restored from backup, no data are lost. But it
takes some time, because the database is saved/restored twice.
In following updates (5.1->5.2)
1. & 2. as in prev. update
3. was removed from the spec file
4. does nothing, because 3. was removed
Result: database is correctly restored from backup, no data are lost.
Problems are stil with "update" from 5.0 to 5.0
1. not present in 5.0
2. %post (of NEW version): restore database from backup (but there is no
3. %preun (of OLD version): backup the database and delete it
4. is not is 5.0
Result: database is is empty. It can be restored from backup created in step 3,
but it requires admin intervention. There is no way how to fix the RPM, which
was already released to the customers.
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.