rpmdb: Lock table is out of available locker entries
If up2date throws some horrible Python errors and rpm says “rpmdb: Lock table is out of available locker entries”, you can restore your system to normality with the following:
The errors:
rpmdb: Lock table is out of available locker entries 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
Make a backup of /var/lib/rpm in case you break something:
tar cvzf rpmdb-backup.tar.gz /var/lib/rpm
Remove the Berkeley databases that rpm uses:
rm /var/lib/rpm/__db.00*
Make rpm rebuild the databases from scratch (may take a short while):
rpm --rebuilddb
Now, check rpm to make sure everything is okay:
rpm -qa | sort
Why does this happen?
When rpm accesses the Berkeley database files, it makes temporary locker entries within the tables while it searches for data. If you control-c your rpm processes often, this issue will occur much sooner because the locks are never cleared.
Update: As of February 2009, this post received five times the visits of my next most popular post. This situation must happen very often!
Texas1EMT
Texas1EMT
majorh at gmail
rackerhacker / +1-830-584-1564
rackerhacker
[...] did some research, and I found this guy’s website. Very helpful indeed, and a fellow RHCE. His tips did the trick. I’m going to spell [...]
Glad I was able to help!
It’s really helpful.
Thanks! That helped me too! Great description and solve of the problem!
[...] source: Racker Hacker [...]
This tip is very helpful
hi,
worked very good with me
thanks alot
Worked fine!!
Thanks
Another thanks from me!
Thanks from me as well
Did the job for me as well, thanks!
[...] So, what to do? Google, of course! Fortunately, major over at Racker Hacker encountered this same issue about a year and a half ago and has already provided the fix for us: [...]
I’m really glad to hear that this fix has helped so many people!
Great stuff, thank you very much. Saved my day
You the man. Many thanks.
Great!! Now it works!
Thanks Major, great stuff!! Now back to the original problem I was trying to solve….
Precious major
Did the trick, thanks!
Thanks a lot for this, saved me a lot of time !
Thank you!
Thanks for all of the feedback! I’m glad I was able to help everyone out of this annoying situation!
u rock!! fixing my stressful yum server
Thanks.. Solved the problem.. unlike the gits over at CPanel.net….
Thanks for this article, help fixed the problem for me
Thanks a lot ! You saved another guy !
and herein lies why i hate rpm distros, oh well, at least its an easy fix!
@Trophaeum:
Because other package management tools don’t use DBs that could have locking issues?
“tar cvzf rpmdb-backup.tar.gz /var/lib/rpm”
Now which file(s) do I delete that I backed up? Is it…
__db.001
__db.002
__db.003
Thanks.
Thanks a lot it helps me a lot
muchas gracias desde chile. thanks
Thx! this really helps
Thanks for the fix, I’m not sure if this was the case with other people, and the reason why it started showing up more frequently recently, but my server uptime is nearing 3 years and this problem just showed up. Could be totally unrelated!
Many thanks, you saved my night
Daniel
[...] 參考來源 : rpmdb: Lock table is out of available locker entries [...]
Thanks for this, fixed one of our servers that was failing to run a cPanel EasyApache update. Tips like these are invaluable to desperate Googlers!
A long time ago on a much older version of RedHat (7.x or 8.x series I think), this would happen quite often and you’d have to rebuild the database all the time. For a while, its been fine, now suddenly I’m running into this problem again on RHEL 5 systems. Maybe its a bug regression or something.