YUM problem: rpmdb: Lock table is out of available locker entries

Few days ago I had a strange problem with yum and instead of clean install and update process I got Python errors and rpm message “rpmdb: Lock table is out of available locker entries”. After few minutes I found out that during installation or update process, rpm accesses the Berkeley database files and it makes temporary locker entries within the tables while it searches for data. Sometimes the locks are never cleared and we have a problem… Don’t worry… It can be fixed…

First here is the complete error:

[root@myserver ~]# yum install firefox
Loading "fastestmirror" plugin
rpmdb: Lock table is out of available locker entries
rpmdb: Unknown locker ID: 3929
error: db4 error(22) from db->close: Invalid argument
error: cannot open Packages index using db3 - Cannot allocate memory (12)
error: cannot open Packages database in /var/lib/rpm
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in ?
  File "/usr/share/yum-cli/yummain.py", line 85, in main
  File "/usr/share/yum-cli/cli.py", line 163, in getOptionsConfig
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 164, in _getConf
    self._conf = config.readMainConfig(startupconf)
  File "/usr/lib/python2.4/site-packages/yum/config.py", line 685, in readMainCo
    yumvars['releasever'] = _getsysver(startupconf.installroot, startupconf.dist
  File "/usr/lib/python2.4/site-packages/yum/config.py", line 755, in _getsysver
    idx = ts.dbMatch('provides', distroverpkg)
TypeError: rpmdb open failed

It looks scary 🙂

The first step is to backup /var/lib/rpm (in case that something goes wrong) with

# mkdir /backup
# tar cvzf /backup/rpm-backup.tar.gz /var/lib/rpm

You don’t need to backup but it is highly recommended.

Remove the Berkeley databases that rpm uses with

# rm /var/lib/rpm/__db.00*

Note: Probably there will be several files. Confirm all removal with “y”

Make rpm rebuild the databases from scratch (this may take a minute or two)

# rpm --rebuilddb

And that should be enough to fix this problem. Additionally you can list rpms to be sure that everything is OK.

# rpm -qa | sort

2 thoughts on “YUM problem: rpmdb: Lock table is out of available locker entries

Leave a Reply

Your email address will not be published. Required fields are marked *