IBM Support

How to resolve rpm DB_RUNRECOVERY errors

How To


Summary

Certain conditions can cause the RPM database to become corrupt. Typically this is an interrupted install/update, but there can be packaging errors, or other problems which can cause this corruption.

Objective

Describe the symptoms of database corruption, and provide steps to rebuild the database.
SYMPTOMS
rpm commands result in the following errors:
error: db4 error(-30974) from dbenv->failchk: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db4 - (-30974)
error: cannot open Packages database in /opt/freeware/packages
error: rpmdb: Thread/process 32244334/1 failed: Thread died in Berkeley DB library
error: db4 error(-30974) from dbenv->failchk: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db4 - (-30974)
error: cannot open Packages database in /opt/freeware/packages
* These errors indicate a corrupt RPM database

Steps

NOTE: These instructions only apply to systems using packages from the AIX Toolbox for Linux Applications download site.
1) If rpm.rte is lower than 4.13.0.4, update to the latest version, because, in 4.13.0.4, the Toolbox release isolated the rpm runtime files which are sometimes overwritten by non_IBM provided RPM packages.
If the rpm.rte update does not resolve the db4 errors:
2) Change directory to the RPM database directory.     
cd /opt/freeware
3) Make a backup     
tar -chvf `date +"%d%m%Y"`.rpm.packages.tar packages
4) Remove the __db* lockfiles used by the RPM system.  
     (The other files are databases in Berkeley DB format, do not remove them)     
rm -f /opt/freeware/packages/__*
5) Rebuild the database     
/usr/bin/rpm --rebuilddb
6)  Test the rpm command again     
/usr/bin/rpm -qa

Additional Information

SUPPORT

A) For all questions or issues with Toolbox packages, the support is handled by the AIX Open Source Team in the forum: https://community.ibm.com/community/user/power/communities/community-home?CommunityKey=10c1d831-47ee-4d92-a138-b03f7896f7c9

The AIX Open Source Team provides support through the forum, only. They answer questions, if possible, but they don't own the packages, or formally support them. For true expertise in usage of each package, users should consult the community for each respective package. 

** Cases opened to address Toolbox problems will be canceled and users will be referred to the Open Source Forum.
If you experience technical issues accessing the AIX Open Source community or forum, refer to the footer of the IBM Community forum page.
There is email, and "Contact Us" information for community support

B) If there is a problem with installing rpm.rte, or executing the rpm binary file, open an AIX Case (See the following C section) for assistance.

Examples of rpm.rte issues supported through AIX Support:
- Errors updating or migrating the rpm.rte file set
- Commands from the rpm.rte file set coredump, or have runtime errors.

Example of an rpm.rte rpm loading issue:

# rpm -qa
    exec(): 0509-036 Cannot load program /usr/opt/freeware/bin/rpm because of the following errors:
    0509-150 Dependent module libnss3.so could not be loaded.
    0509-022 Cannot load module libnss3.so.
    0509-026 System error: A file or directory in the path name does not exist.

 
This example would be handled through an IBM AIX Support case, and the support team would help resolve the missing modules.
To learn what is provided and supported by the rpm.rte file set:

# lslpp -f rpm.rte

C) Opening an AIX Support Case

If additional assistance is required due to issues with rpm.rte file set (see preceding B section), use the following step-by-step instructions to contact IBM to open a case for software with an active and valid support contract.  

1.  Document (or collect screen captures of) all symptoms, errors, and messages related to your issue.

2.  Capture any logs or data relevant to the situation.

3.  Contact IBM to open a case:

   -For electronic support, see the IBM Support Community:
     https://www.ibm.com/mysupport
   -If you require telephone support, see the web page:
      https://www.ibm.com/planetwide/

Document Location

Worldwide

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG10","label":"AIX"},"Component":"RPM, AIX Toolbox for Linux","Platform":[{"code":"PF002","label":"AIX"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]

Document Information

Modified date:
29 August 2023

UID

ibm10843426