Issue with cPanel UPCP – Cpanel update fails with rpm database error

Error :

[2020-04-29 21:12:40 -0500] * FATAL: Failed to download updatenow.static from server: (XID auwp49) “/bin/rpm” reported error code “1” when it ended:
error: rpmdb: BDB0113 Thread/process 241300/139965192148800 failed: BDB1507 Thread died in Berkeley DB library
[2020-04-29 21:12:40 -0500] error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery
[2020-04-29 21:12:40 -0500] error: cannot open Packages index using db5 - (-30973)
[2020-04-29 21:12:40 -0500] error: cannot open Packages database in /var/lib/rpm
[2020-04-29 21:12:40 -0500] error: rpmdb: BDB0113 Thread/process 241300/139965192148800 failed: BDB1507 Thread died in Berkeley DB library
[2020-04-29 21:12:40 -0500] error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery
[2020-04-29 21:12:40 -0500] error: cannot open Packages database in /var/lib/rpm

Another similar error is the below if you try to perform yum update

#yum update

error: rpmdb: BDB0113 Thread/process 241300/139965192148800 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
CRITICAL:yum.main:
Error: rpmdb open failed

Reason :

The error says your RPM Database is Corrupted. If this is happening only once you just need to rebuild the database.
If this is a recurring issue, then you need to introspect the server with an Experienced Senior Admin

Solution :

To fix this issue, please perform the below commands

First, create a backup of the existing rpm DB and for that use the below commands

mkdir /tmp/rpm.db.backup
cp -a /var/lib/rpm/__db* /tmp/rpm.db.backup

To Confirm whether the backup is created properly, use the below command

ls -l /tmp/rpm.db.backup

To Remove the rpm DB files, use the below command

rm -f /var/lib/rpm/__db*

To Query existing packages, use the below command

rpm --quiet -qa

To Rebuild RPM database , use the below command

rpm --rebuilddb

To clear all cached information from yum, use the below command

yum clean all

Confirm if the above solution is working by running the below commands

/scripts/upcp --force
yum update
rpm -qa |grep "any package"

If all is properly running, your issue is fixed and you are good to go !!!

If you need any assistance in Hosting you can always contact us for one-time help or for regular monthly services etc.

 

Scroll to Top