Bug 213892

Summary: RPM database sometimes works only on normal accounts?
Product: [Fedora] Fedora Reporter: George Panagopoulos <panagopoulosalexandrou>
Component: rpmAssignee: Paul Nasrat <pnasrat>
Severity: high Docs Contact:
Priority: medium    
Version: 6   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-07-17 19:57:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Description Flags
Normal user
Root none

Description George Panagopoulos 2006-11-03 17:01:12 UTC
If I login to my normal account and I write the command rpm -qi gcc for example
I get what I should get. But when I login to root with su the same thing fails
if I first do something with yum. The command rpm -qivv gcc gives me the following:
D: opening  db environment /var/lib/rpm/Packages joinenv
D: opening  db index       /var/lib/rpm/Packages rdonly mode=0x0
D: locked   db index       /var/lib/rpm/Packages
D: opening  db index       /var/lib/rpm/Name rdonly mode=0x0

and gets stucked. It is very strange that rpm manages to open Packages but not
Name. Does anyone have an idea what is going on?

To fix this then I must restart my computer.

I've included two strace outputs. One for normal user and one for root user.

Comment 1 George Panagopoulos 2006-11-03 17:01:12 UTC
Created attachment 140276 [details]
Normal user

Comment 2 George Panagopoulos 2006-11-03 17:02:52 UTC
Created attachment 140278 [details]

Comment 3 Jeff Johnson 2006-11-04 04:28:55 UTC
You likely have stale locks. Fix by doing (also done during reboot):
    rm -f /var/lib/rpm/__db*


Comment 4 George Panagopoulos 2006-11-07 18:48:44 UTC
Yes I think that fixes the problem. But what are these files and why do they
cause this problem?

Comment 5 Jeff Johnson 2006-12-03 18:54:07 UTC
Segafualts and loss of data are likely due to removing an rpmdb environment
without correcting other problems in the rpmdb.

FYI: Most rpmdb "hangs" are now definitely fixed by purging stale read locks when opening
a database environment in rpm-4.4.8-0.4. There's more todo, but I'm quite sure that a
large class of problems with symptoms of "hang" are now corrected.

Detecting damage by verifying when needed is well automated in rpm-4.4.8-0.4. Automatically 
correcting all possible damage is going to take more work, but a large class of problems is likely
already fixed in rpm-4.4.8-0.4 as well.


Comment 6 Panu Matilainen 2007-07-17 19:57:35 UTC

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