Information and Links

Join the fray by commenting, tracking what others have to say, or linking to it from your blog.


Other Posts

Yum Lock table is out of available locker entries

Posted by plattapuss on November 27th, 2008

Today while running a yum update on one RHEL5 server, I got the following error and python traceback:

CODE:
  1. yum update
  2. Loading "security" plugin
  3. Loading "rhnplugin" plugin
  4. rhel-i386-server-5        100% |=========================| 1.2 kB    00:00     
  5. primary.xml.gz            100% |=========================| 1.6 MB    00:01     
  6. rhel-i386-: ################################################## 4462/4462
  7. Skipping security plugin, no data
  8. Setting up Update Process
  9. rpmdb: Lock table is out of available locker entries
  10. rpmdb: Unknown locker ID: 75ba
  11. error: db4 error(22) from dbenv->close: Invalid argument
  12. error: cannot open Packages index using db3 - Cannot allocate memory (12)
  13. error: cannot open Packages database in /var/lib/rpm
  14. Traceback (most recent call last):
  15.   File "/usr/bin/yum", line 29, in ?
  16.     yummain.main(sys.argv[1:])
  17.   File "/usr/share/yum-cli/yummain.py", line 105, in main
  18.     result, resultmsgs = base.doCommands()
  19.   File "/usr/share/yum-cli/cli.py", line 293, in doCommands
  20.     return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds)
  21.   File "/usr/share/yum-cli/yumcommands.py", line 163, in doCommand
  22.     return base.updatePkgs(extcmds)
  23.   File "/usr/share/yum-cli/cli.py", line 600, in updatePkgs
  24.     installed = self.rpmdb.simplePkgList()
  25.   File "/usr/lib/python2.4/site-packages/yum/rpmsack.py", line 158, in simplePkgList
  26.     return self.pkglist
  27.   File "/usr/lib/python2.4/site-packages/yum/rpmsack.py", line 59, in _get_pkglist
  28.     self._make_header_dict()
  29.   File "/usr/lib/python2.4/site-packages/yum/rpmsack.py", line 235, in _make_header_dict
  30.     for (hdr, idx) in self._all_packages():
  31.   File "/usr/lib/python2.4/site-packages/yum/rpmsack.py", line 206, in _all_packages
  32.     mi = ts.dbMatch()
  33. 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:

CODE:
  1. rm /var/lib/rpm/__db.*
  2. 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.



Reader Comments

Sorry, comments are closed.