RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1601229 - Restoring a single database with bak2db.pl fails.
Summary: Restoring a single database with bak2db.pl fails.
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: 389-ds-base
Version: 7.4
Hardware: All
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: mreynolds
QA Contact: Viktor Ashirov
URL:
Whiteboard:
Depends On:
Blocks: 1601230
TreeView+ depends on / blocked
 
Reported: 2018-07-15 11:39 UTC by Têko Mihinto
Modified: 2021-12-10 16:39 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-08-09 14:34:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Têko Mihinto 2018-07-15 11:39:40 UTC
Description of problem:

Restoring a single database with bak2db.pl fails.

The documentation clearly stated to stop the server and to use bak2db:

https://access.redhat.com/documentation/en-us/red_hat_directory_server/10/html/administration_guide/Populating_Directory_Databases-Backing_Up_and_Restoring_Data#Backing_Up_and_Restoring_Data-Restoring_a_Single_Database

Nevertheless the option to specify a single database exists for bak2db.pl:

# bak2db.pl -h
...
        -n backend   - Backend database name.  Example: userRoot
#

The option "-n" is also documented:

https://access.redhat.com/documentation/en-us/red_hat_directory_server/10/html/configuration_command_and_file_reference/perl_scripts#Perl_Scripts-bak2db.pl_Restore_database_from_backup


Version-Release number of selected component (if applicable):

Customer version is 389-ds-base-1.3.6.1-28


How reproducible:

Always.


Steps to Reproduce:

1) Backup all the databases:

# /usr/lib64/dirsrv/slapd-<INSTANCE_NAME>/db2bak.pl -Z <INSTANCE_NAME> -D "cn=Directory Manager" -w <PASSWORD> -P LDAP
Back up directory: /var/lib/dirsrv/slapd-<INSTANCE_NAME>/bak/<INSTANCE_NAME>-2018_7_13_13_38_44
Successfully added task entry "cn=backup_2018_7_13_13_38_44, cn=backup, cn=tasks, cn=config"


2) Restore with -n userRoot option

# /usr/lib64/dirsrv/slapd-<INSTANCE_NAME>/bak2db.pl -n userRoot -D "cn=Directory Manager" -w <PASSWORD> -P LDAP -a /var/lib/dirsrv/slapd-<INSTANCE_NAME>/bak/<INSTANCE_NAME>-2018_7_13_13_38_44
Successfully added task entry "cn=restore_2018_7_13_13_39_42, cn=restore, cn=tasks, cn=config"


# tail -5 /var/log/dirsrv/slapd-<INSTANCE_NAME>/errors
[13/Jul/2018:13:39:43.401930381 +0300] - ERR - ldbm_back_archive2ldbm - Failed to read backup file set. Either the directory specified doesn't exist, or it exists but doesn't contain a valid backup set, or file permissions prevent the server reading the backup set.  error=-30973 (BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery)
[13/Jul/2018:13:39:43.637120337 +0300] - NOTICE - NSMMReplicationPlugin - multimaster_be_state_change - Replica <SUFFIX> is coming online; enabling replication
[13/Jul/2018:13:39:43.659506721 +0300] - WARN - NSMMReplicationPlugin - replica_reload_ruv - New data for <SUFFIX> does not match the data in the changelog.
 Recreating the changelog file. This could affect replication with replica's  consumers in which case the consumers should be reinitialized.
[13/Jul/2018:13:39:43.668762466 +0300] - INFO - task_restore_thread - Restore finished.


3) ldapsearch fails:

# ldapsearch -LLL -x -D "cn=Directory Manager" -w <PASSWORD> -b <SUFFIX> -s base 1.1
No such object (32)


4) Restoring  all databases works fine:

# /usr/lib64/dirsrv/slapd-<INSTANCE_NAME>/bak2db.pl -D "cn=Directory Manager" -w <PASSWORD> -P LDAP -a /var/lib/dirsrv/slapd-<INSTANCE_NAME>/bak/<INSTANCE_NAME>-2018_7_13_13_38_44
Successfully added task entry "cn=restore_2018_7_13_13_42_28, cn=restore, cn=tasks, cn=config"


5) ldapsearch returns the expected result.


Actual results:

Failure to restore a single database.


Expected results:

bak2db.pl should not accept the option "-n".


Additional info:

Comment 2 Têko Mihinto 2018-07-15 11:51:16 UTC
Filed the following bug for RHDS documentation:

Bug 1601230 - Remove the option "-n" from the bak2db.pl documentation.

Comment 5 mreynolds 2018-08-09 14:34:16 UTC
Known issue, and this is no longer supported.  Closing bug.


Note You need to log in before you can comment on or make changes to this bug.