Posts tagged with: failed cpanel update

Fatal error, run database recovery // Thread died in Berkeley DB library // corrupt RPM database

I received two notifications, the first being a failed cpanel update warning due to not having the needed RPMs, and the second being an RPM update failure warning.

This was due to RPM database corruption and is easy to fix.

1. Navigate to /var/lib/rpm where your rpm database files are located

2. Delete or rename the current __db files – they will look something like this –

-rw-r–r–   1 root root    24576 Oct 27 23:00 __db.001
-rw-r–r–   1 root root   262144 Oct 27 23:00 __db.002
-rw-r–r–   1 root root  1318912 Oct 27 23:00 __db.003
-rw-r–r–   1 root root   770048 Oct 27 01:31 __db.004

3. Do “rpm –rebuilddb” – this will build brand new __db files just like the above – note that it takes a while for them to be rebuilt.

4. You can then proceed with your updates (ie. “YUM UPDATE”) – my understanding is that you can skip step 3 and a YUM UPDATE with no __db files shoudl rebuild them for you as well

I also subsequently ran SMART tests on my drives to make sure there were no drive issues, just to be sure.

The full error messages I was seeing looked something like the below –

Thread died in Berkeley DB library error: db3 error(-30974) from dbenv->failchk: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages database in /var/lib/rpm