IBM Support

QRadar: Error: "Fix rpmdb: Thread died in Berkeley DB library" when installing rpm

Troubleshooting


Problem

You can see "db3 error(-30974)" errors when you are interacting with package management yum or rpm operations:
rpmdb: Thread/process 277623/140429100390144 failed: Thread died in Berkeley DB library
error: db3 error(-30974) from dbenv->failchk: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db3 -  (-30974)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.verbose.cli.yumcompletets:Yum Error: Error: rpmdb open failed

Symptom

Rpmdb errors are seen during package management installation. They are related to corrupted RPM database.
yum -y install DSM-MicrosoftWindows-7.4-20211108193921.noarch.rpm
error: rpmdb: BDB0113 Thread/process 24446/139984907597632 failed: BDB1507 Thread died in Berkeley DB library
error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db5 -  (-30973)
error: cannot open Packages database in /var/lib/rpm

Cause

These errors mean that the RPM database is corrupted.

Resolving The Problem

Follow these steps to back up and rebuild the rpm database:
Disclaimer: The next steps are an advanced procedure for users. If you are uncomfortable with this change or need assistance with rebuilding the RPM database, contact QRadar Support.
  1. Create a folder named "backup" in the next path: 
    mkdir /var/lib/rpm/backup
  2. Copy the db files to the backup folder:
    cp -a /var/lib/rpm/__db* /var/lib/rpm/backup/
  3. Remove the db.* files:
    rm -f /var/lib/rpm/__db.[0-9][0-9]*
  4. Run rpm -qa in "silence mode":
    rpm --quiet -qa
  5. Rebuild the db:
    rpm --rebuilddb
  6. Clean:
    yum clean all
  7. After you execute these steps, proceed with the installation of the RPM:
    yum -y <RPM>
    Note: Replacing <RPM> with the rpm name you are trying to install. 
Result
     RPM is successfully installed.
Note: If you continue to have error "db3 error(-30974)", collect logs and open a case.

Document Location

Worldwide

[{"Type":"MASTER","Line of Business":{"code":"LOB24","label":"Security Software"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSBQAC","label":"IBM Security QRadar SIEM"},"ARM Category":[{"code":"a8m0z000000cwsyAAA","label":"Admin Tasks"}],"ARM Case Number":"","Platform":[{"code":"PF016","label":"Linux"}],"Version":"All Versions"}]

Document Information

Modified date:
12 June 2023

UID

ibm16568405