Bug 240834

Summary: Update of openldap-servers package deletes whole database
Product: Red Hat Enterprise Linux 5 Reporter: Jan Safranek <jsafrane>
Component: openldapAssignee: Jan Safranek <jsafrane>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 5.0CC: jplans
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2007-0499 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-11-07 17:28:44 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jan Safranek 2007-05-22 07:23:02 UTC
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
manually restored.

Version-Release number of selected component (if applicable):
openldap-servers-2.3.27-5

How reproducible:

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"

Actual results:
the ldap database is empty

Expected results:
the ldap database remains full

Additional info:
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.

Comment 1 RHEL Program Management 2007-05-22 07:44:05 UTC
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
release.

Comment 4 Jan Safranek 2007-06-22 10:46:16 UTC
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 
backup...)
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.


Comment 7 errata-xmlrpc 2007-11-07 17:28:44 UTC
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.

http://rhn.redhat.com/errata/RHBA-2007-0499.html