Information and Links
Join the fray by commenting, tracking what others have to say, or linking to it from your blog.
Yum Lock table is out of available locker entries
Today while running a yum update on one RHEL5 server, I got the following error and python traceback:
-
yum update
-
Loading "security" plugin
-
Loading "rhnplugin" plugin
-
rhel-i386-server-5 100% |=========================| 1.2 kB 00:00
-
primary.xml.gz 100% |=========================| 1.6 MB 00:01
-
rhel-i386-: ################################################## 4462/4462
-
Skipping security plugin, no data
-
Setting up Update Process
-
rpmdb: Lock table is out of available locker entries
-
rpmdb: Unknown locker ID: 75ba
-
error: db4 error(22) from dbenv->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 ?
-
yummain.main(sys.argv[1:])
-
File "/usr/share/yum-cli/yummain.py", line 105, in main
-
result, resultmsgs = base.doCommands()
-
File "/usr/share/yum-cli/cli.py", line 293, in doCommands
-
return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds)
-
File "/usr/share/yum-cli/yumcommands.py", line 163, in doCommand
-
return base.updatePkgs(extcmds)
-
File "/usr/share/yum-cli/cli.py", line 600, in updatePkgs
-
installed = self.rpmdb.simplePkgList()
-
File "/usr/lib/python2.4/site-packages/yum/rpmsack.py", line 158, in simplePkgList
-
return self.pkglist
-
File "/usr/lib/python2.4/site-packages/yum/rpmsack.py", line 59, in _get_pkglist
-
self._make_header_dict()
-
File "/usr/lib/python2.4/site-packages/yum/rpmsack.py", line 235, in _make_header_dict
-
for (hdr, idx) in self._all_packages():
-
File "/usr/lib/python2.4/site-packages/yum/rpmsack.py", line 206, in _all_packages
-
mi = ts.dbMatch()
-
TypeError: rpmdb open failed
As scary as all that looks, it was easy to find the solution. Apparently this is caused by a well known rpm DB lock. First ensure that no instances of yum or rpm are running. You can do this by issuing the command 'ps ax | grep yum' and 'os ax | grep rpm'. If either of these show an instance of yum or running, kill it off or wait for it to finish. Then as super user, following these tho instructions:
-
rm /var/lib/rpm/__db.*
-
rpm --rebuilddb
That is it. You should be able to run 'yum clean all' and 'yum update'. Since we use MailScanner, I had to then contend with the annoying conflict with the MailScanner perl packages. But... that is another story.

