Bug 249990

Summary: setroubleshoot keeps locking the rpm database
Product: [Fedora] Fedora Reporter: Edward Rudd <urkle>
Component: setroubleshootAssignee: John Dennis <jdennis>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 7   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-08-23 16:27:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Edward Rudd 2007-07-29 02:11:41 UTC
Description of problem:
periodically when I try to install an RPM package, or work with RPM, rpm will
fail with errors like this

rpmdb: Lock table is out of available locker entries
rpmdb: Unknown locker ID: ae8
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

when I try to look at who's locked the RPM database using fuser I receive
/var/lib/rpm/Basenames:  5799
/var/lib/rpm/__db.001:  5799m
/var/lib/rpm/__db.002:  5799m
/var/lib/rpm/__db.003:  5799m
/var/lib/rpm/Name:    5799
/var/lib/rpm/Packages:  5799
/var/lib/rpm/Pubkeys:  5799

which, in this case 5799 is owned by setroubleshoot (python)

running lsof -p 5799 shows LOTS of access by setroubleshoot to the rpm db,
including around 32 entries each for Packages,Basenames, Pubkeys, Name, as well
as the DB transaction files __db.00[1-3]

-- lsof output --
setrouble 5799 root  mem    REG      253,0   115056 1026433
/usr/lib/python2.5/site-packages/rpm/_rpmmodule.so
setrouble 5799 root  mem    REG      253,0   450560  786481 /var/lib/rpm/__db.003
setrouble 5799 root  mem    REG      253,0  1318912  786444 /var/lib/rpm/__db.002
setrouble 5799 root  mem    REG      253,0    24576  786440 /var/lib/rpm/__db.001
setrouble 5799 root    9r   REG      253,0 49958912  819258 /var/lib/rpm/Packages
setrouble 5799 root   11r   REG      253,0 10629120  819645 /var/lib/rpm/Basenames
setrouble 5799 root   12r   REG      253,0    12288  820384 /var/lib/rpm/Pubkeys
setrouble 5799 root   17r   REG      253,0    86016  819644 /var/lib/rpm/Name

In order to get my system sane again I have to stop setroubleshoot, and then
remove the __db.* transaction files and rebuild the rpmdb for good measure.:)

Version-Release number of selected component (if applicable):
1.9.4-2.fc7

How reproducible:
frequently (not sure WHAT is causing it)

So much so that I had to disable setroubleshoot on my systems to stop it from
happening.

Comment 1 John Dennis 2007-08-23 16:27:54 UTC

*** This bug has been marked as a duplicate of 246564 ***