Thursday, August 09, 2007

RPM Fix - Lock table is out of available locker entries

I just noticed one of my servers was acting kind of sluggish. I ran an uptime and was greeted with:

 [xxx@yyy zzzz]$ uptime
 15:34:23  up 277 days,  2:14,  4 users,  load average: 518.68, 196.46, 71.51

Holy smokes!

After killing a whole bunch of processes with:

   sudo kill -9 `ps auxww|grep command-to-kill | awk '{print $2}'`

the system finally recovered. I thought I was out of the woods. But, when I went run an rpm -Uhv on a package I was greeted with this message:

 [xxx@yyy zzz]$ sudo rpm -Uhv php-gd-5.2.3-5.i386.rpm
 rpmdb: Lock table is out of available locker entries
 error: cannot open Packages index using db3 - Cannot allocate memory (12)
 error: cannot open Packages database in /var/lib/rpm

D'oh. After a Google search, I found the fix to this problem here. Which boils down to:

 rm /var/lib/rpm/__db.00*
 rpm --rebuilddb

The rebuild command took a minute or two to run. Then all was well again. Whew.

5 comments:

  1. Glad that rackerhacker.com was able to help you! :-)

    ReplyDelete
  2. So am I!

    Thanks for a most excellent site.

    ReplyDelete
  3. Anonymous8:16 PM

    Thank you for the tip. I had this exact problem and your solution fixed it!

    ReplyDelete
  4. So glad it was helpful!

    -Ben

    ReplyDelete
  5. This worked for me :

    cd /var/lib/rpm
    db_recover


    You'd probably want to take a backup of the 'rpm' directory incase something goes wrong.

    Stupid Berkeley database nonsense.

    ReplyDelete